gl_rubocop 0.6.0 → 0.7.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/default.yml +11 -11
- data/gl_rubocop.gemspec +12 -9
- data/lib/gl_rubocop/gl_cops/sidekiq_inherits_from_sidekiq_job.rb +1 -1
- data/lib/gl_rubocop/gl_cops/tailwind_no_contradicting_class_name.rb +3 -6
- data/lib/gl_rubocop/gl_cops/unique_identifier.rb +1 -1
- data/lib/gl_rubocop/gl_cops/view_component_class_naming.rb +4 -6
- data/lib/gl_rubocop/version.rb +1 -1
- metadata +68 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf30e57276cc5fb133db57872ab6fbe5a3d0192b4c35f9df35646f5d9b7c05a1
|
|
4
|
+
data.tar.gz: 27f959d4840ffecab6af0ffd59bf93c521a416b66e8bc42bcae01294ae09b2a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63e9e63133312891dbde83ab278c5e2339c236aaa68b06150a79c30964948a49ee7f3efa61ec9e693a9d7c416e3d8b1cbd83d5318c340a24e315ee992978cce9
|
|
7
|
+
data.tar.gz: 3c245249b4c1f8e1b83064c3fdee06cf142d60556f0774d419726743d154ab2692864916b0b02e77fceea66089f38f2f862abba9009adb1912a3eac8850eb8f5
|
data/default.yml
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
plugins:
|
|
2
2
|
- rubocop-performance
|
|
3
3
|
- rubocop-rails
|
|
4
4
|
- rubocop-rspec
|
|
5
|
-
- rubocop-
|
|
5
|
+
- rubocop-capybara
|
|
6
|
+
- rubocop-rspec_rails
|
|
7
|
+
- rubocop-factory_bot
|
|
6
8
|
- rubocop-erb
|
|
7
9
|
- rubocop-haml
|
|
8
10
|
- rubocop-i18n
|
|
9
11
|
- rubocop-rake
|
|
10
12
|
- rubocop-sorbet
|
|
13
|
+
|
|
14
|
+
require:
|
|
15
|
+
- rubocop-magic_numbers
|
|
11
16
|
- ./lib/gl_rubocop/gl_cops/callback_method_names.rb
|
|
12
17
|
- ./lib/gl_rubocop/gl_cops/consolidate_request_system_specs.rb
|
|
13
18
|
- ./lib/gl_rubocop/gl_cops/interactor_inherits_from_interactor_base.rb
|
|
@@ -55,10 +60,7 @@ AllCops:
|
|
|
55
60
|
- "vendor/**/*"
|
|
56
61
|
- "bin/**/*"
|
|
57
62
|
|
|
58
|
-
Capybara/
|
|
59
|
-
EnforcedStyle: link_or_button
|
|
60
|
-
|
|
61
|
-
Capybara/NegationMatcher:
|
|
63
|
+
Capybara/RSpec/NegationMatcher:
|
|
62
64
|
EnforcedStyle: not_to
|
|
63
65
|
|
|
64
66
|
GLCops/CallbackMethodNames:
|
|
@@ -325,11 +327,6 @@ RSpec/ExampleLength:
|
|
|
325
327
|
- "spec/serializers/**/*"
|
|
326
328
|
Max: 30
|
|
327
329
|
|
|
328
|
-
RSpec/FilePath:
|
|
329
|
-
Enabled: true
|
|
330
|
-
Exclude:
|
|
331
|
-
- "packs/*/spec/**/*" # Because of automatic namespacing
|
|
332
|
-
|
|
333
330
|
RSpec/HookArgument:
|
|
334
331
|
Exclude:
|
|
335
332
|
- "spec/support/**/*"
|
|
@@ -434,6 +431,9 @@ Sorbet/AllowIncompatibleOverride:
|
|
|
434
431
|
Sorbet/BindingConstantWithoutTypeAlias:
|
|
435
432
|
Enabled: false
|
|
436
433
|
|
|
434
|
+
Sorbet/BlockMethodDefinition:
|
|
435
|
+
Enabled: false
|
|
436
|
+
|
|
437
437
|
Sorbet/BuggyObsoleteStrictMemoization:
|
|
438
438
|
Enabled: false
|
|
439
439
|
|
data/gl_rubocop.gemspec
CHANGED
|
@@ -23,16 +23,19 @@ Gem::Specification.new do |spec|
|
|
|
23
23
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
24
24
|
spec.require_paths = ['lib']
|
|
25
25
|
|
|
26
|
-
spec.add_dependency 'rubocop', '~> 1.
|
|
27
|
-
spec.add_dependency 'rubocop-
|
|
28
|
-
spec.add_dependency 'rubocop-
|
|
29
|
-
spec.add_dependency 'rubocop-
|
|
26
|
+
spec.add_dependency 'rubocop', '~> 1.90'
|
|
27
|
+
spec.add_dependency 'rubocop-capybara', '>= 2.23'
|
|
28
|
+
spec.add_dependency 'rubocop-erb', '>= 0.6'
|
|
29
|
+
spec.add_dependency 'rubocop-factory_bot', '>= 2.27'
|
|
30
|
+
spec.add_dependency 'rubocop-haml', '>= 0.3'
|
|
31
|
+
spec.add_dependency 'rubocop-i18n', '>= 3.2'
|
|
30
32
|
spec.add_dependency 'rubocop-magic_numbers'
|
|
31
|
-
spec.add_dependency 'rubocop-performance'
|
|
32
|
-
spec.add_dependency 'rubocop-rails'
|
|
33
|
-
spec.add_dependency 'rubocop-rake'
|
|
34
|
-
spec.add_dependency 'rubocop-rspec', '~>
|
|
35
|
-
spec.add_dependency 'rubocop-
|
|
33
|
+
spec.add_dependency 'rubocop-performance', '>= 1.24'
|
|
34
|
+
spec.add_dependency 'rubocop-rails', '>= 2.30'
|
|
35
|
+
spec.add_dependency 'rubocop-rake', '>= 0.7'
|
|
36
|
+
spec.add_dependency 'rubocop-rspec', '~> 3.5'
|
|
37
|
+
spec.add_dependency 'rubocop-rspec_rails', '>= 2.31'
|
|
38
|
+
spec.add_dependency 'rubocop-sorbet', '>= 0.9'
|
|
36
39
|
|
|
37
40
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
38
41
|
end
|
|
@@ -5,7 +5,7 @@ module GLRubocop
|
|
|
5
5
|
|
|
6
6
|
def on_class(klass)
|
|
7
7
|
return unless klass.instance_of?(RuboCop::AST::ClassNode)
|
|
8
|
-
return if klass.parent_class
|
|
8
|
+
return if klass.parent_class || klass.identifier.short_name == :SidekiqJob
|
|
9
9
|
|
|
10
10
|
add_offense(klass)
|
|
11
11
|
end
|
|
@@ -19,7 +19,7 @@ module GLRubocop
|
|
|
19
19
|
# tw:h-5
|
|
20
20
|
# %button.tw:m-4.tw:p-8
|
|
21
21
|
|
|
22
|
-
# rubocop:disable Metrics/ClassLength
|
|
22
|
+
# rubocop:disable-next Metrics/ClassLength
|
|
23
23
|
class TailwindNoContradictingClassName < RuboCop::Cop::Cop
|
|
24
24
|
include GLRubocop::HamlContentHelper
|
|
25
25
|
include GLRubocop::ErbContentHelper
|
|
@@ -240,7 +240,7 @@ module GLRubocop
|
|
|
240
240
|
class_name.start_with?(GIVELIVELY_TAILWIND_CLASS_PREFIX)
|
|
241
241
|
end
|
|
242
242
|
|
|
243
|
-
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
|
243
|
+
# rubocop:disable-next Metrics/AbcSize, Metrics/MethodLength
|
|
244
244
|
def find_contradicting_classes(classes)
|
|
245
245
|
# Remove the 'tw:' prefix for property matching
|
|
246
246
|
normalized_classes = classes.map { |class_name| class_name.sub(matcher, '') }
|
|
@@ -267,7 +267,6 @@ module GLRubocop
|
|
|
267
267
|
|
|
268
268
|
contradictions
|
|
269
269
|
end
|
|
270
|
-
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
|
271
270
|
|
|
272
271
|
def contradiction_found?(first_class_data, second_class_data)
|
|
273
272
|
breakpoint_ranges_overlap?(first_class_data[:breakpoint_range],
|
|
@@ -310,7 +309,7 @@ module GLRubocop
|
|
|
310
309
|
property && CONTRADICTION_GROUPS.any? { |_, group| group.include?(property) }
|
|
311
310
|
end
|
|
312
311
|
|
|
313
|
-
# rubocop:disable Metrics/MethodLength
|
|
312
|
+
# rubocop:disable-next Metrics/MethodLength
|
|
314
313
|
def extract_css_property(class_name)
|
|
315
314
|
# Remove container query prefix (e.g., @md:)
|
|
316
315
|
class_without_container = class_name.sub(/^@([a-zA-Z0-9_-]+):/, '')
|
|
@@ -363,7 +362,6 @@ module GLRubocop
|
|
|
363
362
|
|
|
364
363
|
nil
|
|
365
364
|
end
|
|
366
|
-
# rubocop:enable Metrics/MethodLength
|
|
367
365
|
|
|
368
366
|
def extract_breakpoint_range(class_name)
|
|
369
367
|
# Extract breakpoint range (e.g., 'md', 'lg:max-xl', 'sm:max-md')
|
|
@@ -418,6 +416,5 @@ module GLRubocop
|
|
|
418
416
|
first_prop_group.intersect?(second_prop_group)
|
|
419
417
|
end
|
|
420
418
|
end
|
|
421
|
-
# rubocop:enable Metrics/ClassLength
|
|
422
419
|
end
|
|
423
420
|
end
|
|
@@ -20,16 +20,14 @@ module GLRubocop
|
|
|
20
20
|
def on_class(node)
|
|
21
21
|
parent_class = node.parent_class&.const_name
|
|
22
22
|
if parent_class == 'ApplicationViewComponent'
|
|
23
|
-
return
|
|
23
|
+
return if node.identifier.const_name == 'Component'
|
|
24
24
|
|
|
25
25
|
add_offense(node, message: 'ViewComponent class names must be "Component".')
|
|
26
26
|
end
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
return unless parent_class == 'ApplicationViewComponentPreview'
|
|
28
|
+
return if node.identifier.const_name == 'ComponentPreview'
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
end
|
|
32
|
-
true
|
|
30
|
+
add_offense(node, message: 'ViewComponentPreview class names must be "ComponentPreview".')
|
|
33
31
|
end
|
|
34
32
|
end
|
|
35
33
|
end
|
data/lib/gl_rubocop/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gl_rubocop
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Give Lively
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-11-05 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: rubocop
|
|
@@ -15,56 +16,84 @@ dependencies:
|
|
|
15
16
|
requirements:
|
|
16
17
|
- - "~>"
|
|
17
18
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 1.
|
|
19
|
+
version: '1.90'
|
|
19
20
|
type: :runtime
|
|
20
21
|
prerelease: false
|
|
21
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
23
|
requirements:
|
|
23
24
|
- - "~>"
|
|
24
25
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 1.
|
|
26
|
+
version: '1.90'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rubocop-capybara
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '2.23'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '2.23'
|
|
26
41
|
- !ruby/object:Gem::Dependency
|
|
27
42
|
name: rubocop-erb
|
|
28
43
|
requirement: !ruby/object:Gem::Requirement
|
|
29
44
|
requirements:
|
|
30
45
|
- - ">="
|
|
31
46
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '0'
|
|
47
|
+
version: '0.6'
|
|
33
48
|
type: :runtime
|
|
34
49
|
prerelease: false
|
|
35
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
51
|
requirements:
|
|
37
52
|
- - ">="
|
|
38
53
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '0'
|
|
54
|
+
version: '0.6'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rubocop-factory_bot
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '2.27'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '2.27'
|
|
40
69
|
- !ruby/object:Gem::Dependency
|
|
41
70
|
name: rubocop-haml
|
|
42
71
|
requirement: !ruby/object:Gem::Requirement
|
|
43
72
|
requirements:
|
|
44
73
|
- - ">="
|
|
45
74
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '0'
|
|
75
|
+
version: '0.3'
|
|
47
76
|
type: :runtime
|
|
48
77
|
prerelease: false
|
|
49
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
79
|
requirements:
|
|
51
80
|
- - ">="
|
|
52
81
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '0'
|
|
82
|
+
version: '0.3'
|
|
54
83
|
- !ruby/object:Gem::Dependency
|
|
55
84
|
name: rubocop-i18n
|
|
56
85
|
requirement: !ruby/object:Gem::Requirement
|
|
57
86
|
requirements:
|
|
58
87
|
- - ">="
|
|
59
88
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '
|
|
89
|
+
version: '3.2'
|
|
61
90
|
type: :runtime
|
|
62
91
|
prerelease: false
|
|
63
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
93
|
requirements:
|
|
65
94
|
- - ">="
|
|
66
95
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: '
|
|
96
|
+
version: '3.2'
|
|
68
97
|
- !ruby/object:Gem::Dependency
|
|
69
98
|
name: rubocop-magic_numbers
|
|
70
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -85,70 +114,86 @@ dependencies:
|
|
|
85
114
|
requirements:
|
|
86
115
|
- - ">="
|
|
87
116
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '
|
|
117
|
+
version: '1.24'
|
|
89
118
|
type: :runtime
|
|
90
119
|
prerelease: false
|
|
91
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
121
|
requirements:
|
|
93
122
|
- - ">="
|
|
94
123
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '
|
|
124
|
+
version: '1.24'
|
|
96
125
|
- !ruby/object:Gem::Dependency
|
|
97
126
|
name: rubocop-rails
|
|
98
127
|
requirement: !ruby/object:Gem::Requirement
|
|
99
128
|
requirements:
|
|
100
129
|
- - ">="
|
|
101
130
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '
|
|
131
|
+
version: '2.30'
|
|
103
132
|
type: :runtime
|
|
104
133
|
prerelease: false
|
|
105
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
106
135
|
requirements:
|
|
107
136
|
- - ">="
|
|
108
137
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: '
|
|
138
|
+
version: '2.30'
|
|
110
139
|
- !ruby/object:Gem::Dependency
|
|
111
140
|
name: rubocop-rake
|
|
112
141
|
requirement: !ruby/object:Gem::Requirement
|
|
113
142
|
requirements:
|
|
114
143
|
- - ">="
|
|
115
144
|
- !ruby/object:Gem::Version
|
|
116
|
-
version: '0'
|
|
145
|
+
version: '0.7'
|
|
117
146
|
type: :runtime
|
|
118
147
|
prerelease: false
|
|
119
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
120
149
|
requirements:
|
|
121
150
|
- - ">="
|
|
122
151
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: '0'
|
|
152
|
+
version: '0.7'
|
|
124
153
|
- !ruby/object:Gem::Dependency
|
|
125
154
|
name: rubocop-rspec
|
|
126
155
|
requirement: !ruby/object:Gem::Requirement
|
|
127
156
|
requirements:
|
|
128
157
|
- - "~>"
|
|
129
158
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: '
|
|
159
|
+
version: '3.5'
|
|
131
160
|
type: :runtime
|
|
132
161
|
prerelease: false
|
|
133
162
|
version_requirements: !ruby/object:Gem::Requirement
|
|
134
163
|
requirements:
|
|
135
164
|
- - "~>"
|
|
136
165
|
- !ruby/object:Gem::Version
|
|
137
|
-
version: '
|
|
166
|
+
version: '3.5'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: rubocop-rspec_rails
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - ">="
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '2.31'
|
|
174
|
+
type: :runtime
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - ">="
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: '2.31'
|
|
138
181
|
- !ruby/object:Gem::Dependency
|
|
139
182
|
name: rubocop-sorbet
|
|
140
183
|
requirement: !ruby/object:Gem::Requirement
|
|
141
184
|
requirements:
|
|
142
185
|
- - ">="
|
|
143
186
|
- !ruby/object:Gem::Version
|
|
144
|
-
version: '0'
|
|
187
|
+
version: '0.9'
|
|
145
188
|
type: :runtime
|
|
146
189
|
prerelease: false
|
|
147
190
|
version_requirements: !ruby/object:Gem::Requirement
|
|
148
191
|
requirements:
|
|
149
192
|
- - ">="
|
|
150
193
|
- !ruby/object:Gem::Version
|
|
151
|
-
version: '0'
|
|
194
|
+
version: '0.9'
|
|
195
|
+
description:
|
|
196
|
+
email:
|
|
152
197
|
executables: []
|
|
153
198
|
extensions: []
|
|
154
199
|
extra_rdoc_files:
|
|
@@ -193,6 +238,7 @@ licenses:
|
|
|
193
238
|
- MIT
|
|
194
239
|
metadata:
|
|
195
240
|
rubygems_mfa_required: 'true'
|
|
241
|
+
post_install_message:
|
|
196
242
|
rdoc_options: []
|
|
197
243
|
require_paths:
|
|
198
244
|
- lib
|
|
@@ -207,7 +253,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
207
253
|
- !ruby/object:Gem::Version
|
|
208
254
|
version: '0'
|
|
209
255
|
requirements: []
|
|
210
|
-
rubygems_version: 4.
|
|
256
|
+
rubygems_version: 3.4.19
|
|
257
|
+
signing_key:
|
|
211
258
|
specification_version: 4
|
|
212
259
|
summary: A shareable configuration of Give Lively's rubocop rules.
|
|
213
260
|
test_files: []
|