Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rubocop: Fix Performance/StringInclude & RSpec/BeEq #284

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-05-17 10:11:09 UTC using RuboCop version 1.63.5.
# on 2024-05-17 11:57:48 UTC using RuboCop version 1.63.5.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -12,18 +12,6 @@ Lint/SuppressedException:
Exclude:
- 'Rakefile'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/StringInclude:
Exclude:
- 'Rakefile'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEq:
Exclude:
- 'spec/unit/module_sync/settings_spec.rb'

# Offense count: 3
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ begin

# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
require 'rbconfig'
if /linux/.match?(RbConfig::CONFIG['host_os'])
if RbConfig::CONFIG['host_os'].include?('linux')
task :changelog do
puts 'Fixing line endings...'
changelog_file = File.join(__dir__, 'CHANGELOG.md')
Expand Down
10 changes: 5 additions & 5 deletions spec/unit/module_sync/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
)
end

it { is_expected.not_to eq nil }
it { expect(subject.managed?('Rakefile')).to eq false }
it { expect(subject.managed?('Rakefile/foo')).to eq false }
it { expect(subject.managed?('Gemfile')).to eq true }
it { expect(subject.managed?('Gemfile/foo')).to eq true }
it { is_expected.not_to be_nil }
it { expect(subject.managed?('Rakefile')).to be false }
it { expect(subject.managed?('Rakefile/foo')).to be false }
it { expect(subject.managed?('Gemfile')).to be true }
it { expect(subject.managed?('Gemfile/foo')).to be true }
it { expect(subject.managed_files([])).to eq ['Gemfile'] }
it { expect(subject.managed_files(%w[Rakefile Gemfile other_file])).to eq %w[Gemfile other_file] }
it { expect(subject.unmanaged_files([])).to eq ['Rakefile'] }
Expand Down