Skip to content

Commit d930b59

Browse files
authored
Merge pull request #1097 from koic/make_style_invertible_unless_condition_aware_of_as_methods
[Fix #1015] Make `Style/InvertibleUnlessCondition` aware of Active Support methods
2 parents d5ad647 + fb30416 commit d930b59

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)