Skip to content

Commit

Permalink
Remove redundant configuration keys
Browse files Browse the repository at this point in the history
  • Loading branch information
volmer committed Apr 1, 2022
1 parent 0f3c321 commit 0065d2a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
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
end
end

0 comments on commit 0065d2a

Please sign in to comment.