Skip to content

Commit ee416ca

Browse files
committed
Handle Naming/Predicate{Naming,Prefix} rename
This cop has been renamed, so we conditionally set the config depending on RuboCop version.
1 parent fdff86c commit ee416ca

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,11 @@ Naming/MethodName:
558558
Naming/MethodParameterName:
559559
Enabled: false
560560

561+
<% if rubocop_version >= "1.76" %>
562+
Naming/PredicatePrefix:
563+
<% else %>
561564
Naming/PredicateName:
565+
<% end %>
562566
Enabled: false
563567
NamePrefix:
564568
- is_

test/fixtures/full_config.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,19 +2332,13 @@ Naming/PredicateMethod:
23322332
Naming/PredicatePrefix:
23332333
Description: Predicate method names should not be prefixed and end with a `?`.
23342334
StyleGuide: "#bool-methods-qmark"
2335-
Enabled: true
2335+
Enabled: false
23362336
VersionAdded: '0.50'
23372337
VersionChanged: '1.75'
23382338
NamePrefix:
23392339
- is_
2340-
- has_
2341-
- have_
2342-
- does_
23432340
ForbiddenPrefixes:
23442341
- is_
2345-
- has_
2346-
- have_
2347-
- does_
23482342
AllowedMethods:
23492343
- is_a?
23502344
MethodDefinitionMacros:
@@ -4658,9 +4652,3 @@ inherit_mode:
46584652
merge:
46594653
- Exclude
46604654
- Include
4661-
Naming/PredicateName:
4662-
Enabled: false
4663-
NamePrefix:
4664-
- is_
4665-
ForbiddenPrefixes:
4666-
- is_

0 commit comments

Comments
 (0)