Skip to content

Commit

Permalink
Merge pull request #1304 from rubocop/enable-new-cops
Browse files Browse the repository at this point in the history
Enable new cops
  • Loading branch information
pirj committed Jun 22, 2022
2 parents 6a821d9 + 0f5e7c2 commit 1929699
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ If you have created a new cop:

* [ ] Added the new cop to `config/default.yml`.
* [ ] The cop is configured as `Enabled: pending` in `config/default.yml`.
* [ ] The cop is configured as `Enabled: true` in `.rubocop.yml`.
* [ ] The cop documents examples of good and bad code.
* [ ] The tests assert both that bad code is reported and that good code is not reported.
* [ ] Set `VersionAdded` in `default/config.yml` to the next minor version.
Expand Down
36 changes: 29 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ AllCops:
- 'tmp/**/*'
- 'spec/smoke_tests/**/*.rb'

# See https://github.com/rubocop/rubocop/issues/6410
Layout/HashAlignment:
Enabled: false
EnforcedHashRocketStyle:
- key
- table
EnforcedColonStyle:
- key
- table

Layout/LineLength:
Max: 80 # default: 120
Expand All @@ -29,11 +33,6 @@ Layout/MultilineMethodCallIndentation:
Layout/MultilineOperationIndentation:
EnforcedStyle: indented

Lint/BooleanSymbol:
Exclude:
- lib/rubocop/cop/rspec/expect_actual.rb
- lib/rubocop/cop/rspec/focus.rb

Lint/InterpolationCheck:
Exclude:
- spec/**/*.rb
Expand Down Expand Up @@ -85,3 +84,26 @@ RSpec/DescribeClass:
Style/FormatStringToken:
Exclude:
- spec/rubocop/**/*.rb

# Enable our own pending cops.

RSpec/BeEq:
Enabled: true
RSpec/BeNil:
Enabled: true
RSpec/ChangeByZero:
Enabled: true
RSpec/ExcessiveDocstringSpacing:
Enabled: true
RSpec/IdenticalEqualityAssertion:
Enabled: true
RSpec/SubjectDeclaration:
Enabled: true
RSpec/VerifiedDoubleReference:
Enabled: true
RSpec/Capybara/SpecificMatcher:
Enabled: true
RSpec/FactoryBot/SyntaxMethods:
Enabled: true
RSpec/Rails/AvoidSetupHook:
Enabled: true
10 changes: 5 additions & 5 deletions spec/rubocop/factory_bot/config_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
'Setting' => 'forty two'
},
'RSpec/Foo' => {
'Config' => 2,
'Enabled' => true
'Config' => 2,
'Enabled' => true
},
'RSpec/Bar' => {
'Enabled' => true
'Enabled' => true
},
'RSpec/Baz' => {
'Enabled' => true,
'StyleGuide' => '#buzz'
'Enabled' => true,
'StyleGuide' => '#buzz'
}
}
end
Expand Down

0 comments on commit 1929699

Please sign in to comment.