From f186b2fa159a2458f3ff7e8680c3a4fcbdc636d1 Mon Sep 17 00:00:00 2001 From: Colin Kelley Date: Tue, 27 Feb 2024 17:27:17 -0800 Subject: [PATCH] rubocop -a; rubocop -A --- Gemfile | 2 +- lib/listen/logger.rb | 2 +- lib/listen/silencer.rb | 2 +- spec/lib/listen/logger_spec.rb | 2 +- spec/lib/listen/record_spec.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 5c7348cf..ee8bfedb 100644 --- a/Gemfile +++ b/Gemfile @@ -34,6 +34,6 @@ group :development do gem 'netrc', require: false gem 'octokit', require: false gem 'pry-rescue' - gem 'rubocop' + gem 'rubocop', require: false gem 'yard', require: false end diff --git a/lib/listen/logger.rb b/lib/listen/logger.rb index 9689252e..0bb98067 100644 --- a/lib/listen/logger.rb +++ b/lib/listen/logger.rb @@ -46,7 +46,7 @@ def default_logger ::Logger.new(STDERR, level: level) end - + def adapter_warn_behavior_callback(message) if adapter_warn_behavior.respond_to?(:call) case behavior = adapter_warn_behavior.call(message) diff --git a/lib/listen/silencer.rb b/lib/listen/silencer.rb index 4e99b45e..3cc7936c 100644 --- a/lib/listen/silencer.rb +++ b/lib/listen/silencer.rb @@ -75,7 +75,7 @@ def configure(options) end def silenced?(relative_path, type) - path = relative_path.to_s # in case it is a Pathname + path = relative_path.to_s # in case it is a Pathname _ignore?(path) || (only_patterns && type == :file && !_only?(path)) end diff --git a/spec/lib/listen/logger_spec.rb b/spec/lib/listen/logger_spec.rb index 3dfd472b..dd8e3525 100644 --- a/spec/lib/listen/logger_spec.rb +++ b/spec/lib/listen/logger_spec.rb @@ -197,7 +197,7 @@ end [false, nil].each do |behavior| - context 'when the message matches a #{behavior} pattern' do + context "when the message matches a #{behavior} pattern" do let(:message) { "USE #{behavior.inspect}" } it 'respects :silent' do expect(Listen).not_to receive(:warn).with(message) diff --git a/spec/lib/listen/record_spec.rb b/spec/lib/listen/record_spec.rb index b33362b2..4f2a6926 100644 --- a/spec/lib/listen/record_spec.rb +++ b/spec/lib/listen/record_spec.rb @@ -14,7 +14,7 @@ def dir_entries_for(hash) def real_directory(hash) dir_entries_for(hash) - hash.each do |dir, _| + hash.each_key do |dir| realpath(dir) end end