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

Remove redundant configuration keys #373

Merged
merged 2 commits into from Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 0 additions & 12 deletions rubocop.yml
Expand Up @@ -24,9 +24,6 @@ Layout/ArgumentAlignment:
Layout/CaseIndentation:
EnforcedStyle: end

Layout/EmptyLineAfterGuardClause:
Enabled: true

Layout/EndAlignment:
EnforcedStyleAlignWith: variable

Expand Down Expand Up @@ -370,9 +367,6 @@ Style/AndOr:
Style/ArgumentsForwarding:
Enabled: false

Style/AsciiComments:
Enabled: false

Style/BisectedAttrAccessor:
Enabled: false

Expand Down Expand Up @@ -439,9 +433,6 @@ Style/EvalWithLocation:
Style/ExpandPathArguments:
Enabled: false

Style/ExplicitBlockArgument:
Enabled: true

Style/ExponentialNotation:
Enabled: false

Expand All @@ -463,9 +454,6 @@ Style/FrozenStringLiteralComment:
literals will become the default in a future Ruby version, and we want to make
sure we''re ready.'

Style/GlobalStdStream:
Enabled: true

Style/GuardClause:
Enabled: false

Expand Down
25 changes: 25 additions & 0 deletions test/config_test.rb
Expand Up @@ -30,4 +30,29 @@ def test_config_is_unchanged
assert(diff.empty?, error_message)
end
end

def test_config_has_no_redundant_entries
config = RuboCop::ConfigLoader.load_file("rubocop.yml")
default_config = RuboCop::ConfigLoader.default_configuration

# This entry is not a cop.
config.delete("inherit_mode")

config.each do |cop_name, cop_config|
default_cop_config = default_config.fetch(cop_name)
cop_config.each do |key, value|
error_message = <<~ERROR
Error: #{cop_name} was configured with the same value as the default
RuboCop configuration.

#{cop_name}:
#{key}: #{value}

Please remove the configuration as it is unnecessary.
ERROR

refute_equal(default_cop_config[key], value, error_message)
end
end
volmer marked this conversation as resolved.
Show resolved Hide resolved
end
end