Skip to content

Commit 5425d8a

Browse files
authored
Merge pull request rubocop#896 from koic/raise_severity_of_some_cops_to_warning
Raise severity of some cops to warning
2 parents 46a1db4 + 246d4f2 commit 5425d8a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#896](https://github.com/rubocop/rubocop-rails/pull/896): Raise severity of `Rails/ActiveRecordOverride`, `Rails/DeprecatedActiveModelErrorsMethods`, `Rails/DuplicateAssociation`, `Rails/DuplicateScope`, `Rails/TopLevelHashWithIndifferentAccess`, and `Rails/WhereNotWithMultipleConditions` cops to warning. ([@koic][])

config/default.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ Rails/ActiveRecordOverride:
135135
Check for overriding Active Record methods instead of using
136136
callbacks.
137137
Enabled: true
138+
Severity: warning
138139
VersionAdded: '0.67'
140+
VersionChanged: '<<next>>'
139141
Include:
140142
- app/models/**/*.rb
141143

@@ -336,9 +338,10 @@ Rails/DelegateAllowBlank:
336338
Rails/DeprecatedActiveModelErrorsMethods:
337339
Description: 'Avoid manipulating ActiveModel errors hash directly.'
338340
Enabled: pending
341+
Severity: warning
339342
Safe: false
340343
VersionAdded: '2.14'
341-
VersionChanged: '2.15'
344+
VersionChanged: '<<next>>'
342345

343346
Rails/DotSeparatedKeys:
344347
Description: 'Enforces the use of dot-separated keys instead of `:scope` options in `I18n` translation methods.'
@@ -349,12 +352,16 @@ Rails/DotSeparatedKeys:
349352
Rails/DuplicateAssociation:
350353
Description: "Don't repeat associations in a model."
351354
Enabled: pending
355+
Severity: warning
352356
VersionAdded: '2.14'
357+
VersionChanged: '<<next>>'
353358

354359
Rails/DuplicateScope:
355360
Description: 'Multiple scopes share this same where clause.'
356361
Enabled: pending
362+
Severity: warning
357363
VersionAdded: '2.14'
364+
VersionChanged: '<<next>>'
358365

359366
Rails/DurationArithmetic:
360367
Description: 'Do not use duration as arithmetic operand with `Time.current`.'
@@ -1047,7 +1054,9 @@ Rails/TopLevelHashWithIndifferentAccess:
10471054
Description: 'Identifies top-level `HashWithIndifferentAccess`.'
10481055
Reference: 'https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#top-level-hashwithindifferentaccess-is-soft-deprecated'
10491056
Enabled: pending
1057+
Severity: warning
10501058
VersionAdded: '2.16'
1059+
VersionChanged: '<<next>>'
10511060

10521061
Rails/TransactionExitStatement:
10531062
Description: 'Avoid the usage of `return`, `break` and `throw` in transaction blocks.'
@@ -1077,7 +1086,9 @@ Rails/UniqueValidationWithoutIndex:
10771086
Rails/UnknownEnv:
10781087
Description: 'Use correct environment name.'
10791088
Enabled: true
1089+
Severity: warning
10801090
VersionAdded: '0.51'
1091+
VersionChanged: '<<next>>'
10811092
Environments:
10821093
- development
10831094
- test
@@ -1132,7 +1143,9 @@ Rails/WhereNot:
11321143
Rails/WhereNotWithMultipleConditions:
11331144
Description: 'Do not use `where.not(...)` with multiple conditions.'
11341145
Enabled: 'pending'
1146+
Severity: warning
11351147
VersionAdded: '2.17'
1148+
VersionChanged: '<<next>>'
11361149

11371150
# Accept `redirect_to(...) and return` and similar cases.
11381151
Style/AndOr:

0 commit comments

Comments
 (0)