Skip to content

Commit

Permalink
[Fix rubocop#1015] Make Style/InvertibleUnlessCondition aware of Ac…
Browse files Browse the repository at this point in the history
…tive Support methods

Resolves rubocop#1015.

This PR makes `Style/InvertibleUnlessCondition` aware of Active Support methods.
It still inherits the default disabled.
  • Loading branch information
koic committed Aug 28, 2023
1 parent acafbcb commit fb30416
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#1015](https://github.com/rubocop/rubocop-rails/issues/1015): Make `Style/InvertibleUnlessCondition` aware of Active Support methods. ([@koic][])
8 changes: 8 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,14 @@ Style/FormatStringToken:
AllowedMethods:
- redirect

Style/InvertibleUnlessCondition:
InverseMethods:
# Active Support defines some common inverse methods. They are listed below:
:present?: :blank?
:blank?: :present?
:include?: :exclude?
:exclude?: :include?

Style/SymbolProc:
AllowedMethods:
- define_method
Expand Down

0 comments on commit fb30416

Please sign in to comment.