rubocop-config-captive 1.16.2 → 2.0.0.pre.alpha.1
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/Gemfile +1 -1
- data/config/__private__/rubocop-capybara.yml +1 -2
- data/config/__private__/rubocop-naming.yml +1 -1
- data/config/__private__/rubocop-rspec.yml +13 -7
- data/config/default.yml +1 -2
- data/config/rubocop-capybara.yml +1 -2
- data/config/rubocop-factory_bot.yml +1 -2
- data/config/rubocop-rails-omakase.yml +2 -0
- data/config/rubocop-rake.yml +1 -2
- data/lib/rubocop/captive/inject.rb +1 -1
- data/lib/rubocop/captive/version.rb +1 -2
- data/lib/rubocop/cop/captive/rails/migration_methods.rb +3 -3
- data/rubocop-config-captive.gemspec +12 -14
- metadata +36 -25
- data/config/__private__/rubocop-performance.yml +0 -126
- data/config/__private__/rubocop-rails.yml +0 -222
- data/config/rubocop-performance.yml +0 -3
- data/config/rubocop-rails.yml +0 -171
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c99695fc1dc46fea45cd66954df04ddd6e2ea13f28f53a933f961a026bf95df
|
4
|
+
data.tar.gz: da9335228acf9cb78300f709a1b57eb69466cb5ded705e29e8c21be2abee14c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cff9f4fa93b83242395217b1ceede3900fe0c6f961a6b4a7ee9b25da58039d5802674517b384d7c52975ab9c3b53b6b72da20d00228ed66e27f2aced86e04213
|
7
|
+
data.tar.gz: 90243990c19ed762be59170645fcc8b32b7714cac8eef762d2c3093faf46439d3df238768d114edc57ab864e92afa39fcb5d5c5e425f2acdc84382c902b9eeb9
|
data/Gemfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
|
2
|
-
|
2
|
+
plugins:
|
3
3
|
- rubocop-rspec
|
4
4
|
RSpec/AlignLeftLetBrace:
|
5
5
|
Description: Checks that left braces for adjacent single line lets are aligned.
|
@@ -41,6 +41,9 @@ RSpec/DescribeSymbol:
|
|
41
41
|
RSpec/DescribedClass:
|
42
42
|
Description: 'Use `described_class` for tested class / module'
|
43
43
|
Enabled: false
|
44
|
+
RSpec/Dialect:
|
45
|
+
Description: Enforces custom RSpec dialects.
|
46
|
+
Enabled: false
|
44
47
|
RSpec/EmptyExampleGroup:
|
45
48
|
Description: Checks if an example group does not include any tests.
|
46
49
|
Enabled: true
|
@@ -87,12 +90,6 @@ RSpec/ExpectInHook:
|
|
87
90
|
RSpec/ExpectOutput:
|
88
91
|
Description: Checks for opportunities to use `expect { ... }.to output`.
|
89
92
|
Enabled: false
|
90
|
-
Rails/FilePath:
|
91
|
-
Description: 'Checks the file and folder naming of the spec file.'
|
92
|
-
Enabled: false
|
93
|
-
SupportedStyles:
|
94
|
-
RuboCop: rubocop
|
95
|
-
RSpec: rspec
|
96
93
|
RSpec/Focus:
|
97
94
|
Description: Checks if examples are focused.
|
98
95
|
Enabled: false
|
@@ -234,6 +231,15 @@ RSpec/SharedExamples:
|
|
234
231
|
RSpec/SingleArgumentMessageChain:
|
235
232
|
Description: Checks that chains of messages contain more than one element.
|
236
233
|
Enabled: true
|
234
|
+
RSpec/SpecFilePathFormat:
|
235
|
+
Description: Checks that spec file paths are consistent and well-formed.
|
236
|
+
Enabled: false
|
237
|
+
CustomTransform:
|
238
|
+
RuboCop: rubocop
|
239
|
+
RSpec: rspec
|
240
|
+
RSpec/SpecFilePathSuffix:
|
241
|
+
Description: Checks that spec file paths suffix are consistent and well-formed.
|
242
|
+
Enabled: false
|
237
243
|
RSpec/SubjectStub:
|
238
244
|
Description: Checks for stubbed test subjects.
|
239
245
|
Enabled: false
|
data/config/default.yml
CHANGED
@@ -48,9 +48,8 @@ inherit_from:
|
|
48
48
|
- './rubocop-magic_numbers.yml'
|
49
49
|
- './rubocop-metrics.yml'
|
50
50
|
- './rubocop-naming.yml'
|
51
|
-
- './rubocop-performance.yml'
|
52
51
|
- './rubocop-rake.yml'
|
53
|
-
- './rubocop-rails.yml'
|
54
52
|
- './rubocop-rspec.yml'
|
55
53
|
- './rubocop-security.yml'
|
56
54
|
- './rubocop-style.yml'
|
55
|
+
- './rubocop-rails-omakase.yml'
|
data/config/rubocop-capybara.yml
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
- rubocop-capybara
|
1
|
+
plugins: rubocop-capybara
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
- rubocop-factory_bot
|
1
|
+
plugins: rubocop-factory_bot
|
data/config/rubocop-rake.yml
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
- rubocop-rake
|
1
|
+
plugins: rubocop-rake
|
@@ -11,7 +11,7 @@ module RuboCop
|
|
11
11
|
path = CONFIG_DEFAULT.to_s
|
12
12
|
hash = ConfigLoader.load_file(path).to_hash
|
13
13
|
config = Config.new(hash, path)
|
14
|
-
|
14
|
+
Rails.logger.debug "configuration from #{path}" if ConfigLoader.debug?
|
15
15
|
config = ConfigLoader.merge_with_default(config, path)
|
16
16
|
ConfigLoader.instance_variable_set(:@default_configuration, config)
|
17
17
|
end
|
@@ -31,7 +31,7 @@ module RuboCop
|
|
31
31
|
MSG = "Avoid using ActiveRecord::Migration methods in `up` and `down` methods. \
|
32
32
|
Use `change` instead."
|
33
33
|
|
34
|
-
BLACKLISTED_METHODS = %i
|
34
|
+
BLACKLISTED_METHODS = %i[
|
35
35
|
add_column
|
36
36
|
add_foreign_key
|
37
37
|
add_index
|
@@ -50,14 +50,14 @@ module RuboCop
|
|
50
50
|
rename_column
|
51
51
|
rename_index
|
52
52
|
rename_table
|
53
|
-
|
53
|
+
].freeze
|
54
54
|
|
55
55
|
def_node_search :migration_method?, <<~PATTERN
|
56
56
|
(send nil? {#{BLACKLISTED_METHODS.map(&:inspect).join(" ")}} ...)
|
57
57
|
PATTERN
|
58
58
|
|
59
59
|
def on_def(node)
|
60
|
-
return unless %i
|
60
|
+
return unless %i[up down].include?(node.method_name)
|
61
61
|
return unless migration_method?(node)
|
62
62
|
|
63
63
|
add_offense(node, message: MSG)
|
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.version = RuboCop::Captive::VERSION
|
9
9
|
gem.summary = "Shared rubocop configurations"
|
10
10
|
gem.description = "Shared rubocop configuration for Captive projects"
|
11
|
-
gem.authors = ["Captive", "Julien Polo", "Clément Prod'homme"]
|
12
|
-
gem.email = ["julien.polo@captive.fr"]
|
11
|
+
gem.authors = [ "Captive", "Julien Polo", "Clément Prod'homme" ]
|
12
|
+
gem.email = [ "julien.polo@captive.fr" ]
|
13
13
|
gem.homepage = "https://github.com/Captive-Studio/rubocop-config"
|
14
14
|
gem.license = "MIT"
|
15
15
|
gem.required_ruby_version = ">= 2.6"
|
@@ -21,18 +21,16 @@ Gem::Specification.new do |gem|
|
|
21
21
|
"Gemfile",
|
22
22
|
]
|
23
23
|
|
24
|
-
#
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
gem.add_dependency("rubocop", "~>
|
29
|
-
gem.add_dependency("rubocop-
|
30
|
-
gem.add_dependency("rubocop-
|
31
|
-
gem.add_dependency("rubocop-
|
32
|
-
gem.add_dependency("rubocop-
|
33
|
-
gem.add_dependency("rubocop-capybara", "~> 2.21.0")
|
34
|
-
gem.add_dependency("rubocop-factory_bot", "~> 2.26.1")
|
24
|
+
# Pour mettre à jour les dépendances, vous pouvez utiliser le script :
|
25
|
+
# ruby script/update_dependencies.rb
|
26
|
+
gem.add_dependency("rubocop", "~> 1.77.0")
|
27
|
+
gem.add_dependency("rubocop-performance", "~> 1.25.0")
|
28
|
+
gem.add_dependency("rubocop-rake", "~> 0.7.1")
|
29
|
+
gem.add_dependency("rubocop-rails", "~> 2.32.0")
|
30
|
+
gem.add_dependency("rubocop-rspec", "~> 3.6.0")
|
31
|
+
gem.add_dependency("rubocop-capybara", "~> 2.22.1")
|
32
|
+
gem.add_dependency("rubocop-factory_bot", "~> 2.27.1")
|
35
33
|
gem.add_dependency("rubocop-magic_numbers", "~> 0.5.0")
|
34
|
+
gem.add_dependency("rubocop-rails-omakase", "~> 1.1.0")
|
36
35
|
gem.add_development_dependency("rspec", "~> 3.12")
|
37
|
-
# gem.metadata['rubygems_mfa_required'] = 'true'
|
38
36
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-config-captive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre.alpha.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Captive
|
8
8
|
- Julien Polo
|
9
9
|
- Clément Prod'homme
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2025-06-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|
@@ -18,98 +18,98 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 1.77.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.77.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.25.0
|
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.25.0
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rubocop-rake
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.7.1
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.
|
56
|
+
version: 0.7.1
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rubocop-rails
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 2.
|
63
|
+
version: 2.32.0
|
64
64
|
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 2.
|
70
|
+
version: 2.32.0
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rubocop-rspec
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 3.
|
77
|
+
version: 3.6.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: 3.
|
84
|
+
version: 3.6.0
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: rubocop-capybara
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
89
|
- - "~>"
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 2.
|
91
|
+
version: 2.22.1
|
92
92
|
type: :runtime
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - "~>"
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: 2.
|
98
|
+
version: 2.22.1
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: rubocop-factory_bot
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
103
|
- - "~>"
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: 2.
|
105
|
+
version: 2.27.1
|
106
106
|
type: :runtime
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - "~>"
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: 2.
|
112
|
+
version: 2.27.1
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: rubocop-magic_numbers
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,6 +124,20 @@ dependencies:
|
|
124
124
|
- - "~>"
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: 0.5.0
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: rubocop-rails-omakase
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - "~>"
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 1.1.0
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - "~>"
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: 1.1.0
|
127
141
|
- !ruby/object:Gem::Dependency
|
128
142
|
name: rspec
|
129
143
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,8 +170,6 @@ files:
|
|
156
170
|
- config/__private__/rubocop-lint.yml
|
157
171
|
- config/__private__/rubocop-metrics.yml
|
158
172
|
- config/__private__/rubocop-naming.yml
|
159
|
-
- config/__private__/rubocop-performance.yml
|
160
|
-
- config/__private__/rubocop-rails.yml
|
161
173
|
- config/__private__/rubocop-rspec.yml
|
162
174
|
- config/__private__/rubocop-security.yml
|
163
175
|
- config/__private__/rubocop-style.yml
|
@@ -172,8 +184,7 @@ files:
|
|
172
184
|
- config/rubocop-magic_numbers.yml
|
173
185
|
- config/rubocop-metrics.yml
|
174
186
|
- config/rubocop-naming.yml
|
175
|
-
- config/rubocop-
|
176
|
-
- config/rubocop-rails.yml
|
187
|
+
- config/rubocop-rails-omakase.yml
|
177
188
|
- config/rubocop-rake.yml
|
178
189
|
- config/rubocop-rspec.yml
|
179
190
|
- config/rubocop-security.yml
|
@@ -199,7 +210,7 @@ homepage: https://github.com/Captive-Studio/rubocop-config
|
|
199
210
|
licenses:
|
200
211
|
- MIT
|
201
212
|
metadata: {}
|
202
|
-
post_install_message:
|
213
|
+
post_install_message:
|
203
214
|
rdoc_options: []
|
204
215
|
require_paths:
|
205
216
|
- lib
|
@@ -210,12 +221,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
210
221
|
version: '2.6'
|
211
222
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
223
|
requirements:
|
213
|
-
- - "
|
224
|
+
- - ">"
|
214
225
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
226
|
+
version: 1.3.1
|
216
227
|
requirements: []
|
217
228
|
rubygems_version: 3.3.27
|
218
|
-
signing_key:
|
229
|
+
signing_key:
|
219
230
|
specification_version: 4
|
220
231
|
summary: Shared rubocop configurations
|
221
232
|
test_files: []
|
@@ -1,126 +0,0 @@
|
|
1
|
-
### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
|
2
|
-
require:
|
3
|
-
- rubocop-performance
|
4
|
-
|
5
|
-
Performance/Caller:
|
6
|
-
Enabled: false
|
7
|
-
|
8
|
-
# Type 'Performance' (8):
|
9
|
-
# Supports --auto-correct
|
10
|
-
Performance/CaseWhenSplat:
|
11
|
-
Description: Place `when` conditions that use splat at the end of the list of `when`
|
12
|
-
branches.
|
13
|
-
Enabled: false
|
14
|
-
|
15
|
-
# Supports --auto-correct
|
16
|
-
Performance/Casecmp:
|
17
|
-
Description: Use `casecmp` rather than `downcase ==`.
|
18
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code
|
19
|
-
Enabled: false
|
20
|
-
|
21
|
-
Performance/CompareWithBlock:
|
22
|
-
Enabled: false
|
23
|
-
|
24
|
-
# Supports --auto-correct
|
25
|
-
Performance/Count:
|
26
|
-
Description: Use `count` instead of `select...size`, `reject...size`, `select...count`,
|
27
|
-
`reject...count`, `select...length`, and `reject...length`.
|
28
|
-
Enabled: false
|
29
|
-
|
30
|
-
# Supports --auto-correct
|
31
|
-
Performance/Detect:
|
32
|
-
Description: Use `detect` instead of `select.first`, `find_all.first`, `select.last`,
|
33
|
-
and `find_all.last`.
|
34
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code
|
35
|
-
Enabled: false
|
36
|
-
|
37
|
-
Performance/DoubleStartEndWith:
|
38
|
-
Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x,
|
39
|
-
...) || str.{start,end}_with?(y, ...)`.
|
40
|
-
Enabled: false
|
41
|
-
|
42
|
-
# Supports --auto-correct
|
43
|
-
Performance/EndWith:
|
44
|
-
Description: Use `end_with?` instead of a regex match anchored to the end of a string.
|
45
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
|
46
|
-
Enabled: false
|
47
|
-
|
48
|
-
Performance/FixedSize:
|
49
|
-
Description: Do not compute the size of statically sized objects except in constants
|
50
|
-
Enabled: false
|
51
|
-
|
52
|
-
# Supports --auto-correct
|
53
|
-
Performance/FlatMap:
|
54
|
-
Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)`
|
55
|
-
or `Enumberable#collect..Array#flatten(1)`
|
56
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
|
57
|
-
Enabled: false
|
58
|
-
EnabledForFlattenWithoutParams: false
|
59
|
-
|
60
|
-
Performance/InefficientHashSearch:
|
61
|
-
Enabled: false
|
62
|
-
|
63
|
-
# Supports --auto-correct
|
64
|
-
Performance/RangeInclude:
|
65
|
-
Description: Use `Range#cover?` instead of `Range#include?`.
|
66
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code
|
67
|
-
Enabled: false
|
68
|
-
|
69
|
-
# Supports --auto-correct
|
70
|
-
Performance/RedundantBlockCall:
|
71
|
-
Description: Use `yield` instead of `block.call`.
|
72
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
|
73
|
-
Enabled: false
|
74
|
-
|
75
|
-
# Supports --auto-correct
|
76
|
-
Performance/RedundantMatch:
|
77
|
-
Description: Use `=~` instead of `String#match` or `Regexp#match` in a context where
|
78
|
-
the returned `MatchData` is not needed.
|
79
|
-
Enabled: false
|
80
|
-
|
81
|
-
# Supports --auto-correct
|
82
|
-
Performance/RedundantMerge:
|
83
|
-
Description: Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
|
84
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code
|
85
|
-
Enabled: false
|
86
|
-
|
87
|
-
Performance/RegexpMatch:
|
88
|
-
Enabled: false
|
89
|
-
|
90
|
-
# Supports --auto-correct
|
91
|
-
Performance/ReverseEach:
|
92
|
-
Description: Use `reverse_each` instead of `reverse.each`.
|
93
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
|
94
|
-
Enabled: false
|
95
|
-
|
96
|
-
# Supports --auto-correct
|
97
|
-
Performance/Size:
|
98
|
-
Description: Use `size` instead of `count` for counting the number of elements in
|
99
|
-
`Array` and `Hash`.
|
100
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code
|
101
|
-
Enabled: false
|
102
|
-
|
103
|
-
# Supports --auto-correct
|
104
|
-
Performance/StartWith:
|
105
|
-
Description: Use `start_with?` instead of a regex match anchored to the beginning
|
106
|
-
of a string.
|
107
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
|
108
|
-
Enabled: false
|
109
|
-
|
110
|
-
# Supports --auto-correct
|
111
|
-
Performance/StringReplacement:
|
112
|
-
Description: Use `tr` instead of `gsub` when you are replacing the same number of
|
113
|
-
characters. Use `delete` instead of `gsub` when you are deleting characters.
|
114
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
|
115
|
-
Enabled: false
|
116
|
-
|
117
|
-
Performance/TimesMap:
|
118
|
-
Description: Checks for .times.map calls.
|
119
|
-
Enabled: false
|
120
|
-
|
121
|
-
Performance/UnfreezeString:
|
122
|
-
Enabled: false
|
123
|
-
|
124
|
-
Performance/UriDefaultParser:
|
125
|
-
Enabled: false
|
126
|
-
|
@@ -1,222 +0,0 @@
|
|
1
|
-
### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
|
2
|
-
require:
|
3
|
-
- rubocop-rails
|
4
|
-
|
5
|
-
# before_action doesn't seem to exist, so this doesn't make sense.
|
6
|
-
Rails/ActionFilter:
|
7
|
-
Enabled: false
|
8
|
-
|
9
|
-
Rails/ActiveRecordAliases:
|
10
|
-
Enabled: false
|
11
|
-
|
12
|
-
Rails/ActiveSupportAliases:
|
13
|
-
Enabled: false
|
14
|
-
|
15
|
-
Rails/ApplicationJob:
|
16
|
-
Enabled: false
|
17
|
-
|
18
|
-
Rails/ApplicationRecord:
|
19
|
-
Enabled: false
|
20
|
-
|
21
|
-
Rails/AssertNot:
|
22
|
-
Enabled: false
|
23
|
-
|
24
|
-
Rails/Blank:
|
25
|
-
Description: 'Enforce using `blank?` and `present?`.'
|
26
|
-
Enabled: true
|
27
|
-
# Convert checks for `nil` or `empty?` to `blank?`
|
28
|
-
NilOrEmpty: true
|
29
|
-
# Convert usages of not `present?` to `blank?`
|
30
|
-
NotPresent: true
|
31
|
-
# Convert usages of `unless` `present?` to `if` `blank?`
|
32
|
-
UnlessPresent: true
|
33
|
-
|
34
|
-
Rails/BulkChangeTable:
|
35
|
-
Enabled: false
|
36
|
-
|
37
|
-
Rails/CreateTableWithTimestamps:
|
38
|
-
Description: Checks the migration for which timestamps are not included when creating a new table.
|
39
|
-
Enabled: true
|
40
|
-
|
41
|
-
Rails/Date:
|
42
|
-
Description: Checks the correct usage of date aware methods, such as Date.today, Date.current
|
43
|
-
etc.
|
44
|
-
Enabled: false
|
45
|
-
EnforcedStyle: flexible
|
46
|
-
SupportedStyles:
|
47
|
-
- strict
|
48
|
-
- flexible
|
49
|
-
|
50
|
-
# Supports --auto-correct
|
51
|
-
Rails/Delegate:
|
52
|
-
Description: Prefer delegate method for delegations.
|
53
|
-
Enabled: false
|
54
|
-
|
55
|
-
Rails/DelegateAllowBlank:
|
56
|
-
Enabled: false
|
57
|
-
|
58
|
-
Rails/DynamicFindBy:
|
59
|
-
Enabled: false
|
60
|
-
|
61
|
-
Rails/EnumUniqueness:
|
62
|
-
Enabled: false
|
63
|
-
|
64
|
-
Rails/EnvironmentComparison:
|
65
|
-
Description: "Favor `Rails.env.production?` over `Rails.env == 'production'`"
|
66
|
-
Enabled: true
|
67
|
-
|
68
|
-
Rails/Exit:
|
69
|
-
Description: >-
|
70
|
-
Favor `fail`, `break`, `return`, etc. over `exit` in
|
71
|
-
application or library code outside of Rake files to avoid
|
72
|
-
exits during unit testing or running in production.
|
73
|
-
Enabled: false
|
74
|
-
|
75
|
-
Rails/FilePath:
|
76
|
-
Enabled: false
|
77
|
-
|
78
|
-
# Supports --auto-correct
|
79
|
-
Rails/FindBy:
|
80
|
-
Description: Prefer find_by over where.first.
|
81
|
-
Enabled: false
|
82
|
-
Include:
|
83
|
-
- app/models/**/*.rb
|
84
|
-
|
85
|
-
# Supports --auto-correct
|
86
|
-
Rails/FindEach:
|
87
|
-
Description: Prefer all.find_each over all.find.
|
88
|
-
Enabled: false
|
89
|
-
Include:
|
90
|
-
- app/models/**/*.rb
|
91
|
-
|
92
|
-
Rails/HasAndBelongsToMany:
|
93
|
-
Description: Prefer has_many :through to has_and_belongs_to_many.
|
94
|
-
Enabled: false
|
95
|
-
Include:
|
96
|
-
- app/models/**/*.rb
|
97
|
-
|
98
|
-
Rails/HasManyOrHasOneDependent:
|
99
|
-
Enabled: false
|
100
|
-
|
101
|
-
Rails/HttpPositionalArguments:
|
102
|
-
Enabled: false
|
103
|
-
|
104
|
-
Rails/HttpStatus:
|
105
|
-
Enabled: false
|
106
|
-
|
107
|
-
Rails/InverseOf:
|
108
|
-
Description: 'Checks for associations where the inverse cannot be determined automatically.'
|
109
|
-
Enabled: false
|
110
|
-
|
111
|
-
Rails/LexicallyScopedActionFilter:
|
112
|
-
Description: Checks that methods specified in the filter's `only` or `except` options are
|
113
|
-
explicitly defined in the controller.
|
114
|
-
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#lexically-scoped-action-filter'
|
115
|
-
Enabled: false
|
116
|
-
|
117
|
-
Rails/NotNullColumn:
|
118
|
-
Enabled: false
|
119
|
-
|
120
|
-
Rails/Output:
|
121
|
-
Description: Checks for calls to puts, print, etc.
|
122
|
-
Enabled: false
|
123
|
-
Include:
|
124
|
-
- app/**/*.rb
|
125
|
-
- config/**/*.rb
|
126
|
-
- db/**/*.rb
|
127
|
-
- lib/**/*.rb
|
128
|
-
|
129
|
-
Rails/OutputSafety:
|
130
|
-
Description: 'The use of `html_safe` or `raw` may be a security risk.'
|
131
|
-
Enabled: false
|
132
|
-
|
133
|
-
# Supports --auto-correct
|
134
|
-
Rails/PluralizationGrammar:
|
135
|
-
Description: Checks for incorrect grammar when using methods like `3.day.ago`.
|
136
|
-
Enabled: false
|
137
|
-
|
138
|
-
Rails/Presence:
|
139
|
-
Description: Checks code that can be written more easily using `Object#presence` defined by
|
140
|
-
Active Support.
|
141
|
-
Enabled: false
|
142
|
-
|
143
|
-
Rails/Present:
|
144
|
-
Description: 'Enforce using `blank?` and `present?`.'
|
145
|
-
Enabled: true
|
146
|
-
NotNilAndNotEmpty: true
|
147
|
-
# Convert checks for not `nil` and not `empty?` to `present?`
|
148
|
-
NotBlank: true
|
149
|
-
# Convert usages of not `blank?` to `present?`
|
150
|
-
UnlessBlank: true
|
151
|
-
# Convert usages of `unless` `blank?` to `if` `present?`
|
152
|
-
|
153
|
-
# Supports --auto-correct
|
154
|
-
Rails/ReadWriteAttribute:
|
155
|
-
Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
|
156
|
-
Enabled: false
|
157
|
-
Include:
|
158
|
-
- app/models/**/*.rb
|
159
|
-
|
160
|
-
Rails/RedundantReceiverInWithOptions:
|
161
|
-
Description: 'Checks for redundant receiver in `with_options`.'
|
162
|
-
Enabled: true
|
163
|
-
|
164
|
-
Rails/RefuteMethods:
|
165
|
-
Enabled: false
|
166
|
-
|
167
|
-
Rails/RelativeDateConstant:
|
168
|
-
Enabled: false
|
169
|
-
|
170
|
-
Rails/RequestReferer:
|
171
|
-
Description: 'Use consistent syntax for request.referer.'
|
172
|
-
Enabled: false
|
173
|
-
|
174
|
-
Rails/ReversibleMigration:
|
175
|
-
Enabled: false
|
176
|
-
|
177
|
-
Rails/SafeNavigation:
|
178
|
-
Enabled: false
|
179
|
-
|
180
|
-
Rails/SaveBang:
|
181
|
-
Enabled: false
|
182
|
-
|
183
|
-
Rails/ScopeArgs:
|
184
|
-
Description: Checks the arguments of ActiveRecord scopes.
|
185
|
-
Enabled: true
|
186
|
-
Include:
|
187
|
-
- app/models/**/*.rb
|
188
|
-
|
189
|
-
Rails/SkipsModelValidations:
|
190
|
-
Enabled: false
|
191
|
-
|
192
|
-
Rails/TimeZone:
|
193
|
-
Description: Checks the correct usage of time zone aware methods.
|
194
|
-
StyleGuide: https://github.com/rubocop-hq/rails-style-guide#time
|
195
|
-
Reference: http://danilenko.org/2012/7/6/rails_timezones
|
196
|
-
Enabled: false
|
197
|
-
EnforcedStyle: flexible
|
198
|
-
SupportedStyles:
|
199
|
-
- strict
|
200
|
-
- flexible
|
201
|
-
|
202
|
-
Rails/UniqBeforePluck:
|
203
|
-
Enabled: false
|
204
|
-
|
205
|
-
Rails/UnknownEnv:
|
206
|
-
Enabled: false
|
207
|
-
|
208
|
-
Rails/Validation:
|
209
|
-
Description: Use validates :attribute, hash of validations.
|
210
|
-
Enabled: false
|
211
|
-
Include:
|
212
|
-
- app/models/**/*.rb
|
213
|
-
|
214
|
-
Rails/IgnoredSkipActionFilterOption:
|
215
|
-
Enabled: true
|
216
|
-
|
217
|
-
Rails/ReflectionClassName:
|
218
|
-
Enabled: true
|
219
|
-
|
220
|
-
Rails/RakeEnvironment:
|
221
|
-
Description: Ensures that rake tasks depend on :environment
|
222
|
-
Enabled: false
|
data/config/rubocop-rails.yml
DELETED
@@ -1,171 +0,0 @@
|
|
1
|
-
inherit_from:
|
2
|
-
# @see https://github.com/airbnb/ruby/blob/main/rubocop-airbnb/config/rubocop-rails.yml
|
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
|
157
|
-
|
158
|
-
Rails/DangerousColumnNames: # new in 2.21
|
159
|
-
Enabled: true
|
160
|
-
Rails/EnumSyntax: # new in 2.26
|
161
|
-
Enabled: true
|
162
|
-
Rails/EnvLocal: # new in 2.22
|
163
|
-
Enabled: true
|
164
|
-
Rails/RedundantActiveRecordAllMethod: # new in 2.21
|
165
|
-
Enabled: true
|
166
|
-
Rails/ThreeStateBooleanColumn: # new in 2.19
|
167
|
-
Enabled: true
|
168
|
-
Rails/UnusedRenderContent: # new in 2.21
|
169
|
-
Enabled: true
|
170
|
-
Rails/WhereRange: # new in 2.25
|
171
|
-
Enabled: true
|