forked from freerange/mocha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate rubocop configuration for tests
As stated in commits e423977, 33e373c, fddebc3: > Ideally I would've configured the extra `AllowedMethods` to only apply > to the tests, but I couldn't find a simple way to do that with the > rubocop configuration. It might be worth extracting a separate rubocop > configuration for the tests. Here we do just that.
- Loading branch information
1 parent
fbf023d
commit fb6453e
Showing
2 changed files
with
33 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
inherit_from: ../.rubocop.yml # Inherit from the global configuration | ||
|
||
# It can be useful to violate this cop in tests in order to be more explicit | ||
Lint/UselessTimes: | ||
Enabled: false | ||
|
||
# It can be useful to violate this cop in tests | ||
Lint/EmptyClass: | ||
Enabled: false | ||
|
||
# It can be useful to violate this cop in tests when testing methods that accept a block | ||
Lint/EmptyBlock: | ||
Enabled: false | ||
|
||
# There are a mix of styles in the tests and so I don't think it's worth enforcing for now | ||
Naming/VariableNumber: | ||
Enabled: false | ||
|
||
# These methods from Ruby core are legitimately overridden in the tests | ||
Style/OptionalBooleanParameter: | ||
AllowedMethods: | ||
- respond_to? | ||
- public_methods | ||
- protected_methods | ||
- private_methods | ||
- public_instance_methods | ||
- protected_instance_methods | ||
- private_instance_methods | ||
|
||
Naming/FileName: | ||
CheckDefinitionPathHierarchyRoots: | ||
- test/unit | ||
- test/acceptance |