makandra-rubocop 10.0.0 → 11.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +16 -16
- data/config/ext/rails.yml +61 -10
- data/lib/makandra_rubocop/version.rb +1 -1
- data/makandra-rubocop.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c144245de848054bccea595c7d1b89e7e656efa06042319fb21ada4ba0e77146
|
4
|
+
data.tar.gz: 6d6be56b155a811ec32af43ecedd46acbaaa2d64a9a775ce2eca5b9b882b3166
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f298b38c4a3b7d9b265ea8f0960da52a2da0b897272bc119499182f4ac79597f62b8144cc247e9ede864bd1ef0f31b843130dd6147a936ca93dd508348cd8a3
|
7
|
+
data.tar.gz: b416e0b0ba96a53fe6e69afe50c28a51cc8fd6416fb50c251ec0c1814160699b412fa212b567eea9393de340c187c1fca4e25404903c03162dc9fb37ba230266
|
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,13 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
9
9
|
### Compatible changes
|
10
10
|
|
11
11
|
|
12
|
+
## 11.0.0 - 2023-04-12
|
13
|
+
|
14
|
+
### Breaking changes
|
15
|
+
|
16
|
+
- Upgrade `rubocop-rails` from version `2.17.2` to `2.19.0`.
|
17
|
+
|
18
|
+
|
12
19
|
## 10.0.0 - 2022-11-09
|
13
20
|
|
14
21
|
### Breaking changes
|
data/Gemfile.lock
CHANGED
@@ -1,33 +1,33 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
makandra-rubocop (
|
4
|
+
makandra-rubocop (11.0.0)
|
5
5
|
rubocop (~> 1.36.0)
|
6
|
-
rubocop-rails (~> 2.
|
6
|
+
rubocop-rails (~> 2.19.0)
|
7
7
|
rubocop-rspec (~> 2.13.2)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (6.1.7)
|
12
|
+
activesupport (6.1.7.3)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 1.6, < 2)
|
15
15
|
minitest (>= 5.1)
|
16
16
|
tzinfo (~> 2.0)
|
17
17
|
zeitwerk (~> 2.3)
|
18
18
|
ast (2.4.2)
|
19
|
-
concurrent-ruby (1.
|
19
|
+
concurrent-ruby (1.2.2)
|
20
20
|
i18n (1.12.0)
|
21
21
|
concurrent-ruby (~> 1.0)
|
22
|
-
json (2.6.
|
23
|
-
minitest (5.
|
22
|
+
json (2.6.3)
|
23
|
+
minitest (5.18.0)
|
24
24
|
parallel (1.22.1)
|
25
|
-
parser (3.
|
25
|
+
parser (3.2.2.0)
|
26
26
|
ast (~> 2.4.1)
|
27
|
-
rack (3.0.
|
27
|
+
rack (3.0.7)
|
28
28
|
rainbow (3.1.1)
|
29
29
|
rake (12.3.2)
|
30
|
-
regexp_parser (2.
|
30
|
+
regexp_parser (2.7.0)
|
31
31
|
rexml (3.2.5)
|
32
32
|
rubocop (1.36.0)
|
33
33
|
json (~> 2.3)
|
@@ -39,19 +39,19 @@ GEM
|
|
39
39
|
rubocop-ast (>= 1.20.1, < 2.0)
|
40
40
|
ruby-progressbar (~> 1.7)
|
41
41
|
unicode-display_width (>= 1.4.0, < 3.0)
|
42
|
-
rubocop-ast (1.
|
43
|
-
parser (>= 3.
|
44
|
-
rubocop-rails (2.
|
42
|
+
rubocop-ast (1.28.0)
|
43
|
+
parser (>= 3.2.1.0)
|
44
|
+
rubocop-rails (2.19.0)
|
45
45
|
activesupport (>= 4.2.0)
|
46
46
|
rack (>= 1.1)
|
47
47
|
rubocop (>= 1.33.0, < 2.0)
|
48
48
|
rubocop-rspec (2.13.2)
|
49
49
|
rubocop (~> 1.33)
|
50
|
-
ruby-progressbar (1.
|
51
|
-
tzinfo (2.0.
|
50
|
+
ruby-progressbar (1.13.0)
|
51
|
+
tzinfo (2.0.6)
|
52
52
|
concurrent-ruby (~> 1.0)
|
53
|
-
unicode-display_width (2.
|
54
|
-
zeitwerk (2.6.
|
53
|
+
unicode-display_width (2.4.2)
|
54
|
+
zeitwerk (2.6.7)
|
55
55
|
|
56
56
|
PLATFORMS
|
57
57
|
ruby
|
data/config/ext/rails.yml
CHANGED
@@ -13,7 +13,8 @@ AllCops:
|
|
13
13
|
- 'bin/**/*'
|
14
14
|
- 'tmp/**/*'
|
15
15
|
- 'public/system/**/*'
|
16
|
-
- 'db
|
16
|
+
- 'db/*schema.rb'
|
17
|
+
- 'log/**/*'
|
17
18
|
# What version of Rails is the inspected code using? If a value is specified
|
18
19
|
# for TargetRailsVersion then it is used. Acceptable values are specified
|
19
20
|
# as a float (i.e. 5.1); the patch version of Rails should not be included.
|
@@ -43,6 +44,7 @@ Lint/NumberConversion:
|
|
43
44
|
- fortnight
|
44
45
|
- fortnights
|
45
46
|
- in_milliseconds
|
47
|
+
AllowedPatterns: []
|
46
48
|
|
47
49
|
Rails:
|
48
50
|
Enabled: true
|
@@ -50,8 +52,6 @@ Rails:
|
|
50
52
|
|
51
53
|
Rails/ActionControllerFlashBeforeRender:
|
52
54
|
Description: 'Use `flash.now` instead of `flash` before `render`.'
|
53
|
-
StyleGuide: 'https://rails.rubystyle.guide/#flash-before-render'
|
54
|
-
Reference: 'https://api.rubyonrails.org/classes/ActionController/FlashBeforeRender.html'
|
55
55
|
Enabled: false # there may be cases where we actually want to use `flash` before a render.
|
56
56
|
SafeAutoCorrect: false
|
57
57
|
VersionAdded: '2.16'
|
@@ -115,7 +115,9 @@ Rails/ActiveRecordOverride:
|
|
115
115
|
Check for overriding Active Record methods instead of using
|
116
116
|
callbacks.
|
117
117
|
Enabled: true
|
118
|
+
Severity: warning
|
118
119
|
VersionAdded: '0.67'
|
120
|
+
VersionChanged: '2.18'
|
119
121
|
Include:
|
120
122
|
- app/models/**/*.rb
|
121
123
|
|
@@ -204,8 +206,11 @@ Rails/AttributeDefaultBlockValue:
|
|
204
206
|
|
205
207
|
Rails/BelongsTo:
|
206
208
|
Description: >-
|
207
|
-
|
208
|
-
|
209
|
+
Use `optional: true` instead of `required: false` for
|
210
|
+
`belongs_to` relations.
|
211
|
+
Reference:
|
212
|
+
- https://guides.rubyonrails.org/5_0_release_notes.html
|
213
|
+
- https://github.com/rails/rails/pull/18937
|
209
214
|
Enabled: true
|
210
215
|
VersionAdded: '0.62'
|
211
216
|
|
@@ -224,6 +229,9 @@ Rails/Blank:
|
|
224
229
|
|
225
230
|
Rails/BulkChangeTable:
|
226
231
|
Description: 'Check whether alter queries are combinable.'
|
232
|
+
Reference:
|
233
|
+
- https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-change_table
|
234
|
+
- https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Table.html
|
227
235
|
Enabled: false # We'll maybe enable this later.
|
228
236
|
VersionAdded: '0.57'
|
229
237
|
Database: null
|
@@ -311,9 +319,10 @@ Rails/DelegateAllowBlank:
|
|
311
319
|
Rails/DeprecatedActiveModelErrorsMethods:
|
312
320
|
Description: 'Avoid manipulating ActiveModel errors hash directly.'
|
313
321
|
Enabled: true
|
322
|
+
Severity: warning
|
314
323
|
Safe: false
|
315
324
|
VersionAdded: '2.14'
|
316
|
-
VersionChanged: '2.
|
325
|
+
VersionChanged: '2.18'
|
317
326
|
|
318
327
|
Rails/DotSeparatedKeys:
|
319
328
|
Description: 'Enforces the use of dot-separated keys instead of `:scope` options in `I18n` translation methods.'
|
@@ -324,12 +333,16 @@ Rails/DotSeparatedKeys:
|
|
324
333
|
Rails/DuplicateAssociation:
|
325
334
|
Description: "Don't repeat associations in a model."
|
326
335
|
Enabled: true
|
336
|
+
Severity: warning
|
327
337
|
VersionAdded: '2.14'
|
338
|
+
VersionChanged: '2.18'
|
328
339
|
|
329
340
|
Rails/DuplicateScope:
|
330
341
|
Description: 'Multiple scopes share this same where clause.'
|
331
342
|
Enabled: true
|
343
|
+
Severity: warning
|
332
344
|
VersionAdded: '2.14'
|
345
|
+
VersionChanged: '2.18'
|
333
346
|
|
334
347
|
Rails/DurationArithmetic:
|
335
348
|
Description: 'Do not use duration as arithmetic operand with `Time.current`.'
|
@@ -441,11 +454,12 @@ Rails/FindById:
|
|
441
454
|
VersionAdded: '2.7'
|
442
455
|
|
443
456
|
Rails/FindEach:
|
444
|
-
Description: 'Prefer all.find_each over all.
|
457
|
+
Description: 'Prefer all.find_each over all.each.'
|
445
458
|
StyleGuide: 'https://rails.rubystyle.guide#find-each'
|
446
459
|
Enabled: true
|
460
|
+
Safe: false
|
447
461
|
VersionAdded: '0.30'
|
448
|
-
VersionChanged: '2.
|
462
|
+
VersionChanged: '2.19'
|
449
463
|
Include:
|
450
464
|
- app/models/**/*.rb
|
451
465
|
AllowedMethods:
|
@@ -511,7 +525,7 @@ Rails/I18nLazyLookup:
|
|
511
525
|
Enabled: true
|
512
526
|
VersionAdded: '2.14'
|
513
527
|
Include:
|
514
|
-
- 'controllers
|
528
|
+
- 'app/controllers/**/*.rb'
|
515
529
|
|
516
530
|
Rails/I18nLocaleAssignment:
|
517
531
|
Description: 'Prefer the usage of `I18n.with_locale` instead of manually updating `I18n.locale` value.'
|
@@ -524,7 +538,7 @@ Rails/I18nLocaleAssignment:
|
|
524
538
|
Rails/I18nLocaleTexts:
|
525
539
|
Description: 'Enforces use of I18n and locale files instead of locale specific strings.'
|
526
540
|
StyleGuide: 'https://rails.rubystyle.guide/#locale-texts'
|
527
|
-
Enabled:
|
541
|
+
Enabled: false # Might be enabled for projects with localization
|
528
542
|
VersionAdded: '2.14'
|
529
543
|
|
530
544
|
Rails/IgnoredColumnsAssignment:
|
@@ -563,6 +577,9 @@ Rails/Inquiry:
|
|
563
577
|
|
564
578
|
Rails/InverseOf:
|
565
579
|
Description: 'Checks for associations where the inverse cannot be determined automatically.'
|
580
|
+
Reference:
|
581
|
+
- https://guides.rubyonrails.org/association_basics.html#bi-directional-associations
|
582
|
+
- https://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#module-ActiveRecord::Associations::ClassMethods-label-Setting+Inverses
|
566
583
|
Enabled: true
|
567
584
|
VersionAdded: '0.52'
|
568
585
|
IgnoreScopes: false
|
@@ -666,7 +683,9 @@ Rails/Pluck:
|
|
666
683
|
Description: 'Prefer `pluck` over `map { ... }`.'
|
667
684
|
StyleGuide: 'https://rails.rubystyle.guide#pluck'
|
668
685
|
Enabled: true
|
686
|
+
Safe: false
|
669
687
|
VersionAdded: '2.7'
|
688
|
+
VersionChanged: '2.18'
|
670
689
|
|
671
690
|
Rails/PluckId:
|
672
691
|
Description: 'Use `ids` instead of `pluck(:id)` or `pluck(primary_key)`.'
|
@@ -818,6 +837,18 @@ Rails/RequireDependency:
|
|
818
837
|
Enabled: false # We should enable this cop later, when all or most of our applications use zeitwerk
|
819
838
|
VersionAdded: '2.10'
|
820
839
|
|
840
|
+
Rails/ResponseParsedBody:
|
841
|
+
Description: Prefer `response.parsed_body` to `JSON.parse(response.body)`.
|
842
|
+
Enabled: true
|
843
|
+
Safe: false
|
844
|
+
VersionAdded: '2.18'
|
845
|
+
VersionChanged: '2.19'
|
846
|
+
Include:
|
847
|
+
- spec/controllers/**/*.rb
|
848
|
+
- spec/requests/**/*.rb
|
849
|
+
- test/controllers/**/*.rb
|
850
|
+
- test/integration/**/*.rb
|
851
|
+
|
821
852
|
Rails/ReversibleMigration:
|
822
853
|
Description: 'Checks whether the change method of the migration file is reversible.'
|
823
854
|
StyleGuide: 'https://rails.rubystyle.guide#reversible-migration'
|
@@ -963,6 +994,14 @@ Rails/TableNameAssignment:
|
|
963
994
|
Include:
|
964
995
|
- app/models/**/*.rb
|
965
996
|
|
997
|
+
Rails/ThreeStateBooleanColumn:
|
998
|
+
Description: 'Add a default value and a `NOT NULL` constraint to boolean columns.'
|
999
|
+
StyleGuide: 'https://rails.rubystyle.guide/#three-state-boolean'
|
1000
|
+
Enabled: false # Optional for specific projects https://makandracards.com/makandra/536214-rails-using-database-default-values-for-boolean-attributes
|
1001
|
+
VersionAdded: '2.19'
|
1002
|
+
Include:
|
1003
|
+
- db/**/*.rb
|
1004
|
+
|
966
1005
|
Rails/TimeZone:
|
967
1006
|
Description: 'Checks the correct usage of time zone aware methods.'
|
968
1007
|
StyleGuide: 'https://rails.rubystyle.guide#time'
|
@@ -1009,10 +1048,14 @@ Rails/TopLevelHashWithIndifferentAccess:
|
|
1009
1048
|
Description: 'Identifies top-level `HashWithIndifferentAccess`.'
|
1010
1049
|
Reference: 'https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#top-level-hashwithindifferentaccess-is-soft-deprecated'
|
1011
1050
|
Enabled: true
|
1051
|
+
Severity: warning
|
1012
1052
|
VersionAdded: '2.16'
|
1053
|
+
VersionChanged: '2.18'
|
1013
1054
|
|
1014
1055
|
Rails/TransactionExitStatement:
|
1015
1056
|
Description: 'Avoid the usage of `return`, `break` and `throw` in transaction blocks.'
|
1057
|
+
Reference:
|
1058
|
+
- https://github.com/rails/rails/commit/15aa4200e083
|
1016
1059
|
Enabled: true # Get a head start on deprecations: https://blog.saeloun.com/2020/04/06/rails-disallow-return-break-and-throw-to-exit-transaction.html
|
1017
1060
|
VersionAdded: '2.14'
|
1018
1061
|
|
@@ -1037,7 +1080,9 @@ Rails/UniqueValidationWithoutIndex:
|
|
1037
1080
|
Rails/UnknownEnv:
|
1038
1081
|
Description: 'Use correct environment name.'
|
1039
1082
|
Enabled: false # https://github.com/makandra/makandra-rubocop/issues/11
|
1083
|
+
Severity: warning
|
1040
1084
|
VersionAdded: '0.51'
|
1085
|
+
VersionChanged: '2.18'
|
1041
1086
|
Environments:
|
1042
1087
|
- development
|
1043
1088
|
- test
|
@@ -1090,12 +1135,18 @@ Rails/WhereNot:
|
|
1090
1135
|
Rails/WhereNotWithMultipleConditions:
|
1091
1136
|
Description: 'Do not use `where.not(...)` with multiple conditions.'
|
1092
1137
|
Enabled: true
|
1138
|
+
Severity: warning
|
1093
1139
|
VersionAdded: '2.17'
|
1140
|
+
VersionChanged: '2.18'
|
1094
1141
|
|
1095
1142
|
# Accept `redirect_to(...) and return` and similar cases.
|
1096
1143
|
Style/AndOr:
|
1097
1144
|
EnforcedStyle: conditionals
|
1098
1145
|
|
1146
|
+
Style/FormatStringToken:
|
1147
|
+
AllowedMethods:
|
1148
|
+
- redirect
|
1149
|
+
|
1099
1150
|
Style/SymbolProc:
|
1100
1151
|
AllowedMethods:
|
1101
1152
|
- define_method
|
data/makandra-rubocop.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
27
|
spec.add_dependency 'rubocop', '~> 1.36.0'
|
28
|
-
spec.add_dependency 'rubocop-rails', '~> 2.
|
28
|
+
spec.add_dependency 'rubocop-rails', '~> 2.19.0'
|
29
29
|
spec.add_dependency 'rubocop-rspec', '~> 2.13.2'
|
30
30
|
|
31
31
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: makandra-rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 11.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arne Hartherz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-04-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubocop
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 2.
|
34
|
+
version: 2.19.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 2.
|
41
|
+
version: 2.19.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rubocop-rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
|
-
rubygems_version: 3.
|
130
|
+
rubygems_version: 3.2.19
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: makandra's default Rubocop configuration
|