rubocop-config-captive 1.3.0 → 1.4.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/README.md +54 -9
- data/config/__private__/rubocop-rspec.yml +0 -6
- data/config/default.yml +1 -0
- data/config/rubocop-factory_bot.yml +2 -0
- data/config/rubocop-rails.yml +153 -0
- data/config/rubocop-rspec.yml +10 -1
- data/lib/rubocop/captive/version.rb +1 -1
- data/rubocop-config-captive.gemspec +5 -4
- metadata +24 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35d02218cee724fa93a32f80e654db067e2009706748d88863a09280398d2a79
|
4
|
+
data.tar.gz: 1eb89c57a0a20fae019e0431d002b60097be12822bf9191827364d52c48d8c02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fb77596cecdebf4e6a4b89f49b03c50d9876d676b3f201e53da14f8a35890660b40685007e3694ce199dc957b36f6dce426ba479fef56178b730642302fd804
|
7
|
+
data.tar.gz: 5b8069af3175f7c484028867a652ec7b2de31e0af9f75d4b3630ef39fd5c358cd467deaa52272343b9ad89c9fbafbe46736409fde1bb2e694f916b313e09004f
|
data/README.md
CHANGED
@@ -34,21 +34,66 @@ inherit_gem:
|
|
34
34
|
|
35
35
|
## Common Errors
|
36
36
|
|
37
|
-
|
37
|
+
<details>
|
38
|
+
<summary>
|
39
|
+
<strong>😩 My project has too many errors</strong>
|
40
|
+
</summary>
|
41
|
+
|
42
|
+
## Explanation
|
38
43
|
|
39
|
-
|
44
|
+
the configuration is very strict, it is normal to have many errors
|
40
45
|
|
41
|
-
|
46
|
+
## Solution
|
42
47
|
|
43
|
-
|
48
|
+
### Solution 1 : Auto-correct all errors
|
44
49
|
|
45
|
-
|
50
|
+
```shell
|
51
|
+
bundle exec rubocop -a
|
52
|
+
```
|
53
|
+
|
54
|
+
### Solution 2 : Ignore errors and progressively fix them
|
55
|
+
|
56
|
+
```shell
|
57
|
+
bundle exec rubocop --auto-gen-config
|
58
|
+
```
|
59
|
+
|
60
|
+
Will create `.rubocop_todo.yml` will all non passing rules. It is advised to fix them later, rule by rule.
|
61
|
+
</details>
|
62
|
+
|
63
|
+
<details>
|
64
|
+
<summary>
|
65
|
+
<strong>📍 <code>Gemfile</code> has lots of <code>Bundler/GemVersion</code> errors </strong>
|
66
|
+
</summary>
|
67
|
+
|
68
|
+
## Explanation
|
69
|
+
|
70
|
+
Each dependency should be explicitly set in the `Gemfile` and `bundle update` is strongly discouraged.
|
71
|
+
|
72
|
+
## Solution
|
73
|
+
|
74
|
+
### Solution 1 : Use bundle-locker
|
75
|
+
|
76
|
+
1. Install bundle-locker globally
|
77
|
+
|
78
|
+
```shell
|
79
|
+
gem install bundle-locker
|
80
|
+
```
|
81
|
+
|
82
|
+
2. Pin Gemfile using `Gemfile.lock`
|
83
|
+
|
84
|
+
```shell
|
85
|
+
bundle-locker ./Gemfile
|
86
|
+
```
|
87
|
+
|
88
|
+
3. Manually edit `Gemfile` and adjust constraints `"x.x.x"`, `"~> x.x.x"`, etc
|
89
|
+
|
90
|
+
4. Update `Gemfile.lock`
|
46
91
|
|
47
|
-
|
48
|
-
|
92
|
+
```shell
|
93
|
+
bundle install
|
94
|
+
```
|
49
95
|
|
50
|
-
|
51
|
-
1. Pin Gemfile using Gemfile.lock : `bundle-locker ./Gemfile`
|
96
|
+
</details>
|
52
97
|
|
53
98
|
## Contributing
|
54
99
|
|
@@ -246,9 +246,3 @@ RSpec/VerifiedDoubles:
|
|
246
246
|
RSpec/VoidExpect:
|
247
247
|
Description: This cop checks void `expect()`.
|
248
248
|
Enabled: false
|
249
|
-
RSpec/FactoryBot/AttributeDefinedStatically:
|
250
|
-
Description: Always declare attribute values as blocks.
|
251
|
-
Enabled: false
|
252
|
-
RSpec/FactoryBot/CreateList:
|
253
|
-
Description: Checks for create_list usage.
|
254
|
-
Enabled: true
|
data/config/default.yml
CHANGED
data/config/rubocop-rails.yml
CHANGED
@@ -1,3 +1,156 @@
|
|
1
1
|
inherit_from:
|
2
2
|
# @see https://github.com/airbnb/ruby/blob/main/rubocop-airbnb/config/rubocop-rails.yml
|
3
3
|
- ./__private__/rubocop-rails.yml
|
4
|
+
|
5
|
+
Rails/ActionControllerFlashBeforeRender:
|
6
|
+
Enabled: true
|
7
|
+
|
8
|
+
Rails/ActionControllerTestCase:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
Rails/ActionOrder:
|
12
|
+
Enabled: true
|
13
|
+
|
14
|
+
Rails/ActiveRecordCallbacksOrder:
|
15
|
+
Enabled: true
|
16
|
+
|
17
|
+
Rails/ActiveSupportOnLoad:
|
18
|
+
Enabled: true
|
19
|
+
|
20
|
+
Rails/AddColumnIndex:
|
21
|
+
Enabled: true
|
22
|
+
|
23
|
+
Rails/AfterCommitOverride:
|
24
|
+
Enabled: true
|
25
|
+
|
26
|
+
Rails/AttributeDefaultBlockValue:
|
27
|
+
Enabled: true
|
28
|
+
|
29
|
+
Rails/CompactBlank:
|
30
|
+
Enabled: true
|
31
|
+
|
32
|
+
Rails/DeprecatedActiveModelErrorsMethods:
|
33
|
+
Enabled: true
|
34
|
+
|
35
|
+
Rails/DotSeparatedKeys:
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Rails/DuplicateAssociation:
|
39
|
+
Enabled: true
|
40
|
+
|
41
|
+
Rails/DuplicateScope:
|
42
|
+
Enabled: true
|
43
|
+
|
44
|
+
Rails/EagerEvaluationLogMessage:
|
45
|
+
Enabled: false
|
46
|
+
|
47
|
+
Rails/ExpandedDateRange:
|
48
|
+
Enabled: true
|
49
|
+
|
50
|
+
Rails/FindById:
|
51
|
+
Enabled: true
|
52
|
+
|
53
|
+
Rails/DurationArithmetic:
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
Rails/FreezeTime:
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
Rails/I18nLazyLookup:
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
Rails/I18nLocaleAssignment:
|
63
|
+
Enabled: true
|
64
|
+
|
65
|
+
Rails/I18nLocaleTexts:
|
66
|
+
Enabled: true
|
67
|
+
|
68
|
+
Rails/IgnoredColumnsAssignment:
|
69
|
+
Enabled: false
|
70
|
+
|
71
|
+
Rails/Inquiry:
|
72
|
+
Enabled: true
|
73
|
+
|
74
|
+
Rails/MailerName:
|
75
|
+
Enabled: true
|
76
|
+
|
77
|
+
Rails/MatchRoute:
|
78
|
+
Enabled: false
|
79
|
+
|
80
|
+
Rails/MigrationClassName:
|
81
|
+
Enabled: true
|
82
|
+
|
83
|
+
Rails/NegateInclude:
|
84
|
+
Enabled: false
|
85
|
+
|
86
|
+
Rails/Pluck:
|
87
|
+
Enabled: true
|
88
|
+
|
89
|
+
Rails/PluckInWhere:
|
90
|
+
Enabled: true
|
91
|
+
|
92
|
+
Rails/RedundantPresenceValidationOnBelongsTo:
|
93
|
+
Enabled: false
|
94
|
+
|
95
|
+
Rails/RedundantTravelBack:
|
96
|
+
Enabled: true
|
97
|
+
|
98
|
+
Rails/RenderInline:
|
99
|
+
Enabled: false
|
100
|
+
|
101
|
+
Rails/RenderPlainText:
|
102
|
+
Enabled: true
|
103
|
+
|
104
|
+
Rails/ResponseParsedBody:
|
105
|
+
Enabled: true
|
106
|
+
|
107
|
+
Rails/RootJoinChain:
|
108
|
+
Enabled: true
|
109
|
+
|
110
|
+
Rails/RootPathnameMethods:
|
111
|
+
Enabled: true
|
112
|
+
|
113
|
+
Rails/RootPublicPath:
|
114
|
+
Enabled: true
|
115
|
+
|
116
|
+
Rails/ShortI18n:
|
117
|
+
Enabled: true
|
118
|
+
|
119
|
+
Rails/SquishedSQLHeredocs:
|
120
|
+
Enabled: true
|
121
|
+
|
122
|
+
Rails/StripHeredoc:
|
123
|
+
Enabled: true
|
124
|
+
|
125
|
+
Rails/TimeZoneAssignment:
|
126
|
+
Enabled: true
|
127
|
+
|
128
|
+
Rails/ToFormattedS:
|
129
|
+
Enabled: true
|
130
|
+
|
131
|
+
Rails/ToSWithArgument:
|
132
|
+
Enabled: true
|
133
|
+
|
134
|
+
Rails/TopLevelHashWithIndifferentAccess:
|
135
|
+
Enabled: true
|
136
|
+
|
137
|
+
Rails/TransactionExitStatement:
|
138
|
+
Enabled: true
|
139
|
+
|
140
|
+
Rails/UnusedIgnoredColumns:
|
141
|
+
Enabled: true
|
142
|
+
|
143
|
+
Rails/WhereEquals:
|
144
|
+
Enabled: true
|
145
|
+
|
146
|
+
Rails/WhereExists:
|
147
|
+
Enabled: true
|
148
|
+
|
149
|
+
Rails/WhereMissing:
|
150
|
+
Enabled: true
|
151
|
+
|
152
|
+
Rails/WhereNot:
|
153
|
+
Enabled: true
|
154
|
+
|
155
|
+
Rails/WhereNotWithMultipleConditions:
|
156
|
+
Enabled: true
|
data/config/rubocop-rspec.yml
CHANGED
@@ -3,4 +3,13 @@ inherit_from:
|
|
3
3
|
- ./__private__/rubocop-rspec.yml
|
4
4
|
|
5
5
|
RSpec/Focus:
|
6
|
-
Enabled: true
|
6
|
+
Enabled: true
|
7
|
+
|
8
|
+
# exclue certains fichiers pour simplifier l'utilisation de rswag
|
9
|
+
RSpec/ScatteredSetup:
|
10
|
+
Exclude:
|
11
|
+
- 'spec/requests/**/*'
|
12
|
+
|
13
|
+
Rspec/RepeatedExample:
|
14
|
+
Exclude:
|
15
|
+
- 'spec/requests/**/*'
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.email = ['julien.polo@captive.fr']
|
13
13
|
gem.homepage = 'https://github.com/Captive-Studio/rubocop-config'
|
14
14
|
gem.license = 'MIT'
|
15
|
-
gem.required_ruby_version = '>= 2.
|
15
|
+
gem.required_ruby_version = '>= 2.6'
|
16
16
|
|
17
17
|
gem.files = Dir[
|
18
18
|
'{config,lib}/**/*',
|
@@ -25,12 +25,13 @@ Gem::Specification.new do |gem|
|
|
25
25
|
# ⚠️ Instead of depending on rubocop-airbnb we copy sources
|
26
26
|
#
|
27
27
|
# gem.add_dependency('rubocop-airbnb', '~> 4.0.0')
|
28
|
-
gem.add_dependency('rubocop', '~> 1.
|
29
|
-
gem.add_dependency('rubocop-performance', '~> 1.
|
28
|
+
gem.add_dependency('rubocop', '~> 1.51.0')
|
29
|
+
gem.add_dependency('rubocop-performance', '~> 1.17.1 ')
|
30
30
|
gem.add_dependency('rubocop-rake', '~> 0.6.0')
|
31
31
|
gem.add_dependency('rubocop-rails', '~> 2.18.0')
|
32
|
-
gem.add_dependency('rubocop-rspec', '~> 2.
|
32
|
+
gem.add_dependency('rubocop-rspec', '~> 2.22.0')
|
33
33
|
gem.add_dependency('rubocop-capybara', '~> 2.18.0')
|
34
|
+
gem.add_dependency('rubocop-factory_bot', '~> 2.23.1')
|
34
35
|
gem.add_development_dependency('rspec', '~> 3.12')
|
35
36
|
# gem.metadata['rubygems_mfa_required'] = 'true'
|
36
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-config-captive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Captive
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-05-
|
13
|
+
date: 2023-05-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|
@@ -18,28 +18,28 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 1.51.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.
|
28
|
+
version: 1.51.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rubocop-performance
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 1.
|
35
|
+
version: 1.17.1
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 1.
|
42
|
+
version: 1.17.1
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rubocop-rake
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,14 +74,14 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 2.
|
77
|
+
version: 2.22.0
|
78
78
|
type: :runtime
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
82
|
- - "~>"
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version: 2.
|
84
|
+
version: 2.22.0
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: rubocop-capybara
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,6 +96,20 @@ dependencies:
|
|
96
96
|
- - "~>"
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: 2.18.0
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: rubocop-factory_bot
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 2.23.1
|
106
|
+
type: :runtime
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - "~>"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 2.23.1
|
99
113
|
- !ruby/object:Gem::Dependency
|
100
114
|
name: rspec
|
101
115
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,6 +151,7 @@ files:
|
|
137
151
|
- config/rubocop-bundler.yml
|
138
152
|
- config/rubocop-captive.yml
|
139
153
|
- config/rubocop-capybara.yml
|
154
|
+
- config/rubocop-factory_bot.yml
|
140
155
|
- config/rubocop-gemspec.yml
|
141
156
|
- config/rubocop-layout.yml
|
142
157
|
- config/rubocop-lint.yml
|
@@ -171,7 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
171
186
|
requirements:
|
172
187
|
- - ">="
|
173
188
|
- !ruby/object:Gem::Version
|
174
|
-
version: '2.
|
189
|
+
version: '2.6'
|
175
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
191
|
requirements:
|
177
192
|
- - ">="
|