gitlab-styles 10.1.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/Gemfile.lock +32 -26
- data/README.md +2 -1
- data/gitlab-styles.gemspec +2 -2
- data/lib/gitlab/styles/version.rb +1 -1
- data/lib/rubocop/cop/rspec/specify_expected.rb +49 -0
- data/rubocop-gemspec.yml +15 -4
- data/rubocop-rails.yml +5 -0
- data/rubocop-rspec.yml +13 -1
- data/rubocop-style.yml +14 -6
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeba900b1e2b7dc4f6a82fa6defd2daaf2b4c6c87101e1d4fd8b2099e1c00aff
|
4
|
+
data.tar.gz: 02c28507a2a0ed18e555b9d2e44fde520e41de6cccd0e7b77a36b9452b651531
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ba653a6135f6cd2cb62268e6ee7df569827c3e6958763acb0d8b1d263192fbcf5634168266c60c13df05cd8635e9ca65560965a19ad2fb2a1816a6982cfefb6
|
7
|
+
data.tar.gz: 5da95736858e333062c060a33069a248e4b15824fd0d6c759a2c223e3c772a164534c9c2741760dd17d65eee67f98e1b0909d2f4199d96081e16de91967b8f69
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gitlab-styles (
|
5
|
-
rubocop (~> 1.
|
4
|
+
gitlab-styles (11.0.0)
|
5
|
+
rubocop (~> 1.57.1)
|
6
6
|
rubocop-graphql (~> 0.18)
|
7
7
|
rubocop-performance (~> 1.15)
|
8
8
|
rubocop-rails (~> 2.17)
|
@@ -16,9 +16,10 @@ GEM
|
|
16
16
|
i18n (>= 1.6, < 2)
|
17
17
|
minitest (>= 5.1)
|
18
18
|
tzinfo (~> 2.0)
|
19
|
-
addressable (2.8.
|
19
|
+
addressable (2.8.5)
|
20
20
|
public_suffix (>= 2.0.2, < 6.0)
|
21
21
|
ast (2.4.2)
|
22
|
+
base64 (0.1.1)
|
22
23
|
binding_of_caller (1.0.0)
|
23
24
|
debug_inspector (>= 0.0.1)
|
24
25
|
byebug (11.1.3)
|
@@ -32,18 +33,18 @@ GEM
|
|
32
33
|
concurrent-ruby (1.2.2)
|
33
34
|
cork (0.3.0)
|
34
35
|
colored2 (~> 3.1)
|
35
|
-
danger (9.3.
|
36
|
+
danger (9.3.2)
|
36
37
|
claide (~> 1.0)
|
37
38
|
claide-plugins (>= 0.9.2)
|
38
39
|
colored2 (~> 3.1)
|
39
40
|
cork (~> 0.1)
|
40
41
|
faraday (>= 0.9.0, < 3.0)
|
41
42
|
faraday-http-cache (~> 2.0)
|
42
|
-
git (~> 1.13
|
43
|
+
git (~> 1.13)
|
43
44
|
kramdown (~> 2.3)
|
44
45
|
kramdown-parser-gfm (~> 1.0)
|
45
46
|
no_proxy_fix
|
46
|
-
octokit (~>
|
47
|
+
octokit (~> 6.0)
|
47
48
|
terminal-table (>= 1, < 4)
|
48
49
|
danger-gitlab (8.0.0)
|
49
50
|
danger
|
@@ -76,16 +77,16 @@ GEM
|
|
76
77
|
faraday-patron (1.0.0)
|
77
78
|
faraday-rack (1.0.0)
|
78
79
|
faraday-retry (1.0.3)
|
79
|
-
git (1.
|
80
|
+
git (1.18.0)
|
80
81
|
addressable (~> 2.8)
|
81
82
|
rchardet (~> 1.8)
|
82
83
|
gitlab (4.19.0)
|
83
84
|
httparty (~> 0.20)
|
84
85
|
terminal-table (>= 1.5.1)
|
85
|
-
gitlab-dangerfiles (
|
86
|
-
danger (>=
|
86
|
+
gitlab-dangerfiles (4.6.0)
|
87
|
+
danger (>= 9.3.0)
|
87
88
|
danger-gitlab (>= 8.0.0)
|
88
|
-
rake
|
89
|
+
rake (~> 13.0)
|
89
90
|
httparty (0.21.0)
|
90
91
|
mini_mime (>= 1.0.0)
|
91
92
|
multi_xml (>= 0.5.2)
|
@@ -96,21 +97,23 @@ GEM
|
|
96
97
|
rexml
|
97
98
|
kramdown-parser-gfm (1.1.0)
|
98
99
|
kramdown (~> 2.0)
|
100
|
+
language_server-protocol (3.17.0.3)
|
99
101
|
lefthook (1.3.13)
|
100
102
|
method_source (1.0.0)
|
101
|
-
mini_mime (1.1.
|
103
|
+
mini_mime (1.1.5)
|
102
104
|
minitest (5.18.0)
|
103
105
|
multi_xml (0.6.0)
|
104
106
|
multipart-post (2.3.0)
|
105
107
|
nap (1.1.0)
|
106
108
|
no_proxy_fix (0.1.2)
|
107
|
-
octokit (
|
109
|
+
octokit (6.1.1)
|
108
110
|
faraday (>= 1, < 3)
|
109
111
|
sawyer (~> 0.9)
|
110
112
|
open4 (1.3.4)
|
111
113
|
parallel (1.23.0)
|
112
|
-
parser (3.2.2.
|
114
|
+
parser (3.2.2.4)
|
113
115
|
ast (~> 2.4.1)
|
116
|
+
racc
|
114
117
|
proc_to_ast (0.1.0)
|
115
118
|
coderay
|
116
119
|
parser
|
@@ -121,13 +124,14 @@ GEM
|
|
121
124
|
pry-byebug (3.10.1)
|
122
125
|
byebug (~> 11.0)
|
123
126
|
pry (>= 0.13, < 0.15)
|
124
|
-
public_suffix (5.0.
|
127
|
+
public_suffix (5.0.3)
|
128
|
+
racc (1.7.1)
|
125
129
|
rack (3.0.7)
|
126
130
|
rainbow (3.1.1)
|
127
131
|
rake (13.0.6)
|
128
132
|
rchardet (1.8.0)
|
129
|
-
regexp_parser (2.8.
|
130
|
-
rexml (3.2.
|
133
|
+
regexp_parser (2.8.1)
|
134
|
+
rexml (3.2.6)
|
131
135
|
rspec (3.12.0)
|
132
136
|
rspec-core (~> 3.12.0)
|
133
137
|
rspec-expectations (~> 3.12.0)
|
@@ -149,25 +153,27 @@ GEM
|
|
149
153
|
binding_of_caller
|
150
154
|
rspec-parameterized-core (< 2)
|
151
155
|
rspec-support (3.12.0)
|
152
|
-
rubocop (1.
|
156
|
+
rubocop (1.57.1)
|
157
|
+
base64 (~> 0.1.1)
|
153
158
|
json (~> 2.3)
|
159
|
+
language_server-protocol (>= 3.17.0)
|
154
160
|
parallel (~> 1.10)
|
155
|
-
parser (>= 3.2.
|
161
|
+
parser (>= 3.2.2.4)
|
156
162
|
rainbow (>= 2.2.2, < 4.0)
|
157
163
|
regexp_parser (>= 1.8, < 3.0)
|
158
164
|
rexml (>= 3.2.5, < 4.0)
|
159
|
-
rubocop-ast (>= 1.28.
|
165
|
+
rubocop-ast (>= 1.28.1, < 2.0)
|
160
166
|
ruby-progressbar (~> 1.7)
|
161
167
|
unicode-display_width (>= 2.4.0, < 3.0)
|
162
|
-
rubocop-ast (1.
|
168
|
+
rubocop-ast (1.29.0)
|
163
169
|
parser (>= 3.2.1.0)
|
164
|
-
rubocop-capybara (2.
|
170
|
+
rubocop-capybara (2.19.0)
|
165
171
|
rubocop (~> 1.41)
|
166
|
-
rubocop-factory_bot (2.
|
172
|
+
rubocop-factory_bot (2.24.0)
|
167
173
|
rubocop (~> 1.33)
|
168
174
|
rubocop-graphql (0.19.0)
|
169
175
|
rubocop (>= 0.87, < 2)
|
170
|
-
rubocop-performance (1.
|
176
|
+
rubocop-performance (1.19.1)
|
171
177
|
rubocop (>= 1.7.0, < 2.0)
|
172
178
|
rubocop-ast (>= 0.4.0)
|
173
179
|
rubocop-rails (2.19.1)
|
@@ -176,7 +182,7 @@ GEM
|
|
176
182
|
rubocop (>= 1.33.0, < 2.0)
|
177
183
|
rubocop-rake (0.6.0)
|
178
184
|
rubocop (~> 1.0)
|
179
|
-
rubocop-rspec (2.
|
185
|
+
rubocop-rspec (2.24.1)
|
180
186
|
rubocop (~> 1.33)
|
181
187
|
rubocop-capybara (~> 2.17)
|
182
188
|
rubocop-factory_bot (~> 2.22)
|
@@ -200,7 +206,7 @@ GEM
|
|
200
206
|
faraday (~> 1.0)
|
201
207
|
tzinfo (2.0.6)
|
202
208
|
concurrent-ruby (~> 1.0)
|
203
|
-
unicode-display_width (2.
|
209
|
+
unicode-display_width (2.5.0)
|
204
210
|
unparser (0.6.7)
|
205
211
|
diff-lcs (~> 1.3)
|
206
212
|
parser (>= 3.2.0)
|
@@ -210,7 +216,7 @@ PLATFORMS
|
|
210
216
|
|
211
217
|
DEPENDENCIES
|
212
218
|
bundler (~> 2.1)
|
213
|
-
gitlab-dangerfiles (~>
|
219
|
+
gitlab-dangerfiles (~> 4.6.0)
|
214
220
|
gitlab-styles!
|
215
221
|
lefthook (~> 1.3.13)
|
216
222
|
pry-byebug (~> 3.10)
|
data/README.md
CHANGED
@@ -91,7 +91,8 @@ To release a new version:
|
|
91
91
|
1. Create a Merge Request.
|
92
92
|
1. Use Merge Request template [Release.md](https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles/-/blob/master/.gitlab/merge_request_templates/Release.md).
|
93
93
|
1. Follow the instructions.
|
94
|
-
1. After the Merge Request has been merged, a new gem version is [published automatically](https://gitlab.com/gitlab-org/quality/pipeline-common/-/blob/master/ci/gem-release.yml)
|
94
|
+
1. After the Merge Request has been merged, a new gem version is [published automatically](https://gitlab.com/gitlab-org/quality/pipeline-common/-/blob/master/ci/gem-release.yml).
|
95
|
+
1. Once the new gem version is visible on [RubyGems.org](https://rubygems.org/gems/gitlab-styles), it is recommended to update [GitLab's `Gemfile`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/Gemfile) to bump the `gitlab-styles` Ruby gem to the new version also.
|
95
96
|
|
96
97
|
See [!123](https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles/-/merge_requests/123) as an example.
|
97
98
|
|
data/gitlab-styles.gemspec
CHANGED
@@ -22,14 +22,14 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
|
-
spec.add_dependency 'rubocop', '~> 1.
|
25
|
+
spec.add_dependency 'rubocop', '~> 1.57.1'
|
26
26
|
spec.add_dependency 'rubocop-graphql', '~> 0.18'
|
27
27
|
spec.add_dependency 'rubocop-performance', '~> 1.15'
|
28
28
|
spec.add_dependency 'rubocop-rails', '~> 2.17'
|
29
29
|
spec.add_dependency 'rubocop-rspec', '~> 2.22'
|
30
30
|
|
31
31
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
32
|
-
spec.add_development_dependency 'gitlab-dangerfiles', '~>
|
32
|
+
spec.add_development_dependency 'gitlab-dangerfiles', '~> 4.6.0'
|
33
33
|
spec.add_development_dependency 'lefthook', '~> 1.3.13'
|
34
34
|
spec.add_development_dependency 'pry-byebug', '~> 3.10'
|
35
35
|
spec.add_development_dependency 'rake', '~> 13.0'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rubocop-rspec'
|
4
|
+
require_relative 'base'
|
5
|
+
|
6
|
+
module Rubocop
|
7
|
+
module Cop
|
8
|
+
module RSpec
|
9
|
+
# Checks whether `specify` is used with `is_expected` and suggests the
|
10
|
+
# use of `it`.
|
11
|
+
#
|
12
|
+
# @example
|
13
|
+
#
|
14
|
+
# # bad
|
15
|
+
# specify { is_expected.to eq(true) }
|
16
|
+
#
|
17
|
+
# # good
|
18
|
+
# it { is_expected.to eq(true) }
|
19
|
+
#
|
20
|
+
class SpecifyExpected < Base
|
21
|
+
extend RuboCop::Cop::AutoCorrector
|
22
|
+
|
23
|
+
MSG = 'Prefer using `it` when used with `is_expected`.'
|
24
|
+
|
25
|
+
# @!method specify_with_expected?(node)
|
26
|
+
def_node_matcher :specify_with_expected?, <<~PATTERN
|
27
|
+
(block
|
28
|
+
(send nil? :specify ...)
|
29
|
+
_args
|
30
|
+
(send
|
31
|
+
(send nil? :is_expected)
|
32
|
+
...
|
33
|
+
)
|
34
|
+
)
|
35
|
+
PATTERN
|
36
|
+
|
37
|
+
RESTRICT_ON_SEND = %i[specify].freeze
|
38
|
+
|
39
|
+
def on_send(node)
|
40
|
+
return unless specify_with_expected?(node.parent)
|
41
|
+
|
42
|
+
add_offense(node) do |corrector|
|
43
|
+
corrector.replace(node, 'it')
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
data/rubocop-gemspec.yml
CHANGED
@@ -1,12 +1,23 @@
|
|
1
1
|
---
|
2
|
+
# Checks that deprecated attributes are not set in a gemspec file. Removing
|
3
|
+
# deprecated attributes allows the user to receive smaller packed gems.
|
4
|
+
Gemspec/DeprecatedAttributeAssignment:
|
5
|
+
Enabled: true
|
6
|
+
|
7
|
+
# Enforce that development dependencies for a gem are specified in Gemfile,
|
8
|
+
# rather than in the gemspec using add_development_dependency
|
9
|
+
# Reason: Each project may decide to use a different strategy.
|
10
|
+
Gemspec/DevelopmentDependencies:
|
11
|
+
Enabled: false
|
12
|
+
|
2
13
|
# Dependencies in the gemspec should be alphabetically sorted
|
3
14
|
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
|
4
15
|
Gemspec/OrderedDependencies:
|
5
16
|
Include:
|
6
17
|
- '**/*.gemspec'
|
7
18
|
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
Gemspec/
|
19
|
+
# Requires a gemspec to have rubygems_mfa_required metadata set.
|
20
|
+
# Most gems are released via CI and MFA cannot be used with improved security.
|
21
|
+
# See https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage/-/merge_requests/313#note_1605402392
|
22
|
+
Gemspec/RequireMFA:
|
12
23
|
Enabled: false
|
data/rubocop-rails.yml
CHANGED
@@ -178,6 +178,11 @@ Rails/RenderInline:
|
|
178
178
|
Rails/RenderPlainText:
|
179
179
|
Enabled: true
|
180
180
|
|
181
|
+
# Checks for the usage of obsolete `require_dependency` method for Rails
|
182
|
+
# applications running in Zeitwerk mode.
|
183
|
+
Rails/RequireDependency:
|
184
|
+
Enabled: true
|
185
|
+
|
181
186
|
# Checks the arguments of ActiveRecord scopes.
|
182
187
|
Rails/ScopeArgs:
|
183
188
|
Enabled: true
|
data/rubocop-rspec.yml
CHANGED
@@ -83,6 +83,7 @@ RSpec/ExpectOutput:
|
|
83
83
|
Enabled: true
|
84
84
|
|
85
85
|
# Checks the file and folder naming of the spec file.
|
86
|
+
# Will be replaced with RSpec/SpecFilePathFormat and RSpec/SpecFilePathSuffix.
|
86
87
|
RSpec/FilePath:
|
87
88
|
Enabled: true
|
88
89
|
IgnoreMethods: true
|
@@ -137,7 +138,7 @@ RSpec/MultipleExpectations:
|
|
137
138
|
|
138
139
|
# Checks for explicitly referenced test subjects.
|
139
140
|
RSpec/NamedSubject:
|
140
|
-
Enabled:
|
141
|
+
Enabled: true
|
141
142
|
|
142
143
|
# Checks for nested example groups.
|
143
144
|
RSpec/NestedGroups:
|
@@ -163,6 +164,17 @@ RSpec/SingleLineHook:
|
|
163
164
|
- 'spec/factories/*'
|
164
165
|
- 'spec/requests/api/v3/*'
|
165
166
|
|
167
|
+
# Checks the file and folder naming of the spec file.
|
168
|
+
# Will replace RSpec/FilePath.
|
169
|
+
RSpec/SpecFilePathFormat:
|
170
|
+
Enabled: false
|
171
|
+
IgnoreMethods: true
|
172
|
+
|
173
|
+
# Checks the file and folder naming of the spec file.
|
174
|
+
# Will replace RSpec/FilePath.
|
175
|
+
RSpec/SpecFilePathSuffix:
|
176
|
+
Enabled: false
|
177
|
+
|
166
178
|
# Checks that message expectations do not have a configured response.
|
167
179
|
# https://docs.rubocop.org/rubocop-rspec/1.44/cops_rspec.html#rspecstubbedmock
|
168
180
|
RSpec/StubbedMock:
|
data/rubocop-style.yml
CHANGED
@@ -52,10 +52,14 @@ Style/BisectedAttrAccessor:
|
|
52
52
|
Style/BlockComments:
|
53
53
|
Enabled: true
|
54
54
|
|
55
|
-
# Avoid using {...} for multi-line blocks (
|
56
|
-
#
|
55
|
+
# Avoid using {...} for multi-line blocks (multi-line chaining is always ugly).
|
56
|
+
# Prefer {...} over do...end for single-line blocks.
|
57
57
|
Style/BlockDelimiters:
|
58
58
|
Enabled: true
|
59
|
+
# Do flag `it {` in multi-line blocks. Off by default.
|
60
|
+
AllowedMethods:
|
61
|
+
- proc
|
62
|
+
- lambda
|
59
63
|
|
60
64
|
# Checks for uses of the case equality operator(===).
|
61
65
|
Style/CaseEquality:
|
@@ -127,11 +131,10 @@ Style/EndBlock:
|
|
127
131
|
Style/EvenOdd:
|
128
132
|
Enabled: true
|
129
133
|
|
130
|
-
#
|
131
|
-
#
|
132
|
-
# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleexplicitblockargument
|
134
|
+
# Reason: Using `yield` is ~20% faster than `&block`.
|
135
|
+
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/94090#note_1452639709
|
133
136
|
Style/ExplicitBlockArgument:
|
134
|
-
Enabled:
|
137
|
+
Enabled: false
|
135
138
|
|
136
139
|
# Enforces consistency when using exponential notation for numbers in the code
|
137
140
|
Style/ExponentialNotation:
|
@@ -308,6 +311,11 @@ Style/NumberedParametersLimit:
|
|
308
311
|
Style/NumericLiterals:
|
309
312
|
Enabled: false
|
310
313
|
|
314
|
+
|
315
|
+
# Enforces the use Object#then instead of Object#yield_self.
|
316
|
+
Style/ObjectThen:
|
317
|
+
Enabled: true
|
318
|
+
|
311
319
|
# Favor the ternary operator(?:) over if/then/else/end constructs.
|
312
320
|
Style/OneLineConditional:
|
313
321
|
Enabled: true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-styles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 11.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.57.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.57.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubocop-graphql
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 4.6.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 4.6.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: lefthook
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -316,6 +316,7 @@ files:
|
|
316
316
|
- lib/rubocop/cop/rspec/factory_bot/excessive_create_list.rb
|
317
317
|
- lib/rubocop/cop/rspec/have_link_parameters.rb
|
318
318
|
- lib/rubocop/cop/rspec/single_line_hook.rb
|
319
|
+
- lib/rubocop/cop/rspec/specify_expected.rb
|
319
320
|
- lib/rubocop/cop/rspec/useless_dynamic_definition.rb
|
320
321
|
- lib/rubocop/cop/rspec/verbose_include_metadata.rb
|
321
322
|
- lib/rubocop/cop/style/hash_transformation.rb
|