From b56ca560a122c554f6a19e744f114be6e871bc4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 23:04:07 +0000 Subject: [PATCH 1/2] Update rubocop requirement from ~> 1.39.0 to ~> 1.44.0 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.39.0...v1.44.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- colorls.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colorls.gemspec b/colorls.gemspec index 390117f..4588341 100644 --- a/colorls.gemspec +++ b/colorls.gemspec @@ -75,7 +75,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'ronn', '~> 0' spec.add_development_dependency 'rspec', '~> 3.7' spec.add_development_dependency 'rspec-its', '~> 1.2' - spec.add_development_dependency 'rubocop', '~> 1.39.0' + spec.add_development_dependency 'rubocop', '~> 1.44.0' spec.add_development_dependency 'rubocop-performance', '~> 1.15.0' spec.add_development_dependency 'rubocop-rake', '~> 0.5' spec.add_development_dependency 'rubocop-rspec', '~> 2.17.0' From 33d4ac066a841805a7fc5ceb983c126d2603c9af Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Wed, 25 Jan 2023 21:08:12 +0100 Subject: [PATCH 2/2] Auto-correct rubocop offenses --- lib/colorls/core.rb | 2 +- spec/color_ls/core_spec.rb | 2 +- spec/color_ls/flags_spec.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/colorls/core.rb b/lib/colorls/core.rb index 7448e83..aa6a09b 100644 --- a/lib/colorls/core.rb +++ b/lib/colorls/core.rb @@ -317,7 +317,7 @@ module ColorLS line_array.push links if @hard_links_count line_array.push user_info(content) if @show_user line_array.push group_info(content.group) if @show_group - line_array.concat [size_info(content.size), mtime_info(content.mtime)] + line_array.push(size_info(content.size), mtime_info(content.mtime)) line_array.join(' ') end diff --git a/spec/color_ls/core_spec.rb b/spec/color_ls/core_spec.rb index 6cce9dd..907abbb 100644 --- a/spec/color_ls/core_spec.rb +++ b/spec/color_ls/core_spec.rb @@ -55,7 +55,7 @@ RSpec.describe ColorLS::Core do executable?: false ) - allow(::Dir).to receive(:entries).and_return([camera]) + allow(Dir).to receive(:entries).and_return([camera]) allow(ColorLS::FileInfo).to receive(:new).and_return(file_info) diff --git a/spec/color_ls/flags_spec.rb b/spec/color_ls/flags_spec.rb index 33d3c92..d4e8992 100644 --- a/spec/color_ls/flags_spec.rb +++ b/spec/color_ls/flags_spec.rb @@ -149,8 +149,8 @@ RSpec.describe ColorLS::Flags do end it 'returns no user / group info' do - allow(::Etc).to receive(:getpwuid).and_return(nil) - allow(::Etc).to receive(:getgrgid).and_return(nil) + allow(Etc).to receive(:getpwuid).and_return(nil) + allow(Etc).to receive(:getgrgid).and_return(nil) expect { subject }.to output(/\s+ \d+ \s+ \d+ .* a.txt/mx).to_stdout end @@ -338,7 +338,7 @@ RSpec.describe ColorLS::Flags do let(:args) { ['--snafu'] } it 'issues a warning, hint about `--help` and exit' do # rubocop:todo RSpec/MultipleExpectations - allow(::Kernel).to receive(:warn) do |message| + allow(Kernel).to receive(:warn) do |message| expect(message).to output '--snafu' end