Skip to content

Commit fb30416

Browse files
committed
[Fix #1015] Make Style/InvertibleUnlessCondition aware of Active Support methods
Resolves #1015. This PR makes `Style/InvertibleUnlessCondition` aware of Active Support methods. It still inherits the default disabled.
1 parent acafbcb commit fb30416

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#1015](https://github.com/rubocop/rubocop-rails/issues/1015): Make `Style/InvertibleUnlessCondition` aware of Active Support methods. ([@koic][])

config/default.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,14 @@ Style/FormatStringToken:
12041204
AllowedMethods:
12051205
- redirect
12061206

1207+
Style/InvertibleUnlessCondition:
1208+
InverseMethods:
1209+
# Active Support defines some common inverse methods. They are listed below:
1210+
:present?: :blank?
1211+
:blank?: :present?
1212+
:include?: :exclude?
1213+
:exclude?: :include?
1214+
12071215
Style/SymbolProc:
12081216
AllowedMethods:
12091217
- define_method

0 commit comments

Comments
 (0)