@@ -6,7 +6,7 @@ inherit_mode:
6
6
7
7
AllCops :
8
8
Exclude :
9
- - ' **/app/assets/**/*'
9
+ - ' {,./ **/} app/assets/**/*'
10
10
- bin/*
11
11
# Exclude db/schema.rb and db/[CONFIGURATION_NAMESPACE]_schema.rb by default.
12
12
# See: https://guides.rubyonrails.org/active_record_multiple_databases.html#setting-up-your-application
@@ -94,8 +94,8 @@ Lint/UselessAccessModifier:
94
94
Lint/UselessMethodDefinition :
95
95
# Avoids conflict with `Rails/LexicallyScopedActionFilter` cop.
96
96
Exclude :
97
- - ' **/app/controllers/**/*.rb'
98
- - ' **/app/mailers/**/*.rb'
97
+ - ' {,./ **/} app/controllers/**/*.rb'
98
+ - ' {,./ **/} app/mailers/**/*.rb'
99
99
100
100
Rails :
101
101
Enabled : true
@@ -115,7 +115,7 @@ Rails/ActionControllerTestCase:
115
115
SafeAutoCorrect : false
116
116
VersionAdded : ' 2.14'
117
117
Include :
118
- - ' **/test/**/*.rb'
118
+ - ' {,./ **/} test/**/*.rb'
119
119
120
120
Rails/ActionFilter :
121
121
Description : ' Enforces consistent use of action filter methods.'
@@ -127,8 +127,8 @@ Rails/ActionFilter:
127
127
- action
128
128
- filter
129
129
Include :
130
- - ' **/app/controllers/**/*.rb'
131
- - ' **/app/mailers/**/*.rb'
130
+ - ' {,./ **/} app/controllers/**/*.rb'
131
+ - ' {,./ **/} app/mailers/**/*.rb'
132
132
133
133
Rails/ActionOrder :
134
134
Description : ' Enforce consistent ordering of controller actions.'
@@ -143,7 +143,7 @@ Rails/ActionOrder:
143
143
- update
144
144
- destroy
145
145
Include :
146
- - ' **/app/controllers/**/*.rb'
146
+ - ' {,./ **/} app/controllers/**/*.rb'
147
147
148
148
Rails/ActiveRecordAliases :
149
149
Description : >-
@@ -160,7 +160,7 @@ Rails/ActiveRecordCallbacksOrder:
160
160
Enabled : ' pending'
161
161
VersionAdded : ' 2.7'
162
162
Include :
163
- - ' **/app/models/**/*.rb'
163
+ - ' {,./ **/} app/models/**/*.rb'
164
164
165
165
Rails/ActiveRecordOverride :
166
166
Description : >-
@@ -171,7 +171,7 @@ Rails/ActiveRecordOverride:
171
171
VersionAdded : ' 0.67'
172
172
VersionChanged : ' 2.18'
173
173
Include :
174
- - ' **/app/models/**/*.rb'
174
+ - ' {,./ **/} app/models/**/*.rb'
175
175
176
176
Rails/ActiveSupportAliases :
177
177
Description : >-
@@ -251,14 +251,14 @@ Rails/AssertNot:
251
251
Enabled : true
252
252
VersionAdded : ' 0.56'
253
253
Include :
254
- - ' **/test/**/*'
254
+ - ' {,./ **/} test/**/*'
255
255
256
256
Rails/AttributeDefaultBlockValue :
257
257
Description : ' Pass method call in block for attribute option `default`.'
258
258
Enabled : pending
259
259
VersionAdded : ' 2.9'
260
260
Include :
261
- - ' **/app/models/**/*'
261
+ - ' {,./ **/} app/models/**/*'
262
262
263
263
Rails/BelongsTo :
264
264
Description : >-
@@ -317,8 +317,8 @@ Rails/ContentTag:
317
317
# https://puma.io/puma/Puma/DSL.html#tag-instance_method
318
318
# No helpers are used in normal models and configs.
319
319
Exclude :
320
- - ' **/app/models/**/*.rb'
321
- - ' **/config/**/*.rb'
320
+ - ' {,./ **/} app/models/**/*.rb'
321
+ - ' {,./ **/} config/**/*.rb'
322
322
323
323
Rails/CreateTableWithTimestamps :
324
324
Description : >-
@@ -379,7 +379,7 @@ Rails/Delegate:
379
379
# violation. When set to false, this case is legal.
380
380
EnforceForPrefixed : true
381
381
Exclude :
382
- - ' **/app/controllers/**/*.rb'
382
+ - ' {,./ **/} app/controllers/**/*.rb'
383
383
384
384
Rails/DelegateAllowBlank :
385
385
Description : ' Do not use allow_blank as an option to delegate.'
@@ -450,23 +450,23 @@ Rails/EnumHash:
450
450
Enabled : true
451
451
VersionAdded : ' 2.3'
452
452
Include :
453
- - ' **/app/models/**/*.rb'
453
+ - ' {,./ **/} app/models/**/*.rb'
454
454
455
455
Rails/EnumSyntax :
456
456
Description : ' Use positional arguments over keyword arguments when defining enums.'
457
457
Enabled : pending
458
458
Severity : warning
459
459
VersionAdded : ' 2.26'
460
460
Include :
461
- - ' **/app/models/**/*.rb'
462
- - ' **/lib/**/*.rb'
461
+ - ' {,./ **/} app/models/**/*.rb'
462
+ - ' {,./ **/} lib/**/*.rb'
463
463
464
464
Rails/EnumUniqueness :
465
465
Description : ' Avoid duplicate integers in hash-syntax `enum` declaration.'
466
466
Enabled : true
467
467
VersionAdded : ' 0.46'
468
468
Include :
469
- - ' **/app/models/**/*.rb'
469
+ - ' {,./ **/} app/models/**/*.rb'
470
470
471
471
Rails/EnvLocal :
472
472
Description : ' Use `Rails.env.local?` instead of `Rails.env.development? || Rails.env.test?`.'
@@ -485,11 +485,11 @@ Rails/EnvironmentVariableAccess:
485
485
VersionAdded : ' 2.10'
486
486
VersionChanged : ' 2.24'
487
487
Include :
488
- - ' **/app/**/*.rb'
489
- - ' **/config/initializers/**/*.rb'
490
- - ' **/lib/**/*.rb'
488
+ - ' {,./ **/} app/**/*.rb'
489
+ - ' {,./ **/} config/initializers/**/*.rb'
490
+ - ' {,./ **/} lib/**/*.rb'
491
491
Exclude :
492
- - ' **/lib/**/*.rake'
492
+ - ' {,./ **/} lib/**/*.rake'
493
493
AllowReads : false
494
494
AllowWrites : false
495
495
@@ -501,11 +501,11 @@ Rails/Exit:
501
501
Enabled : true
502
502
VersionAdded : ' 0.41'
503
503
Include :
504
- - ' **/app/**/*.rb'
505
- - ' **/config/**/*.rb'
506
- - ' **/lib/**/*.rb'
504
+ - ' {,./ **/} app/**/*.rb'
505
+ - ' {,./ **/} config/**/*.rb'
506
+ - ' {,./ **/} lib/**/*.rb'
507
507
Exclude :
508
- - ' **/lib/**/*.rake'
508
+ - ' {,./ **/} lib/**/*.rake'
509
509
510
510
Rails/ExpandedDateRange :
511
511
Description : ' Checks for expanded date range.'
@@ -574,22 +574,22 @@ Rails/HasAndBelongsToMany:
574
574
Enabled : true
575
575
VersionAdded : ' 0.12'
576
576
Include :
577
- - ' **/app/models/**/*.rb'
577
+ - ' {,./ **/} app/models/**/*.rb'
578
578
579
579
Rails/HasManyOrHasOneDependent :
580
580
Description : ' Define the dependent option to the has_many and has_one associations.'
581
581
StyleGuide : ' https://rails.rubystyle.guide#has_many-has_one-dependent-option'
582
582
Enabled : true
583
583
VersionAdded : ' 0.50'
584
584
Include :
585
- - ' **/app/models/**/*.rb'
585
+ - ' {,./ **/} app/models/**/*.rb'
586
586
587
587
Rails/HelperInstanceVariable :
588
588
Description : ' Do not use instance variables in helpers.'
589
589
Enabled : true
590
590
VersionAdded : ' 2.0'
591
591
Include :
592
- - ' **/app/helpers/**/*.rb'
592
+ - ' {,./ **/} app/helpers/**/*.rb'
593
593
594
594
Rails/HttpPositionalArguments :
595
595
Description : ' Use keyword arguments instead of positional arguments in http method calls.'
@@ -620,7 +620,7 @@ Rails/I18nLazyLookup:
620
620
- lazy
621
621
- explicit
622
622
Include :
623
- - ' **/app/controllers/**/*.rb'
623
+ - ' {,./ **/} app/controllers/**/*.rb'
624
624
625
625
Rails/I18nLocaleAssignment :
626
626
Description : ' Prefer the usage of `I18n.with_locale` instead of manually updating `I18n.locale` value.'
@@ -649,8 +649,8 @@ Rails/IgnoredSkipActionFilterOption:
649
649
Enabled : true
650
650
VersionAdded : ' 0.63'
651
651
Include :
652
- - ' **/app/controllers/**/*.rb'
653
- - ' **/app/mailers/**/*.rb'
652
+ - ' {,./ **/} app/controllers/**/*.rb'
653
+ - ' {,./ **/} app/mailers/**/*.rb'
654
654
655
655
Rails/IndexBy :
656
656
Description : ' Prefer `index_by` over `each_with_object`, `to_h`, or `map`.'
@@ -680,7 +680,7 @@ Rails/InverseOf:
680
680
VersionAdded : ' 0.52'
681
681
IgnoreScopes : false
682
682
Include :
683
- - ' **/app/models/**/*.rb'
683
+ - ' {,./ **/} app/models/**/*.rb'
684
684
685
685
Rails/LexicallyScopedActionFilter :
686
686
Description : " Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the class."
@@ -689,8 +689,8 @@ Rails/LexicallyScopedActionFilter:
689
689
Safe : false
690
690
VersionAdded : ' 0.52'
691
691
Include :
692
- - ' **/app/controllers/**/*.rb'
693
- - ' **/app/mailers/**/*.rb'
692
+ - ' {,./ **/} app/controllers/**/*.rb'
693
+ - ' {,./ **/} app/mailers/**/*.rb'
694
694
695
695
Rails/LinkToBlank :
696
696
Description : ' Checks that `link_to` with a `target: "_blank"` have a `rel: "noopener"` option passed to them.'
@@ -708,7 +708,7 @@ Rails/MailerName:
708
708
SafeAutoCorrect : false
709
709
VersionAdded : ' 2.7'
710
710
Include :
711
- - ' **/app/mailers/**/*.rb'
711
+ - ' {,./ **/} app/mailers/**/*.rb'
712
712
713
713
Rails/MatchRoute :
714
714
Description : >-
@@ -718,8 +718,8 @@ Rails/MatchRoute:
718
718
Enabled : ' pending'
719
719
VersionAdded : ' 2.7'
720
720
Include :
721
- - ' **/config/routes.rb'
722
- - ' **/config/routes/**/*.rb'
721
+ - ' {,./ **/} config/routes.rb'
722
+ - ' {,./ **/} config/routes/**/*.rb'
723
723
724
724
Rails/MigrationClassName :
725
725
Description : ' The class name of the migration should match its file name.'
@@ -735,8 +735,8 @@ Rails/MultipleRoutePaths:
735
735
Severity : warning
736
736
VersionAdded : ' 2.29'
737
737
Include :
738
- - ' **/config/routes.rb'
739
- - ' **/config/routes/**/*.rb'
738
+ - ' {,./ **/} config/routes.rb'
739
+ - ' {,./ **/} config/routes/**/*.rb'
740
740
741
741
Rails/NegateInclude :
742
742
Description : ' Prefer `collection.exclude?(obj)` over `!collection.include?(obj)`.'
@@ -779,10 +779,10 @@ Rails/Output:
779
779
VersionAdded : ' 0.15'
780
780
VersionChanged : ' 0.19'
781
781
Include :
782
- - ' **/app/**/*.rb'
783
- - ' **/config/**/*.rb'
782
+ - ' {,./ **/} app/**/*.rb'
783
+ - ' {,./ **/} config/**/*.rb'
784
784
- db/**/*.rb
785
- - ' **/lib/**/*.rb'
785
+ - ' {,./ **/} lib/**/*.rb'
786
786
787
787
Rails/OutputSafety :
788
788
Description : ' The use of `html_safe` or `raw` may be a security risk.'
@@ -851,10 +851,10 @@ Rails/RakeEnvironment:
851
851
VersionAdded : ' 2.4'
852
852
VersionChanged : ' 2.6'
853
853
Include :
854
- - ' **/Rakefile'
855
- - ' **/*.rake'
854
+ - ' {,./ **/} Rakefile'
855
+ - ' {,./ **/} *.rake'
856
856
Exclude :
857
- - ' **/lib/capistrano/tasks/**/*.rake'
857
+ - ' {,./ **/} lib/capistrano/tasks/**/*.rake'
858
858
859
859
Rails/ReadWriteAttribute :
860
860
Description : >-
@@ -865,7 +865,7 @@ Rails/ReadWriteAttribute:
865
865
VersionAdded : ' 0.20'
866
866
VersionChanged : ' 0.29'
867
867
Include :
868
- - ' **/app/models/**/*.rb'
868
+ - ' {,./ **/} app/models/**/*.rb'
869
869
870
870
Rails/RedundantActiveRecordAllMethod :
871
871
Description : Detect redundant `all` used as a receiver for Active Record query methods.
@@ -884,7 +884,7 @@ Rails/RedundantAllowNil:
884
884
Enabled : true
885
885
VersionAdded : ' 0.67'
886
886
Include :
887
- - ' **/app/models/**/*.rb'
887
+ - ' {,./ **/} app/models/**/*.rb'
888
888
889
889
Rails/RedundantForeignKey :
890
890
Description : ' Checks for associations where the `:foreign_key` option is redundant.'
@@ -926,7 +926,7 @@ Rails/RefuteMethods:
926
926
- assert_not
927
927
- refute
928
928
Include :
929
- - ' **/test/**/*'
929
+ - ' {,./ **/} test/**/*'
930
930
931
931
Rails/RelativeDateConstant :
932
932
Description : ' Do not assign relative date to constants.'
@@ -1055,7 +1055,7 @@ Rails/ScopeArgs:
1055
1055
VersionAdded : ' 0.19'
1056
1056
VersionChanged : ' 2.12'
1057
1057
Include :
1058
- - ' **/app/models/**/*.rb'
1058
+ - ' {,./ **/} app/models/**/*.rb'
1059
1059
1060
1060
Rails/SelectMap :
1061
1061
Description : ' Checks for uses of `select(:column_name)` with `map(&:column_name)`.'
@@ -1124,7 +1124,7 @@ Rails/StrongParametersExpect:
1124
1124
Reference : ' https://api.rubyonrails.org/classes/ActionController/Parameters.html#method-i-expect'
1125
1125
Enabled : pending
1126
1126
Include :
1127
- - ' **/app/controllers/**/*.rb'
1127
+ - ' {,./ **/} app/controllers/**/*.rb'
1128
1128
SafeAutoCorrect : false
1129
1129
VersionAdded : ' 2.29'
1130
1130
@@ -1135,7 +1135,7 @@ Rails/TableNameAssignment:
1135
1135
Enabled : false
1136
1136
VersionAdded : ' 2.14'
1137
1137
Include :
1138
- - ' **/app/models/**/*.rb'
1138
+ - ' {,./ **/} app/models/**/*.rb'
1139
1139
1140
1140
Rails/ThreeStateBooleanColumn :
1141
1141
Description : ' Add a default value and a `NOT NULL` constraint to boolean columns.'
@@ -1160,7 +1160,7 @@ Rails/TimeZone:
1160
1160
- strict
1161
1161
- flexible
1162
1162
Exclude :
1163
- - ' **/*.gemspec'
1163
+ - ' {,./ **/} *.gemspec'
1164
1164
1165
1165
Rails/TimeZoneAssignment :
1166
1166
Description : ' Prefer the usage of `Time.use_zone` instead of manually updating `Time.zone` value.'
@@ -1219,7 +1219,7 @@ Rails/UniqueValidationWithoutIndex:
1219
1219
Enabled : true
1220
1220
VersionAdded : ' 2.5'
1221
1221
Include :
1222
- - ' **/app/models/**/*.rb'
1222
+ - ' {,./ **/} app/models/**/*.rb'
1223
1223
1224
1224
Rails/UnknownEnv :
1225
1225
Description : ' Use correct environment name.'
@@ -1238,7 +1238,7 @@ Rails/UnusedIgnoredColumns:
1238
1238
VersionAdded : ' 2.11'
1239
1239
VersionChanged : ' 2.25'
1240
1240
Include :
1241
- - ' **/app/models/**/*.rb'
1241
+ - ' {,./ **/} app/models/**/*.rb'
1242
1242
1243
1243
Rails/UnusedRenderContent :
1244
1244
Description : ' Do not specify body content for a response with a non-content status code.'
@@ -1252,7 +1252,7 @@ Rails/Validation:
1252
1252
VersionAdded : ' 0.9'
1253
1253
VersionChanged : ' 0.41'
1254
1254
Include :
1255
- - ' **/app/models/**/*.rb'
1255
+ - ' {,./ **/} app/models/**/*.rb'
1256
1256
1257
1257
Rails/WhereEquals :
1258
1258
Description : ' Pass conditions to `where` and `where.not` as a hash instead of manually constructing SQL.'
0 commit comments