aroundhome_cops 8.1.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +1 -0
- data/.rubocop-rails-smoke.yml +12 -0
- data/CHANGELOG.md +9 -0
- data/README.md +15 -2
- data/aroundhome_cops.gemspec +6 -5
- data/default.yml +155 -1
- data/lib/aroundhome_cops.rb +1 -1
- data/rails.yml +648 -0
- metadata +27 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 90ef4f831026e674bae86f33196a592cece157d12f0858d551dc0c7626ac966b
|
|
4
|
+
data.tar.gz: 0b290909ba03bc58fb59985896fa8f31c703d2a1c2b90dcd2d00121061ed8a4f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a712a3873aba9f2e6d696b44099d86e0c5cfb43cb9ad0fa633f96dfda32557a36e902aa236d48657b71b3b2ef2a3a5e453f67039d32519a3d15c4b24111d24d
|
|
7
|
+
data.tar.gz: 90bcaaf95de10536707be856b109101b5e0a673728ace2f2fe94622cc6310959d15660e248eec8e4abb1c9f268e767d72f997ea2897574951431d9d33610630e
|
data/.gitlab-ci.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## Version 9.0.0 (2026-11-10)
|
|
2
|
+
|
|
3
|
+
* Pin RuboCop and plugins to the current releases and enable the pending cops through those versions
|
|
4
|
+
* Set `Metrics/ClassLength` to 175 so one cohesive class can stay in one file
|
|
5
|
+
* Set `Metrics/ModuleLength` to 100 explicitly
|
|
6
|
+
* Pin `Layout/LineLength` to 120
|
|
7
|
+
* Add optional `rails.yml` for Rails API mistakes. `rubocop-rails` is a dependency and is not loaded from `default.yml`
|
|
8
|
+
* Say in `rails.yml` why each Rails cop that stays off is off
|
|
9
|
+
|
|
1
10
|
## Version 8.1.0 (2026-10-27)
|
|
2
11
|
|
|
3
12
|
* Raise `RSpec/MultipleExpectations` `Max` from 1 to 3
|
data/README.md
CHANGED
|
@@ -23,6 +23,19 @@ inherit_gem:
|
|
|
23
23
|
- default.yml
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
Rails apps also inherit `rails.yml`. `rubocop-rails` is already installed
|
|
27
|
+
through this gem. Add the plugin so those cops load:
|
|
28
|
+
|
|
29
|
+
```yml
|
|
30
|
+
plugins:
|
|
31
|
+
- rubocop-rails
|
|
32
|
+
|
|
33
|
+
inherit_gem:
|
|
34
|
+
aroundhome_cops:
|
|
35
|
+
- default.yml
|
|
36
|
+
- rails.yml
|
|
37
|
+
```
|
|
38
|
+
|
|
26
39
|
## Customizing rules
|
|
27
40
|
|
|
28
41
|
The snippet above is everything needed to use this configuration as default.
|
|
@@ -39,6 +52,6 @@ inherit_gem:
|
|
|
39
52
|
inherit_from: .rubocop_todo.yml
|
|
40
53
|
|
|
41
54
|
# This project agreed on a different line length than the rest of the company
|
|
42
|
-
|
|
43
|
-
Max:
|
|
55
|
+
Layout/LineLength:
|
|
56
|
+
Max: 100
|
|
44
57
|
```
|
data/aroundhome_cops.gemspec
CHANGED
|
@@ -20,9 +20,10 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
|
|
21
21
|
spec.required_ruby_version = '>= 2.7.0'
|
|
22
22
|
|
|
23
|
-
spec.add_dependency 'rubocop', '~> 1.
|
|
24
|
-
spec.add_dependency 'rubocop-factory_bot', '~> 2.
|
|
25
|
-
spec.add_dependency 'rubocop-performance', '~> 1.
|
|
26
|
-
spec.add_dependency 'rubocop-
|
|
27
|
-
spec.add_dependency 'rubocop-
|
|
23
|
+
spec.add_dependency 'rubocop', '~> 1.92.2'
|
|
24
|
+
spec.add_dependency 'rubocop-factory_bot', '~> 2.28.0'
|
|
25
|
+
spec.add_dependency 'rubocop-performance', '~> 1.27.0'
|
|
26
|
+
spec.add_dependency 'rubocop-rails', '~> 2.38.0'
|
|
27
|
+
spec.add_dependency 'rubocop-rake', '~> 0.7.1'
|
|
28
|
+
spec.add_dependency 'rubocop-rspec', '~> 3.10.2'
|
|
28
29
|
end
|
data/default.yml
CHANGED
|
@@ -24,7 +24,6 @@ AllCops:
|
|
|
24
24
|
- "db/migrate/2023*.rb"
|
|
25
25
|
SuggestExtensions:
|
|
26
26
|
rubocop-rails: false
|
|
27
|
-
rubocop-factory_bot: false
|
|
28
27
|
|
|
29
28
|
# While we like to write blocks like the following
|
|
30
29
|
# expect { add_special_project }.not_to change { SpecialProject.count }
|
|
@@ -44,7 +43,9 @@ Metrics:
|
|
|
44
43
|
|
|
45
44
|
# See above (Metrics). This cop was previously called Metrics/LineLength
|
|
46
45
|
# and therefore disabled as well for migrations.
|
|
46
|
+
# Pinned at RuboCop's 120 so a later default cannot move the company value.
|
|
47
47
|
Layout/LineLength:
|
|
48
|
+
Max: 120
|
|
48
49
|
Exclude:
|
|
49
50
|
- "db/migrate/*.rb"
|
|
50
51
|
|
|
@@ -76,9 +77,28 @@ Metrics/BlockLength:
|
|
|
76
77
|
Metrics/MethodLength:
|
|
77
78
|
Max: 16
|
|
78
79
|
|
|
80
|
+
# 175 is about nine methods, which a reviewer can hold in one pass.
|
|
81
|
+
# CountAsOne keeps hashes and heredocs from spending that budget.
|
|
82
|
+
Metrics/ClassLength:
|
|
83
|
+
Max: 175
|
|
84
|
+
CountAsOne:
|
|
85
|
+
- array
|
|
86
|
+
- hash
|
|
87
|
+
- heredoc
|
|
88
|
+
|
|
89
|
+
# A mixin is read against a host class that is often outside the diff.
|
|
90
|
+
Metrics/ModuleLength:
|
|
91
|
+
Max: 100
|
|
92
|
+
CountAsOne:
|
|
93
|
+
- array
|
|
94
|
+
- hash
|
|
95
|
+
- heredoc
|
|
96
|
+
|
|
97
|
+
# Names and German words in comments are not ASCII. Forcing ASCII makes people strip them.
|
|
79
98
|
Style/AsciiComments:
|
|
80
99
|
Enabled: false
|
|
81
100
|
|
|
101
|
+
# YARD on every class and module flags application code that is already named clearly.
|
|
82
102
|
Style/Documentation:
|
|
83
103
|
Enabled: false
|
|
84
104
|
|
|
@@ -411,6 +431,126 @@ Style/SendWithLiteralMethodName: # new in 1.64
|
|
|
411
431
|
Enabled: true
|
|
412
432
|
Style/SuperArguments: # new in 1.64
|
|
413
433
|
Enabled: true
|
|
434
|
+
Gemspec/AddRuntimeDependency: # new in 1.65
|
|
435
|
+
Enabled: true
|
|
436
|
+
Gemspec/AttributeAssignment: # new in 1.77
|
|
437
|
+
Enabled: true
|
|
438
|
+
Layout/EmptyLinesAfterModuleInclusion: # new in 1.79
|
|
439
|
+
Enabled: true
|
|
440
|
+
Lint/ArgumentMismatch: # new in 1.90
|
|
441
|
+
Enabled: true
|
|
442
|
+
Lint/ArrayLiteralInRegexp: # new in 1.71
|
|
443
|
+
Enabled: true
|
|
444
|
+
Lint/ConstantReassignment: # new in 1.70
|
|
445
|
+
Enabled: true
|
|
446
|
+
Lint/DataDefineOverride: # new in 1.85
|
|
447
|
+
Enabled: true
|
|
448
|
+
Lint/DeprecatedReference: # new in 1.89
|
|
449
|
+
Enabled: true
|
|
450
|
+
Lint/DuplicateSetElement: # new in 1.67
|
|
451
|
+
Enabled: true
|
|
452
|
+
Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
|
|
453
|
+
Enabled: true
|
|
454
|
+
Lint/MisplacedMagicComment: # new in 1.91
|
|
455
|
+
Enabled: true
|
|
456
|
+
Lint/NameTypo: # new in 1.89
|
|
457
|
+
Enabled: true
|
|
458
|
+
Lint/NumericOperationWithConstantResult: # new in 1.69
|
|
459
|
+
Enabled: true
|
|
460
|
+
Lint/RedundantTypeConversion: # new in 1.72
|
|
461
|
+
Enabled: true
|
|
462
|
+
Lint/SharedMutableDefault: # new in 1.70
|
|
463
|
+
Enabled: true
|
|
464
|
+
Lint/SuperArgumentMismatch: # new in 1.90
|
|
465
|
+
Enabled: true
|
|
466
|
+
Lint/SuppressedExceptionInNumberConversion: # new in 1.72
|
|
467
|
+
Enabled: true
|
|
468
|
+
Lint/UnescapedBracketInRegexp: # new in 1.68
|
|
469
|
+
Enabled: true
|
|
470
|
+
Lint/UnreachablePatternBranch: # new in 1.85
|
|
471
|
+
Enabled: true
|
|
472
|
+
Lint/UselessConstantScoping: # new in 1.72
|
|
473
|
+
Enabled: true
|
|
474
|
+
Lint/UselessDefaultValueArgument: # new in 1.76
|
|
475
|
+
Enabled: true
|
|
476
|
+
Lint/UselessDefined: # new in 1.69
|
|
477
|
+
Enabled: true
|
|
478
|
+
Lint/UselessNumericOperation: # new in 1.66
|
|
479
|
+
Enabled: true
|
|
480
|
+
Lint/UselessOr: # new in 1.76
|
|
481
|
+
Enabled: true
|
|
482
|
+
Naming/PredicateMethod: # new in 1.76
|
|
483
|
+
Enabled: true
|
|
484
|
+
Style/AmbiguousEndlessMethodDefinition: # new in 1.68
|
|
485
|
+
Enabled: true
|
|
486
|
+
Style/ArrayIntersectWithSingleElement: # new in 1.81
|
|
487
|
+
Enabled: true
|
|
488
|
+
Style/BitwisePredicate: # new in 1.68
|
|
489
|
+
Enabled: true
|
|
490
|
+
Style/CollectionQuerying: # new in 1.77
|
|
491
|
+
Enabled: true
|
|
492
|
+
Style/CombinableDefined: # new in 1.68
|
|
493
|
+
Enabled: true
|
|
494
|
+
Style/ComparableBetween: # new in 1.74
|
|
495
|
+
Enabled: true
|
|
496
|
+
Style/DigChain: # new in 1.69
|
|
497
|
+
Enabled: true
|
|
498
|
+
Style/DirectiveScope: # new in 1.90
|
|
499
|
+
Enabled: true
|
|
500
|
+
Style/EmptyClassDefinition: # new in 1.84
|
|
501
|
+
Enabled: true
|
|
502
|
+
Style/EmptyStringInsideInterpolation: # new in 1.76
|
|
503
|
+
Enabled: true
|
|
504
|
+
Style/FileNull: # new in 1.69
|
|
505
|
+
Enabled: true
|
|
506
|
+
Style/FileOpen: # new in 1.85
|
|
507
|
+
Enabled: true
|
|
508
|
+
Style/FileTouch: # new in 1.69
|
|
509
|
+
Enabled: true
|
|
510
|
+
Style/HashFetchChain: # new in 1.75
|
|
511
|
+
Enabled: true
|
|
512
|
+
Style/HashSlice: # new in 1.71
|
|
513
|
+
Enabled: true
|
|
514
|
+
Style/ItAssignment: # new in 1.70
|
|
515
|
+
Enabled: true
|
|
516
|
+
Style/ItBlockParameter: # new in 1.75
|
|
517
|
+
Enabled: true
|
|
518
|
+
Style/KeywordArgumentsMerging: # new in 1.68
|
|
519
|
+
Enabled: true
|
|
520
|
+
Style/MapJoin: # new in 1.85
|
|
521
|
+
Enabled: true
|
|
522
|
+
Style/ModuleMemberExistenceCheck: # new in 1.82
|
|
523
|
+
Enabled: true
|
|
524
|
+
Style/NegativeArrayIndex: # new in 1.84
|
|
525
|
+
Enabled: true
|
|
526
|
+
Style/OneClassPerFile: # new in 1.85
|
|
527
|
+
Enabled: true
|
|
528
|
+
Style/PartitionInsteadOfDoubleSelect: # new in 1.85
|
|
529
|
+
Enabled: true
|
|
530
|
+
Style/PredicateWithKind: # new in 1.85
|
|
531
|
+
Enabled: true
|
|
532
|
+
Style/ReduceToHash: # new in 1.85
|
|
533
|
+
Enabled: true
|
|
534
|
+
Style/RedundantArrayFlatten: # new in 1.76
|
|
535
|
+
Enabled: true
|
|
536
|
+
Style/RedundantFormat: # new in 1.72
|
|
537
|
+
Enabled: true
|
|
538
|
+
Style/RedundantInterpolationUnfreeze: # new in 1.66
|
|
539
|
+
Enabled: true
|
|
540
|
+
Style/RedundantMinMaxBy: # new in 1.85
|
|
541
|
+
Enabled: true
|
|
542
|
+
Style/ReverseFind: # new in 1.84
|
|
543
|
+
Enabled: true
|
|
544
|
+
Style/SafeNavigationChainLength: # new in 1.68
|
|
545
|
+
Enabled: true
|
|
546
|
+
Style/SelectByKind: # new in 1.85
|
|
547
|
+
Enabled: true
|
|
548
|
+
Style/SelectByRange: # new in 1.85
|
|
549
|
+
Enabled: true
|
|
550
|
+
Style/TallyMethod: # new in 1.85
|
|
551
|
+
Enabled: true
|
|
552
|
+
Style/TimeNow: # new in 1.90
|
|
553
|
+
Enabled: true
|
|
414
554
|
|
|
415
555
|
# ----------------- Rubocop-Rspec forced enablements --------------
|
|
416
556
|
RSpec/ExcessiveDocstringSpacing: # (new in 2.5)
|
|
@@ -473,6 +613,16 @@ RSpec/RedundantAround: # new in 2.19
|
|
|
473
613
|
Enabled: true
|
|
474
614
|
RSpec/ExpectInLet: # new in 2.30
|
|
475
615
|
Enabled: true
|
|
616
|
+
RSpec/DiscardedMatcher: # new in 3.10
|
|
617
|
+
Enabled: true
|
|
618
|
+
RSpec/IncludeExamples: # new in 3.6
|
|
619
|
+
Enabled: true
|
|
620
|
+
RSpec/LeakyLocalVariable: # new in 3.8
|
|
621
|
+
Enabled: true
|
|
622
|
+
RSpec/MatchWithSimpleRegex: # new in 3.10
|
|
623
|
+
Enabled: true
|
|
624
|
+
RSpec/Output: # new in 3.9
|
|
625
|
+
Enabled: true
|
|
476
626
|
|
|
477
627
|
# ----------------- Rubocop-Performance forced enablements --------------
|
|
478
628
|
Performance/AncestorsInclude: # new in 1.7
|
|
@@ -511,8 +661,12 @@ Performance/StringIdentifierArgument: # new in 1.13
|
|
|
511
661
|
Enabled: true
|
|
512
662
|
Performance/StringInclude: # new in 1.7
|
|
513
663
|
Enabled: true
|
|
664
|
+
Performance/StringBytesize: # new in 1.23
|
|
665
|
+
Enabled: true
|
|
514
666
|
Performance/Sum: # new in 1.8
|
|
515
667
|
Enabled: true
|
|
668
|
+
Performance/ZipWithoutBlock: # new in 1.24
|
|
669
|
+
Enabled: true
|
|
516
670
|
|
|
517
671
|
# ----------------- FactoryBot forced enablements --------------
|
|
518
672
|
FactoryBot/SyntaxMethods: # new in 2.7
|
data/lib/aroundhome_cops.rb
CHANGED
data/rails.yml
ADDED
|
@@ -0,0 +1,648 @@
|
|
|
1
|
+
# The Rails department stays off. The cops further down catch a wrong API.
|
|
2
|
+
# Every other cop is listed with the reason it stays off. A Rails cop added
|
|
3
|
+
# upstream later stays off until this file explains it.
|
|
4
|
+
Rails:
|
|
5
|
+
Enabled: false
|
|
6
|
+
|
|
7
|
+
Rails/SaveBang:
|
|
8
|
+
Enabled: true
|
|
9
|
+
Rails/SkipsModelValidations:
|
|
10
|
+
Enabled: true
|
|
11
|
+
Rails/TransactionExitStatement:
|
|
12
|
+
Enabled: true
|
|
13
|
+
Rails/FindBy:
|
|
14
|
+
Enabled: true
|
|
15
|
+
Rails/FindEach:
|
|
16
|
+
Enabled: true
|
|
17
|
+
Rails/WhereExists:
|
|
18
|
+
Enabled: true
|
|
19
|
+
Rails/InverseOf:
|
|
20
|
+
Enabled: true
|
|
21
|
+
Rails/HasManyOrHasOneDependent:
|
|
22
|
+
Enabled: true
|
|
23
|
+
Rails/UniqueValidationWithoutIndex:
|
|
24
|
+
Enabled: true
|
|
25
|
+
Rails/TimeZone:
|
|
26
|
+
Enabled: true
|
|
27
|
+
Rails/Date:
|
|
28
|
+
Enabled: true
|
|
29
|
+
Rails/OutputSafety:
|
|
30
|
+
Enabled: true
|
|
31
|
+
Rails/ReversibleMigration:
|
|
32
|
+
Enabled: true
|
|
33
|
+
Rails/BulkChangeTable:
|
|
34
|
+
Enabled: true
|
|
35
|
+
Rails/NotNullColumn:
|
|
36
|
+
Enabled: true
|
|
37
|
+
Rails/AddColumnIndex:
|
|
38
|
+
Enabled: true
|
|
39
|
+
|
|
40
|
+
# `flash` before `render` is correct when the next request must show it.
|
|
41
|
+
# Agents switch it to `flash.now` and the message is gone after this response.
|
|
42
|
+
Rails/ActionControllerFlashBeforeRender:
|
|
43
|
+
Enabled: false
|
|
44
|
+
|
|
45
|
+
# A functional controller test can be the test that belongs on the action.
|
|
46
|
+
# Agents rewrite it as an integration test and break assertions that passed.
|
|
47
|
+
Rails/ActionControllerTestCase:
|
|
48
|
+
Enabled: false
|
|
49
|
+
|
|
50
|
+
# `before_filter` and `before_action` are the same callback.
|
|
51
|
+
# Agents rename a working filter and drop `only` or `except` while editing it.
|
|
52
|
+
Rails/ActionFilter:
|
|
53
|
+
Enabled: false
|
|
54
|
+
|
|
55
|
+
# The order of actions in the file does not change which action runs.
|
|
56
|
+
# Agents reshuffle the controller and the diff hides the real edit.
|
|
57
|
+
Rails/ActionOrder:
|
|
58
|
+
Enabled: false
|
|
59
|
+
|
|
60
|
+
# `update_attributes` and `update` are the same write.
|
|
61
|
+
# Agents spend the change on the alias and leave a failed save unchecked.
|
|
62
|
+
Rails/ActiveRecordAliases:
|
|
63
|
+
Enabled: false
|
|
64
|
+
|
|
65
|
+
# Same-type callbacks run in source order. Autocorrect swaps declarations.
|
|
66
|
+
# Two `before_save` hooks can change which one runs first.
|
|
67
|
+
Rails/ActiveRecordCallbacksOrder:
|
|
68
|
+
Enabled: false
|
|
69
|
+
|
|
70
|
+
# Overriding `save` is sometimes the method that has to wrap `super`.
|
|
71
|
+
# Agents move that body into a callback and the `super` path is gone.
|
|
72
|
+
Rails/ActiveRecordOverride:
|
|
73
|
+
Enabled: false
|
|
74
|
+
|
|
75
|
+
# `starts_with?` and `start_with?` do the same check.
|
|
76
|
+
# Agents rename a call that already says what it checks.
|
|
77
|
+
Rails/ActiveSupportAliases:
|
|
78
|
+
Enabled: false
|
|
79
|
+
|
|
80
|
+
# An initializer that reopens a loaded Rails class is already on time.
|
|
81
|
+
# Agents wrap it in `on_load` and the patch waits for a hook that already fired.
|
|
82
|
+
Rails/ActiveSupportOnLoad:
|
|
83
|
+
Enabled: false
|
|
84
|
+
|
|
85
|
+
# A second `after_*_commit :log_action` replaces the first. Collapsing both into
|
|
86
|
+
# `after_save_commit` also runs on saves that are neither create nor update.
|
|
87
|
+
Rails/AfterCommitOverride:
|
|
88
|
+
Enabled: false
|
|
89
|
+
|
|
90
|
+
# A controller can subclass an API or engine base, not `ApplicationController`.
|
|
91
|
+
# Agents retarget the superclass and it inherits the wrong filters.
|
|
92
|
+
Rails/ApplicationController:
|
|
93
|
+
Enabled: false
|
|
94
|
+
|
|
95
|
+
# A job can subclass a shared base that is not `ApplicationJob`.
|
|
96
|
+
# Agents retarget it and drop the queue and retry config on that base.
|
|
97
|
+
Rails/ApplicationJob:
|
|
98
|
+
Enabled: false
|
|
99
|
+
|
|
100
|
+
# A mailer can subclass a shared base that is not `ApplicationMailer`.
|
|
101
|
+
# Agents retarget it and drop the defaults that base set.
|
|
102
|
+
Rails/ApplicationMailer:
|
|
103
|
+
Enabled: false
|
|
104
|
+
|
|
105
|
+
# A model can subclass a shared base that is not `ApplicationRecord`.
|
|
106
|
+
# Agents retarget it and the model uses the wrong table and connection.
|
|
107
|
+
Rails/ApplicationRecord:
|
|
108
|
+
Enabled: false
|
|
109
|
+
|
|
110
|
+
# `select('*')` says which columns are expanded.
|
|
111
|
+
# Agents switch it to `Arel.star` and the selected columns are harder to see.
|
|
112
|
+
Rails/ArelStar:
|
|
113
|
+
Enabled: false
|
|
114
|
+
|
|
115
|
+
# `assert !condition` already states the failure.
|
|
116
|
+
# Agents rewrite it to `assert_not` and the failure message changes under them.
|
|
117
|
+
Rails/AssertNot:
|
|
118
|
+
Enabled: false
|
|
119
|
+
|
|
120
|
+
# `default: Time.current` is evaluated once, and so is a method call that is meant to be shared.
|
|
121
|
+
# Agents wrap both in a block, and a shared default becomes a new object per record.
|
|
122
|
+
Rails/AttributeDefaultBlockValue:
|
|
123
|
+
Enabled: false
|
|
124
|
+
|
|
125
|
+
# `required: false` and `optional: true` both make `belongs_to` optional.
|
|
126
|
+
# Agents rewrite one into the other and churn a line that already says so.
|
|
127
|
+
Rails/BelongsTo:
|
|
128
|
+
Enabled: false
|
|
129
|
+
|
|
130
|
+
# `nil? || empty?` is a precise check. `blank?` also treats `false` and whitespace as empty.
|
|
131
|
+
# Agents swap in `blank?` and a real `false` takes the empty branch.
|
|
132
|
+
Rails/Blank:
|
|
133
|
+
Enabled: false
|
|
134
|
+
|
|
135
|
+
# `reject(&:blank?)` shows the test. `compact_blank` hides it.
|
|
136
|
+
# Agents switch to it and whitespace-only strings disappear with the nils.
|
|
137
|
+
Rails/CompactBlank:
|
|
138
|
+
Enabled: false
|
|
139
|
+
|
|
140
|
+
# `tag(:div)` and `tag.div` render the same tag.
|
|
141
|
+
# Agents rewrite the helper and drop options that were on the old call.
|
|
142
|
+
Rails/ContentTag:
|
|
143
|
+
Enabled: false
|
|
144
|
+
|
|
145
|
+
# A join table or an import table is valid without `timestamps`.
|
|
146
|
+
# Agents add `t.timestamps` and the schema grows columns nothing writes.
|
|
147
|
+
Rails/CreateTableWithTimestamps:
|
|
148
|
+
Enabled: false
|
|
149
|
+
|
|
150
|
+
# A column named `type` is wrong for STI and fine as a plain string.
|
|
151
|
+
# Agents rename a shipped column and the app still reads the old name.
|
|
152
|
+
Rails/DangerousColumnNames:
|
|
153
|
+
Enabled: false
|
|
154
|
+
|
|
155
|
+
# A default scope is how some models hide archived or tenant-foreign rows.
|
|
156
|
+
# Agents remove it and those rows leak into every query.
|
|
157
|
+
Rails/DefaultScope:
|
|
158
|
+
Enabled: false
|
|
159
|
+
|
|
160
|
+
# Rewrites a correct one-line method into `delegate`, hiding the call behind
|
|
161
|
+
# prefix, allow_nil, and private.
|
|
162
|
+
Rails/Delegate:
|
|
163
|
+
Enabled: false
|
|
164
|
+
|
|
165
|
+
# `allow_blank` on `delegate` is the wrong option (`allow_nil` is the real one).
|
|
166
|
+
# This only matters once `delegate` is in the file, and that macro stays off.
|
|
167
|
+
Rails/DelegateAllowBlank:
|
|
168
|
+
Enabled: false
|
|
169
|
+
|
|
170
|
+
# It flags obsolete error writers and reads of `errors[:attr]` that still work.
|
|
171
|
+
# Agents rewrite a read into `errors.add` and the action starts storing an error.
|
|
172
|
+
Rails/DeprecatedActiveModelErrorsMethods:
|
|
173
|
+
Enabled: false
|
|
174
|
+
|
|
175
|
+
# `I18n.t(:foo, scope: [:bar])` shows the scope as data.
|
|
176
|
+
# Agents fold it into `'bar.foo'` and a scope built from a variable becomes a literal.
|
|
177
|
+
Rails/DotSeparatedKeys:
|
|
178
|
+
Enabled: false
|
|
179
|
+
|
|
180
|
+
# Two associations with one name can be a concern override the cop cannot see.
|
|
181
|
+
# Agents delete one and the model loses the options that were meant to win.
|
|
182
|
+
Rails/DuplicateAssociation:
|
|
183
|
+
Enabled: false
|
|
184
|
+
|
|
185
|
+
# Two scopes can share a `where` and still be different names to callers.
|
|
186
|
+
# Agents merge them and every caller of the removed name breaks.
|
|
187
|
+
Rails/DuplicateScope:
|
|
188
|
+
Enabled: false
|
|
189
|
+
|
|
190
|
+
# `Time.current + 1.day` shows the clock and the duration.
|
|
191
|
+
# Agents replace it with `1.day.from_now` and the clock is hidden in the helper.
|
|
192
|
+
Rails/DurationArithmetic:
|
|
193
|
+
Enabled: false
|
|
194
|
+
|
|
195
|
+
# `find_by_email_and_status!` names both columns and still raises.
|
|
196
|
+
# Agents rewrite it by hand and one column, or the bang, disappears.
|
|
197
|
+
Rails/DynamicFindBy:
|
|
198
|
+
Enabled: false
|
|
199
|
+
|
|
200
|
+
# `logger.debug "id=#{id}"` is the message.
|
|
201
|
+
# Agents hide it in a block and a message with a side effect is skipped when debug is off.
|
|
202
|
+
Rails/EagerEvaluationLogMessage:
|
|
203
|
+
Enabled: false
|
|
204
|
+
|
|
205
|
+
# `enum status: [:open, :closed]` is a list of names in order.
|
|
206
|
+
# Agents convert it to a hash and invent integers that no longer match stored rows.
|
|
207
|
+
Rails/EnumHash:
|
|
208
|
+
Enabled: false
|
|
209
|
+
|
|
210
|
+
# Keyword `enum status: { open: 0 }` is the form older Rails accepts.
|
|
211
|
+
# Agents rewrite it to positional `enum :status` and that Rails raises at boot.
|
|
212
|
+
Rails/EnumSyntax:
|
|
213
|
+
Enabled: false
|
|
214
|
+
|
|
215
|
+
# Two enum names can share an integer while one is renamed.
|
|
216
|
+
# Agents renumber one and stored rows no longer match either name.
|
|
217
|
+
Rails/EnumUniqueness:
|
|
218
|
+
Enabled: false
|
|
219
|
+
|
|
220
|
+
# `Rails.env.production?` is how boot and rake pick config.
|
|
221
|
+
# Agents replace it with a feature flag the process does not have at boot.
|
|
222
|
+
Rails/Env:
|
|
223
|
+
Enabled: false
|
|
224
|
+
|
|
225
|
+
# `Rails.env.local?` exists only on newer Rails.
|
|
226
|
+
# Agents use it on an app whose Rails does not define it, and boot raises.
|
|
227
|
+
Rails/EnvLocal:
|
|
228
|
+
Enabled: false
|
|
229
|
+
|
|
230
|
+
# `Rails.env == 'staging'` shows the string, including a custom env name.
|
|
231
|
+
# Agents rewrite it to `production?` and a custom env stops matching.
|
|
232
|
+
Rails/EnvironmentComparison:
|
|
233
|
+
Enabled: false
|
|
234
|
+
|
|
235
|
+
# `ENV.fetch` in an initializer is the configuration.
|
|
236
|
+
# Agents wrap every read in a new object the rest of the app does not call.
|
|
237
|
+
Rails/EnvironmentVariableAccess:
|
|
238
|
+
Enabled: false
|
|
239
|
+
|
|
240
|
+
# `exit` in a script is how that process stops.
|
|
241
|
+
# Agents replace it with `return` or `fail` and the CLI keeps running after the error.
|
|
242
|
+
Rails/Exit:
|
|
243
|
+
Enabled: false
|
|
244
|
+
|
|
245
|
+
# `beginning_of_day..end_of_day` shows the window.
|
|
246
|
+
# Agents collapse it to `all_day` and the boundary is hidden in the helper.
|
|
247
|
+
Rails/ExpandedDateRange:
|
|
248
|
+
Enabled: false
|
|
249
|
+
|
|
250
|
+
# `File.join(Rails.root, 'a', 'b')` shows the root and the parts.
|
|
251
|
+
# Agents rewrite the join and a part that was absolute is forced under root.
|
|
252
|
+
Rails/FilePath:
|
|
253
|
+
Enabled: false
|
|
254
|
+
|
|
255
|
+
# `find_by(id: x)` returns nil when the row is gone. `find` raises.
|
|
256
|
+
# Agents switch to `find` and a missing row becomes an exception the action did not rescue.
|
|
257
|
+
Rails/FindById:
|
|
258
|
+
Enabled: false
|
|
259
|
+
|
|
260
|
+
# `@user ||= find_by(...)` retries when the row is missing, which a request-local lookup wants.
|
|
261
|
+
# Agents cache the miss and a later call in the same process never tries again.
|
|
262
|
+
Rails/FindByOrAssignmentMemoization:
|
|
263
|
+
Enabled: false
|
|
264
|
+
|
|
265
|
+
# `travel_to Time.current` shows the instant the example froze.
|
|
266
|
+
# Agents replace it with `freeze_time` and the example no longer says which clock it used.
|
|
267
|
+
Rails/FreezeTime:
|
|
268
|
+
Enabled: false
|
|
269
|
+
|
|
270
|
+
# `has_and_belongs_to_many` fits a join table with no behavior of its own.
|
|
271
|
+
# Agents replace it with `has_many :through` and invent a join model the schema does not have.
|
|
272
|
+
Rails/HasAndBelongsToMany:
|
|
273
|
+
Enabled: false
|
|
274
|
+
|
|
275
|
+
# A helper that reads an assign is using the variable the template already set.
|
|
276
|
+
# Agents turn it into an argument and every call site outside the diff breaks.
|
|
277
|
+
Rails/HelperInstanceVariable:
|
|
278
|
+
Enabled: false
|
|
279
|
+
|
|
280
|
+
# The older positional `get :index, id: 1` and the keyword form hit the same action.
|
|
281
|
+
# Agents rewrite the call and params land in the session slot.
|
|
282
|
+
Rails/HttpPositionalArguments:
|
|
283
|
+
Enabled: false
|
|
284
|
+
|
|
285
|
+
# `:found` and `302` are the same status. A spec may assert the number.
|
|
286
|
+
# Agents flip the style and the spec stops matching the response.
|
|
287
|
+
Rails/HttpStatus:
|
|
288
|
+
Enabled: false
|
|
289
|
+
|
|
290
|
+
# Old and new status names can both be the symbol the controller and the spec share.
|
|
291
|
+
# Agents rename one side and the other side still uses the old symbol.
|
|
292
|
+
Rails/HttpStatusNameConsistency:
|
|
293
|
+
Enabled: false
|
|
294
|
+
|
|
295
|
+
# `t('users.show.title')` is a key a reviewer can grep.
|
|
296
|
+
# Agents shorten it to `t('.title')` and the key breaks when the template moves.
|
|
297
|
+
Rails/I18nLazyLookup:
|
|
298
|
+
Enabled: false
|
|
299
|
+
|
|
300
|
+
# `I18n.locale =` in a job is the locale for the rest of that job.
|
|
301
|
+
# Agents wrap it in `with_locale` and code after the block runs in the old locale.
|
|
302
|
+
Rails/I18nLocaleAssignment:
|
|
303
|
+
Enabled: false
|
|
304
|
+
|
|
305
|
+
# Log lines, exceptions, and third-party payloads are not translations.
|
|
306
|
+
# Agents wrap them in `I18n.t` and a missing key becomes the error the user sees.
|
|
307
|
+
Rails/I18nLocaleTexts:
|
|
308
|
+
Enabled: false
|
|
309
|
+
|
|
310
|
+
# A subclass that sets `ignored_columns = %w[legacy]` means that list alone.
|
|
311
|
+
# Agents change `=` to `+=` and the subclass still ignores columns it meant to read.
|
|
312
|
+
Rails/IgnoredColumnsAssignment:
|
|
313
|
+
Enabled: false
|
|
314
|
+
|
|
315
|
+
# `skip_before_action :auth, only: :index, if: :admin?` can be the real combination.
|
|
316
|
+
# Agents delete `if` or `only` and the filter runs for the wrong actions.
|
|
317
|
+
Rails/IgnoredSkipActionFilterOption:
|
|
318
|
+
Enabled: false
|
|
319
|
+
|
|
320
|
+
# `each_with_object` shows what the hash stores.
|
|
321
|
+
# Agents switch it to `index_by` and a computed value collapses to the element itself.
|
|
322
|
+
Rails/IndexBy:
|
|
323
|
+
Enabled: false
|
|
324
|
+
|
|
325
|
+
# `map { |k| [transform(k), value] }.to_h` shows the key and the value.
|
|
326
|
+
# Agents switch it to `index_with` and the transformed key is left raw.
|
|
327
|
+
Rails/IndexWith:
|
|
328
|
+
Enabled: false
|
|
329
|
+
|
|
330
|
+
# `status.inquiry.paid?` is the predicate the caller uses.
|
|
331
|
+
# Agents expand it to `==` and the other predicates on that string get out of sync.
|
|
332
|
+
Rails/Inquiry:
|
|
333
|
+
Enabled: false
|
|
334
|
+
|
|
335
|
+
# `only: :index` can name an action defined on the parent controller.
|
|
336
|
+
# Agents drop the filter because the action is not in this file, and the parent loses its guard.
|
|
337
|
+
Rails/LexicallyScopedActionFilter:
|
|
338
|
+
Enabled: false
|
|
339
|
+
|
|
340
|
+
# `target: "_blank"` should carry `noopener`, and the link may already set `rel`.
|
|
341
|
+
# Agents overwrite that `rel` and `nofollow` or `ugc` disappears.
|
|
342
|
+
Rails/LinkToBlank:
|
|
343
|
+
Enabled: false
|
|
344
|
+
|
|
345
|
+
# A mailer does not have to end in `Mailer` when the app already named it.
|
|
346
|
+
# Agents rename the class and the preview and `deliver_later` callers keep the old name.
|
|
347
|
+
Rails/MailerName:
|
|
348
|
+
Enabled: false
|
|
349
|
+
|
|
350
|
+
# `match` with `via:` is how one path serves more than one verb.
|
|
351
|
+
# Agents split it into `get` and `post` and a verb the client still sends 404s.
|
|
352
|
+
Rails/MatchRoute:
|
|
353
|
+
Enabled: false
|
|
354
|
+
|
|
355
|
+
# A migration class that already ran is recorded under its current name.
|
|
356
|
+
# Agents rename the class to match the file and a new database looks up the old name.
|
|
357
|
+
Rails/MigrationClassName:
|
|
358
|
+
Enabled: false
|
|
359
|
+
|
|
360
|
+
# A route with two paths is how an old URL stays alive.
|
|
361
|
+
# Agents delete the extra path and that URL 404s.
|
|
362
|
+
Rails/MultipleRoutePaths:
|
|
363
|
+
Enabled: false
|
|
364
|
+
|
|
365
|
+
# `!records.include?(x)` on a relation is a query. `exclude?` is an in-memory check.
|
|
366
|
+
# Agents swap them and the call loads the whole table.
|
|
367
|
+
Rails/NegateInclude:
|
|
368
|
+
Enabled: false
|
|
369
|
+
|
|
370
|
+
# `order('created_at DESC NULLS LAST')` is the SQL the database runs.
|
|
371
|
+
# Agents rewrite it to a symbol and the `NULLS LAST` clause is gone.
|
|
372
|
+
Rails/OrderArguments:
|
|
373
|
+
Enabled: false
|
|
374
|
+
|
|
375
|
+
# `order(:id)` is a stable order for pagination.
|
|
376
|
+
# Agents change it to `created_at` and rows with the same timestamp trade places between pages.
|
|
377
|
+
Rails/OrderById:
|
|
378
|
+
Enabled: false
|
|
379
|
+
|
|
380
|
+
# `puts` in a rake task or a script is the output for the person running it.
|
|
381
|
+
# Agents delete the call and the task finishes with no output.
|
|
382
|
+
Rails/Output:
|
|
383
|
+
Enabled: false
|
|
384
|
+
|
|
385
|
+
# `pluck(:email).first` shows the column and that one row is used.
|
|
386
|
+
# Agents fold it into `pick` and an `order` that chose that row is easier to drop.
|
|
387
|
+
Rails/Pick:
|
|
388
|
+
Enabled: false
|
|
389
|
+
|
|
390
|
+
# `map(&:email)` on an already loaded array is Ruby. `pluck` always queries.
|
|
391
|
+
# Agents change `map` to `pluck` and a loaded list hits the database again.
|
|
392
|
+
Rails/Pluck:
|
|
393
|
+
Enabled: false
|
|
394
|
+
|
|
395
|
+
# `pluck(:id)` names the column. `ids` means the model's primary key.
|
|
396
|
+
# Agents switch a joined `pluck(:id)` to `ids` and the id comes from the wrong table.
|
|
397
|
+
Rails/PluckId:
|
|
398
|
+
Enabled: false
|
|
399
|
+
|
|
400
|
+
# `where(id: other.pluck(:id))` is an explicit list the code can reuse.
|
|
401
|
+
# Agents change `pluck` to `select` and that list becomes a subquery nobody else can read.
|
|
402
|
+
Rails/PluckInWhere:
|
|
403
|
+
Enabled: false
|
|
404
|
+
|
|
405
|
+
# `3.day` and `3.days` are the same duration in Rails.
|
|
406
|
+
# Agents change the spelling of a duration a helper built, and the helper's method no longer matches.
|
|
407
|
+
Rails/PluralizationGrammar:
|
|
408
|
+
Enabled: false
|
|
409
|
+
|
|
410
|
+
# `value.present? ? value : nil` shows both branches. `false` is blank.
|
|
411
|
+
# Agents fold it into `presence` and a real `false` becomes nil.
|
|
412
|
+
Rails/Presence:
|
|
413
|
+
Enabled: false
|
|
414
|
+
|
|
415
|
+
# `!obj.blank?` matches the `blank?` check next to it.
|
|
416
|
+
# Agents rewrite one side to `present?` and the pair no longer reads as one condition.
|
|
417
|
+
Rails/Present:
|
|
418
|
+
Enabled: false
|
|
419
|
+
|
|
420
|
+
# A rake task that must not boot the app has no `:environment` dependency.
|
|
421
|
+
# Agents add it and the task connects to the database it was written to avoid.
|
|
422
|
+
Rails/RakeEnvironment:
|
|
423
|
+
Enabled: false
|
|
424
|
+
|
|
425
|
+
# `read_attribute(:name)` reads the column when `name` itself is overridden.
|
|
426
|
+
# Agents replace it with `name` and the override calls itself.
|
|
427
|
+
Rails/ReadWriteAttribute:
|
|
428
|
+
Enabled: false
|
|
429
|
+
|
|
430
|
+
# `redirect_back fallback_location:` shows the fallback as a keyword.
|
|
431
|
+
# Agents switch to `redirect_back_or_to` and a Rails without that method raises.
|
|
432
|
+
Rails/RedirectBackOrTo:
|
|
433
|
+
Enabled: false
|
|
434
|
+
|
|
435
|
+
# `all` before `where` is noise on a model and a reset after a scope.
|
|
436
|
+
# Agents delete both and a default scope comes back into a query that had cleared it.
|
|
437
|
+
Rails/RedundantActiveRecordAllMethod:
|
|
438
|
+
Enabled: false
|
|
439
|
+
|
|
440
|
+
# `allow_nil: true` next to `allow_blank: true` is redundant for Rails validators.
|
|
441
|
+
# Agents delete `allow_nil` and a custom validator that still reads that option changes.
|
|
442
|
+
Rails/RedundantAllowNil:
|
|
443
|
+
Enabled: false
|
|
444
|
+
|
|
445
|
+
# `foreign_key: :user_id` on `belongs_to :user` documents the column.
|
|
446
|
+
# Agents delete it and a namespaced model infers a different column.
|
|
447
|
+
Rails/RedundantForeignKey:
|
|
448
|
+
Enabled: false
|
|
449
|
+
|
|
450
|
+
# `validates :user, presence: true` is how the association error message is set.
|
|
451
|
+
# Agents delete it and the error the form renders changes.
|
|
452
|
+
Rails/RedundantPresenceValidationOnBelongsTo:
|
|
453
|
+
Enabled: false
|
|
454
|
+
|
|
455
|
+
# An explicit receiver on `with_options` shows which object each call uses.
|
|
456
|
+
# Agents strip it and a block that called a different object loses that object.
|
|
457
|
+
Rails/RedundantReceiverInWithOptions:
|
|
458
|
+
Enabled: false
|
|
459
|
+
|
|
460
|
+
# An explicit `travel_back` shows where the example stops faking time.
|
|
461
|
+
# Agents delete it and a later example still runs inside `travel_to`.
|
|
462
|
+
Rails/RedundantTravelBack:
|
|
463
|
+
Enabled: false
|
|
464
|
+
|
|
465
|
+
# `class_name: User` fails at boot when the constant is wrong. A string fails on the first request.
|
|
466
|
+
# Agents change the constant to a string and the typo moves from boot to production traffic.
|
|
467
|
+
Rails/ReflectionClassName:
|
|
468
|
+
Enabled: false
|
|
469
|
+
|
|
470
|
+
# `refute_equal` and `assert_not` are the same failure.
|
|
471
|
+
# Agents rename a custom `refute_*` the suite defined into an `assert_not_*` that does not exist.
|
|
472
|
+
Rails/RefuteMethods:
|
|
473
|
+
Enabled: false
|
|
474
|
+
|
|
475
|
+
# A constant such as `EXPIRED_AT = 1.week.since` is frozen at boot, which is bad.
|
|
476
|
+
# Autocorrect replaces the constant with a method and does not update callers.
|
|
477
|
+
Rails/RelativeDateConstant:
|
|
478
|
+
Enabled: false
|
|
479
|
+
|
|
480
|
+
# `render inline:` returns a string the action just built.
|
|
481
|
+
# Agents move it into a template and the locals from the action are not assigned.
|
|
482
|
+
Rails/RenderInline:
|
|
483
|
+
Enabled: false
|
|
484
|
+
|
|
485
|
+
# `render text:` is the body on older Rails and an option name on newer Rails.
|
|
486
|
+
# Agents rename it to `plain:` and a call that was not the body loses that option.
|
|
487
|
+
Rails/RenderPlainText:
|
|
488
|
+
Enabled: false
|
|
489
|
+
|
|
490
|
+
# `request.referer` and `request.referrer` are two spellings of one header.
|
|
491
|
+
# Agents rename one and a stub that implements only the old spelling returns nil.
|
|
492
|
+
Rails/RequestReferer:
|
|
493
|
+
Enabled: false
|
|
494
|
+
|
|
495
|
+
# `require_dependency` is how classic autoloading loads a file.
|
|
496
|
+
# Agents delete it on an app that is not on Zeitwerk and the constant is missing.
|
|
497
|
+
Rails/RequireDependency:
|
|
498
|
+
Enabled: false
|
|
499
|
+
|
|
500
|
+
# `JSON.parse(response.body)` shows the parser.
|
|
501
|
+
# Agents switch to `response.parsed_body` and an empty or non-JSON body parses as the wrong type.
|
|
502
|
+
Rails/ResponseParsedBody:
|
|
503
|
+
Enabled: false
|
|
504
|
+
|
|
505
|
+
# A data migration can be `up` only, because there is nothing to undo.
|
|
506
|
+
# Agents add an empty `down` and a rollback looks safe when it is not.
|
|
507
|
+
Rails/ReversibleMigrationMethodDefinition:
|
|
508
|
+
Enabled: false
|
|
509
|
+
|
|
510
|
+
# `Rails.root.join('a').join(name)` shows each segment, including a variable.
|
|
511
|
+
# Agents merge the joins and that variable is concatenated into the wrong part.
|
|
512
|
+
Rails/RootJoinChain:
|
|
513
|
+
Enabled: false
|
|
514
|
+
|
|
515
|
+
# `File.read(Rails.root.join(path))` shows that `File` does the IO.
|
|
516
|
+
# Agents rewrite it onto the pathname and a path outside root is read as if it were under root.
|
|
517
|
+
Rails/RootPathnameMethods:
|
|
518
|
+
Enabled: false
|
|
519
|
+
|
|
520
|
+
# `Rails.root.join('public', file)` keeps today's join behavior when `file` is absolute.
|
|
521
|
+
# Agents switch the prefix to `Rails.public_path` and that absolute path is joined differently.
|
|
522
|
+
Rails/RootPublicPath:
|
|
523
|
+
Enabled: false
|
|
524
|
+
|
|
525
|
+
# `try!` is a public send and raises when the method is missing.
|
|
526
|
+
# Agents replace it with `&.`, which can call a private method `try!` refused.
|
|
527
|
+
Rails/SafeNavigation:
|
|
528
|
+
Enabled: false
|
|
529
|
+
|
|
530
|
+
# `foo&.blank?` is false when `foo` is nil. `foo.blank?` is true when `foo` is nil.
|
|
531
|
+
# Agents apply the cop and the nil branch flips.
|
|
532
|
+
Rails/SafeNavigationWithBlank:
|
|
533
|
+
Enabled: false
|
|
534
|
+
|
|
535
|
+
# A comment on every new column is a documentation policy, not a wrong API.
|
|
536
|
+
# Agents invent a comment to pass the cop and it drifts from the column.
|
|
537
|
+
Rails/SchemaComment:
|
|
538
|
+
Enabled: false
|
|
539
|
+
|
|
540
|
+
# Autocorrect wraps `scope :active, where(active: true)` in a lambda.
|
|
541
|
+
# Agents also wrap a helper that already returns a scope, and the scope stops filtering.
|
|
542
|
+
Rails/ScopeArgs:
|
|
543
|
+
Enabled: false
|
|
544
|
+
|
|
545
|
+
# `select(:email).map(&:email)` shows both steps.
|
|
546
|
+
# Agents fold it into `pluck` and an already loaded array hits the database.
|
|
547
|
+
Rails/SelectMap:
|
|
548
|
+
Enabled: false
|
|
549
|
+
|
|
550
|
+
# `I18n.translate` says which method runs. `t` is also a local and a helper name.
|
|
551
|
+
# Agents shorten the call and that local takes it.
|
|
552
|
+
Rails/ShortI18n:
|
|
553
|
+
Enabled: false
|
|
554
|
+
|
|
555
|
+
# A SQL heredoc keeps the newlines the query was written with.
|
|
556
|
+
# `.squish` lets a `--` comment or a string swallow the next line. Autocorrect is unsafe.
|
|
557
|
+
Rails/SquishedSQLHeredocs:
|
|
558
|
+
Enabled: false
|
|
559
|
+
|
|
560
|
+
# `strip_heredoc` strips indentation explicitly.
|
|
561
|
+
# Agents convert it to a squiggly heredoc and indentation that belonged in the string is removed.
|
|
562
|
+
Rails/StripHeredoc:
|
|
563
|
+
Enabled: false
|
|
564
|
+
|
|
565
|
+
# `params.require(:user).permit(:name)` shows the required key and the permitted keys.
|
|
566
|
+
# Agents switch it to `expect` and a Rails without that method raises, or the permit list shrinks.
|
|
567
|
+
Rails/StrongParametersExpect:
|
|
568
|
+
Enabled: false
|
|
569
|
+
|
|
570
|
+
# `self.table_name = 'legacy_users'` is the legacy table.
|
|
571
|
+
# Agents remove it and the model uses a table name inferred from the class.
|
|
572
|
+
Rails/TableNameAssignment:
|
|
573
|
+
Enabled: false
|
|
574
|
+
|
|
575
|
+
# A boolean with no default is a real third state when "unknown" is not false.
|
|
576
|
+
# Agents add `null: false, default: false` and unknown becomes false.
|
|
577
|
+
Rails/ThreeStateBooleanColumn:
|
|
578
|
+
Enabled: false
|
|
579
|
+
|
|
580
|
+
# `Time.zone =` in a job is the zone for the rest of that job.
|
|
581
|
+
# Agents wrap it in `Time.use_zone` and code after the block runs in the old zone.
|
|
582
|
+
Rails/TimeZoneAssignment:
|
|
583
|
+
Enabled: false
|
|
584
|
+
|
|
585
|
+
# `to_s(:db)` and `to_fs(:db)` are the same format on different Rails versions.
|
|
586
|
+
# Agents rename the method and the Rails that only has the other one raises.
|
|
587
|
+
Rails/ToFormattedS:
|
|
588
|
+
Enabled: false
|
|
589
|
+
|
|
590
|
+
# `to_s(:long)` is ActiveSupport's format argument, not Ruby's `to_s`.
|
|
591
|
+
# Agents delete the argument and the formatted string becomes the default dump.
|
|
592
|
+
Rails/ToSWithArgument:
|
|
593
|
+
Enabled: false
|
|
594
|
+
|
|
595
|
+
# A top-level `HashWithIndifferentAccess` constant is the map several callers update together.
|
|
596
|
+
# Agents replace the constant and those callers write into different hashes.
|
|
597
|
+
Rails/TopLevelHashWithIndifferentAccess:
|
|
598
|
+
Enabled: false
|
|
599
|
+
|
|
600
|
+
# `pluck(:city).uniq` uniq's the values Ruby already loaded.
|
|
601
|
+
# Agents move it to `distinct` and the database drops a different row than Ruby would.
|
|
602
|
+
Rails/UniqBeforePluck:
|
|
603
|
+
Enabled: false
|
|
604
|
+
|
|
605
|
+
# The known env names are development, test, and production. Staging is real here.
|
|
606
|
+
# Agents "correct" `staging` toward `production` and staging config stops loading.
|
|
607
|
+
Rails/UnknownEnv:
|
|
608
|
+
Enabled: false
|
|
609
|
+
|
|
610
|
+
# A column stays in `ignored_columns` because another environment still has it.
|
|
611
|
+
# The cop only sees the schema in front of it. Agents remove the name and that environment raises.
|
|
612
|
+
Rails/UnusedIgnoredColumns:
|
|
613
|
+
Enabled: false
|
|
614
|
+
|
|
615
|
+
# A response can carry a body with a status the cop treats as empty.
|
|
616
|
+
# Agents strip the body and the client loses the payload.
|
|
617
|
+
Rails/UnusedRenderContent:
|
|
618
|
+
Enabled: false
|
|
619
|
+
|
|
620
|
+
# `validates_presence_of :name` is the validation, including options on that macro.
|
|
621
|
+
# Agents rewrite it to the hash form and an option in the old slot is dropped.
|
|
622
|
+
Rails/Validation:
|
|
623
|
+
Enabled: false
|
|
624
|
+
|
|
625
|
+
# `where('LOWER(status) = ?', value)` is the comparison the database runs.
|
|
626
|
+
# Agents turn it into `where(status: value)` and the `LOWER` is gone.
|
|
627
|
+
Rails/WhereEquals:
|
|
628
|
+
Enabled: false
|
|
629
|
+
|
|
630
|
+
# `left_joins(:posts).where(posts: { id: nil })` shows the join and the null check.
|
|
631
|
+
# Agents switch it to `where.missing` and a later clause loses the join it shared.
|
|
632
|
+
Rails/WhereMissing:
|
|
633
|
+
Enabled: false
|
|
634
|
+
|
|
635
|
+
# `where('status IS DISTINCT FROM ?', value)` is the SQL, including NULL handling.
|
|
636
|
+
# Agents turn it into `where.not(status: value)` and NULL rows change meaning.
|
|
637
|
+
Rails/WhereNot:
|
|
638
|
+
Enabled: false
|
|
639
|
+
|
|
640
|
+
# Since Rails 6.1, `where.not(a: 1, b: 2)` is `NOT (a AND b)`.
|
|
641
|
+
# The suggested split is `NOT a AND NOT b`, a different set of rows. Agents apply that split.
|
|
642
|
+
Rails/WhereNotWithMultipleConditions:
|
|
643
|
+
Enabled: false
|
|
644
|
+
|
|
645
|
+
# `where('age >= ? AND age < ?', min, max)` shows an exclusive end.
|
|
646
|
+
# Agents fold it into a range and the end becomes inclusive, or a function around the column is dropped.
|
|
647
|
+
Rails/WhereRange:
|
|
648
|
+
Enabled: false
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aroundhome_cops
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 9.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jan Sandbrink
|
|
@@ -15,70 +15,84 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 1.92.2
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: 1.92.2
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: rubocop-factory_bot
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
32
|
+
version: 2.28.0
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version:
|
|
39
|
+
version: 2.28.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: rubocop-performance
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
44
|
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version:
|
|
46
|
+
version: 1.27.0
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
51
|
- - "~>"
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version:
|
|
53
|
+
version: 1.27.0
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: rubocop-rails
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: 2.38.0
|
|
61
|
+
type: :runtime
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: 2.38.0
|
|
54
68
|
- !ruby/object:Gem::Dependency
|
|
55
69
|
name: rubocop-rake
|
|
56
70
|
requirement: !ruby/object:Gem::Requirement
|
|
57
71
|
requirements:
|
|
58
72
|
- - "~>"
|
|
59
73
|
- !ruby/object:Gem::Version
|
|
60
|
-
version:
|
|
74
|
+
version: 0.7.1
|
|
61
75
|
type: :runtime
|
|
62
76
|
prerelease: false
|
|
63
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
78
|
requirements:
|
|
65
79
|
- - "~>"
|
|
66
80
|
- !ruby/object:Gem::Version
|
|
67
|
-
version:
|
|
81
|
+
version: 0.7.1
|
|
68
82
|
- !ruby/object:Gem::Dependency
|
|
69
83
|
name: rubocop-rspec
|
|
70
84
|
requirement: !ruby/object:Gem::Requirement
|
|
71
85
|
requirements:
|
|
72
86
|
- - "~>"
|
|
73
87
|
- !ruby/object:Gem::Version
|
|
74
|
-
version:
|
|
88
|
+
version: 3.10.2
|
|
75
89
|
type: :runtime
|
|
76
90
|
prerelease: false
|
|
77
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
78
92
|
requirements:
|
|
79
93
|
- - "~>"
|
|
80
94
|
- !ruby/object:Gem::Version
|
|
81
|
-
version:
|
|
95
|
+
version: 3.10.2
|
|
82
96
|
email:
|
|
83
97
|
- jan.sandbrink@aroundhome.de
|
|
84
98
|
executables: []
|
|
@@ -87,6 +101,7 @@ extra_rdoc_files: []
|
|
|
87
101
|
files:
|
|
88
102
|
- ".gitignore"
|
|
89
103
|
- ".gitlab-ci.yml"
|
|
104
|
+
- ".rubocop-rails-smoke.yml"
|
|
90
105
|
- ".rubocop.yml"
|
|
91
106
|
- ".ruby-version"
|
|
92
107
|
- CHANGELOG.md
|
|
@@ -95,6 +110,7 @@ files:
|
|
|
95
110
|
- aroundhome_cops.gemspec
|
|
96
111
|
- default.yml
|
|
97
112
|
- lib/aroundhome_cops.rb
|
|
113
|
+
- rails.yml
|
|
98
114
|
homepage: https://github.com/aroundhome/aroundhome_cops
|
|
99
115
|
licenses: []
|
|
100
116
|
metadata: {}
|