Skip to content

Commit

Permalink
Add test case for detect redundant SafeAutoCorrect: false config
Browse files Browse the repository at this point in the history
  • Loading branch information
ydah committed Mar 26, 2024
1 parent ecd945f commit 077100f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/project/default_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,17 @@ def cop_configuration(config_key)
expect(cop_configuration('Enabled'))
.to all be(true).or(be(false)).or(eq('pending'))
end

it 'does not include unnecessary `SafeAutoCorrect: false`' do
cop_names.each do |cop_name|
next unless default_config.dig(cop_name, 'Safe') == false

safe_autocorrect = default_config.dig(cop_name, 'SafeAutoCorrect')

expect(safe_autocorrect).not_to(
be(false),
"`#{cop_name}` has unnecessary `SafeAutoCorrect: false` config."
)
end
end
end

0 comments on commit 077100f

Please sign in to comment.