gitlab-styles 13.1.0 → 14.0.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/.gitlab/merge_request_templates/New Static Analysis Check.md +26 -0
- data/.gitlab-ci.yml +1 -1
- data/.rubocop_todo.yml +2 -10
- data/Gemfile.lock +22 -18
- data/README.md +13 -0
- data/gitlab-styles.gemspec +8 -8
- data/lib/gitlab/styles/version.rb +1 -1
- data/lib/rubocop/cop/avoid_return_from_blocks.rb +1 -2
- data/lib/rubocop/cop/fips/md5.rb +10 -0
- data/lib/rubocop/cop/fips/open_ssl.rb +11 -0
- data/lib/rubocop/cop/fips/sha1.rb +8 -0
- data/lib/rubocop/cop/gem_fetcher.rb +6 -0
- data/lib/rubocop/cop/in_batches.rb +8 -0
- data/lib/rubocop/cop/internal_affairs/cop_description_with_example.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/deprecate_cop_helper.rb +12 -0
- data/lib/rubocop/cop/line_break_around_conditional_block.rb +1 -1
- data/lib/rubocop/cop/performance/rubyzip.rb +6 -0
- data/lib/rubocop/cop/polymorphic_associations.rb +11 -0
- data/lib/rubocop/cop/tailwind/max_width_media_queries.rb +2 -1
- data/rubocop-naming.yml +1 -1
- data/rubocop-style.yml +4 -0
- metadata +25 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2e07aeadc05dafb796aaa44e43f0f0e7c53344048756b9d402a81949f71d14c2
|
|
4
|
+
data.tar.gz: 90b4af4c628cc78a537907563f14068a2d18f8eff3199db32a3434c8adb12f04
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c237f8409677ebffef96022175af2604d4e14472df266f4cc00112a2f44e4b374537326540eb5786573dd6680b4215e126500bc4373af3bc01d5c40957ca68ec
|
|
7
|
+
data.tar.gz: be9a4aa227f7913295c98b2445e3f4108cd42f17ee5b81f12416f3b2e31c273b153980d6bb45c54c1d51eb3dff4c6a16c6bcac51ea96a1bfaea198d6820c9760
|
|
@@ -11,11 +11,37 @@ Please describe the proposal and add a link to the source (for example, http://w
|
|
|
11
11
|
- CHOICE_A: :a:
|
|
12
12
|
- CHOICE_B: :b:
|
|
13
13
|
- Vote yourself for both choices so that people know these are the choices
|
|
14
|
+
- [ ] Provide the impact of the proposal on `gitlab-org/gitlab`
|
|
14
15
|
- [ ] The MR doesn't have significant objections, and is getting a majority of :+1: vs :-1: (remember that [we don't need to reach a consensus](https://about.gitlab.com/handbook/values/#collaboration-is-not-consensus))
|
|
15
16
|
- [ ] (If applicable) One style is getting a majority of vote (compared to the other choice)
|
|
16
17
|
- [ ] (If applicable) Update the MR with the chosen style
|
|
17
18
|
- [ ] Follow the [review process](https://docs.gitlab.com/ee/development/code_review.html) as usual
|
|
18
19
|
|
|
20
|
+
### Impact on gitlab-org/gitlab>
|
|
21
|
+
|
|
22
|
+
<!--
|
|
23
|
+
|
|
24
|
+
1. In monolith's Gemfile, point `gitlab-styles` gem to this very MR branch.
|
|
25
|
+
|
|
26
|
+
For example, in Gemfile:
|
|
27
|
+
|
|
28
|
+
...
|
|
29
|
+
gem 'gitlab-styles', '~> 13.1.0', require: false,
|
|
30
|
+
git: 'https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles.git',
|
|
31
|
+
ref: '<MR branch>' # rubocop:disable Cop/GemFetcher
|
|
32
|
+
...
|
|
33
|
+
|
|
34
|
+
2. Run `bundle update`
|
|
35
|
+
3. Run `bundle exec rubocop --only <cop/rule> | pbcopy`
|
|
36
|
+
4. Paste the output below
|
|
37
|
+
|
|
38
|
+
-->
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
[Paste the output here]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
|
|
19
45
|
/label ~"Engineering Productivity" ~"development guidelines" ~"static code analysis"
|
|
20
46
|
|
|
21
47
|
/cc @gitlab-org/maintainers/rails-backend
|
data/.gitlab-ci.yml
CHANGED
|
@@ -16,7 +16,7 @@ default:
|
|
|
16
16
|
- gitlab-org
|
|
17
17
|
|
|
18
18
|
.base-ruby-job:
|
|
19
|
-
image: "ruby:${RUBY_VERSION}"
|
|
19
|
+
image: "${GITLAB_DEPENDENCY_PROXY}ruby:${RUBY_VERSION}"
|
|
20
20
|
before_script:
|
|
21
21
|
- bundle_version=$(grep -A 1 "BUNDLED WITH" Gemfile.lock | grep -oE '[[:digit:].]+')
|
|
22
22
|
- gem install bundler --version "$bundle_version" --no-document # Bundler is not installed with the image
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config --exclude-limit 10000`
|
|
3
|
-
# on 2025-
|
|
3
|
+
# on 2025-08-12 06:28:35 UTC using RuboCop version 1.71.2.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count:
|
|
9
|
+
# Offense count: 3
|
|
10
10
|
# This cop supports safe autocorrection (--autocorrect).
|
|
11
11
|
InternalAffairs/CopDescriptionWithExample:
|
|
12
12
|
Exclude:
|
|
13
|
-
- 'lib/rubocop/cop/fips/md5.rb'
|
|
14
|
-
- 'lib/rubocop/cop/fips/open_ssl.rb'
|
|
15
|
-
- 'lib/rubocop/cop/fips/sha1.rb'
|
|
16
|
-
- 'lib/rubocop/cop/gem_fetcher.rb'
|
|
17
13
|
- 'lib/rubocop/cop/gitlab_security/deep_munge.rb'
|
|
18
|
-
- 'lib/rubocop/cop/in_batches.rb'
|
|
19
|
-
- 'lib/rubocop/cop/internal_affairs/deprecate_cop_helper.rb'
|
|
20
14
|
- 'lib/rubocop/cop/line_break_around_conditional_block.rb'
|
|
21
15
|
- 'lib/rubocop/cop/migration/update_large_table.rb'
|
|
22
|
-
- 'lib/rubocop/cop/performance/rubyzip.rb'
|
|
23
|
-
- 'lib/rubocop/cop/polymorphic_associations.rb'
|
|
24
16
|
|
|
25
17
|
# Offense count: 10
|
|
26
18
|
InternalAffairs/MissingCopDepartment:
|
data/Gemfile.lock
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
gitlab-styles (
|
|
5
|
-
rubocop (= 1.
|
|
6
|
-
rubocop-capybara (
|
|
7
|
-
rubocop-factory_bot (
|
|
8
|
-
rubocop-graphql (
|
|
9
|
-
rubocop-performance (
|
|
10
|
-
rubocop-rails (
|
|
11
|
-
rubocop-rspec (
|
|
12
|
-
rubocop-rspec_rails (
|
|
4
|
+
gitlab-styles (14.0.0)
|
|
5
|
+
rubocop (= 1.81.7)
|
|
6
|
+
rubocop-capybara (= 2.21.0)
|
|
7
|
+
rubocop-factory_bot (= 2.26.1)
|
|
8
|
+
rubocop-graphql (= 1.5.4)
|
|
9
|
+
rubocop-performance (= 1.23.1)
|
|
10
|
+
rubocop-rails (= 2.29.1)
|
|
11
|
+
rubocop-rspec (= 3.4.0)
|
|
12
|
+
rubocop-rspec_rails (= 2.30.0)
|
|
13
13
|
|
|
14
14
|
GEM
|
|
15
15
|
remote: https://rubygems.org/
|
|
@@ -101,6 +101,7 @@ GEM
|
|
|
101
101
|
kramdown (~> 2.0)
|
|
102
102
|
language_server-protocol (3.17.0.3)
|
|
103
103
|
lefthook (1.3.13)
|
|
104
|
+
lint_roller (1.1.0)
|
|
104
105
|
method_source (1.0.0)
|
|
105
106
|
mini_mime (1.1.5)
|
|
106
107
|
minitest (5.18.0)
|
|
@@ -113,9 +114,10 @@ GEM
|
|
|
113
114
|
sawyer (~> 0.9)
|
|
114
115
|
open4 (1.3.4)
|
|
115
116
|
parallel (1.24.0)
|
|
116
|
-
parser (3.3.
|
|
117
|
+
parser (3.3.10.0)
|
|
117
118
|
ast (~> 2.4.1)
|
|
118
119
|
racc
|
|
120
|
+
prism (1.6.0)
|
|
119
121
|
proc_to_ast (0.1.0)
|
|
120
122
|
coderay
|
|
121
123
|
parser
|
|
@@ -156,35 +158,37 @@ GEM
|
|
|
156
158
|
binding_of_caller
|
|
157
159
|
rspec-parameterized-core (< 2)
|
|
158
160
|
rspec-support (3.12.0)
|
|
159
|
-
rubocop (1.
|
|
161
|
+
rubocop (1.81.7)
|
|
160
162
|
json (~> 2.3)
|
|
161
|
-
language_server-protocol (
|
|
163
|
+
language_server-protocol (~> 3.17.0.2)
|
|
164
|
+
lint_roller (~> 1.1.0)
|
|
162
165
|
parallel (~> 1.10)
|
|
163
166
|
parser (>= 3.3.0.2)
|
|
164
167
|
rainbow (>= 2.2.2, < 4.0)
|
|
165
168
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
166
|
-
rubocop-ast (>= 1.
|
|
169
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
167
170
|
ruby-progressbar (~> 1.7)
|
|
168
171
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
169
|
-
rubocop-ast (1.
|
|
170
|
-
parser (>= 3.3.
|
|
172
|
+
rubocop-ast (1.48.0)
|
|
173
|
+
parser (>= 3.3.7.2)
|
|
174
|
+
prism (~> 1.4)
|
|
171
175
|
rubocop-capybara (2.21.0)
|
|
172
176
|
rubocop (~> 1.41)
|
|
173
177
|
rubocop-factory_bot (2.26.1)
|
|
174
178
|
rubocop (~> 1.61)
|
|
175
179
|
rubocop-graphql (1.5.4)
|
|
176
180
|
rubocop (>= 1.50, < 2)
|
|
177
|
-
rubocop-performance (1.
|
|
181
|
+
rubocop-performance (1.23.1)
|
|
178
182
|
rubocop (>= 1.48.1, < 2.0)
|
|
179
183
|
rubocop-ast (>= 1.31.1, < 2.0)
|
|
180
|
-
rubocop-rails (2.
|
|
184
|
+
rubocop-rails (2.29.1)
|
|
181
185
|
activesupport (>= 4.2.0)
|
|
182
186
|
rack (>= 1.1)
|
|
183
187
|
rubocop (>= 1.52.0, < 2.0)
|
|
184
188
|
rubocop-ast (>= 1.31.1, < 2.0)
|
|
185
189
|
rubocop-rake (0.6.0)
|
|
186
190
|
rubocop (~> 1.0)
|
|
187
|
-
rubocop-rspec (3.0
|
|
191
|
+
rubocop-rspec (3.4.0)
|
|
188
192
|
rubocop (~> 1.61)
|
|
189
193
|
rubocop-rspec_rails (2.30.0)
|
|
190
194
|
rubocop (~> 1.61)
|
data/README.md
CHANGED
|
@@ -19,6 +19,19 @@ Or install it yourself as:
|
|
|
19
19
|
|
|
20
20
|
$ gem install gitlab-styles
|
|
21
21
|
|
|
22
|
+
## Why We Pin Gem Versions
|
|
23
|
+
|
|
24
|
+
`gitlab-styles` pins specific versions of RuboCop and related gems (e.g., `rubocop-rails`, `rubocop-rspec`, `rubocop-performance`) to ensure **consistent rule configuration and behavior across all GitLab projects**.
|
|
25
|
+
|
|
26
|
+
When gems are left unpinned, minor or patch version updates can introduce:
|
|
27
|
+
|
|
28
|
+
- **New or modified RuboCop rules** that may conflict with your project's configuration
|
|
29
|
+
- **Inconsistent linting results** across different environments and CI/CD pipelines
|
|
30
|
+
- **Unexpected build failures** when developers or CI systems install different versions
|
|
31
|
+
- **Configuration drift** between projects using `gitlab-styles`
|
|
32
|
+
|
|
33
|
+
By pinning versions, we guarantee that all projects using `gitlab-styles` enforce the same coding standards and rules, regardless of when they install the gem.
|
|
34
|
+
|
|
22
35
|
## Usage
|
|
23
36
|
|
|
24
37
|
### Inherit all rules
|
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.
|
|
26
|
-
spec.add_dependency 'rubocop-capybara', '
|
|
27
|
-
spec.add_dependency 'rubocop-factory_bot', '
|
|
28
|
-
spec.add_dependency 'rubocop-graphql', '
|
|
29
|
-
spec.add_dependency 'rubocop-performance', '
|
|
30
|
-
spec.add_dependency 'rubocop-rails', '
|
|
31
|
-
spec.add_dependency 'rubocop-rspec', '
|
|
32
|
-
spec.add_dependency 'rubocop-rspec_rails', '
|
|
25
|
+
spec.add_dependency 'rubocop', '1.81.7'
|
|
26
|
+
spec.add_dependency 'rubocop-capybara', '2.21.0'
|
|
27
|
+
spec.add_dependency 'rubocop-factory_bot', '2.26.1'
|
|
28
|
+
spec.add_dependency 'rubocop-graphql', '1.5.4'
|
|
29
|
+
spec.add_dependency 'rubocop-performance', '1.23.1'
|
|
30
|
+
spec.add_dependency 'rubocop-rails', '2.29.1'
|
|
31
|
+
spec.add_dependency 'rubocop-rspec', '3.4.0'
|
|
32
|
+
spec.add_dependency 'rubocop-rspec_rails', '2.30.0'
|
|
33
33
|
|
|
34
34
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
|
35
35
|
spec.add_development_dependency 'gitlab-dangerfiles', '~> 4.6.0'
|
|
@@ -67,8 +67,7 @@ module Rubocop
|
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
def def?(node)
|
|
70
|
-
node.
|
|
71
|
-
(node.block_type? && DEF_METHODS.include?(node.method_name))
|
|
70
|
+
node.any_def_type? || (node.block_type? && DEF_METHODS.include?(node.method_name))
|
|
72
71
|
end
|
|
73
72
|
|
|
74
73
|
def allowed?(block_node)
|
data/lib/rubocop/cop/fips/md5.rb
CHANGED
|
@@ -5,6 +5,16 @@ require_relative '../../../gitlab/styles/common/banned_constants'
|
|
|
5
5
|
module Rubocop
|
|
6
6
|
module Cop
|
|
7
7
|
module Fips
|
|
8
|
+
# Checks for the usage of MD5, which is not FIPS-compliant.
|
|
9
|
+
# It suggests using a FIPS-compliant alternative like SHA256.
|
|
10
|
+
#
|
|
11
|
+
# @example
|
|
12
|
+
# # bad
|
|
13
|
+
# OpenSSL::Digest::MD5.hexdigest('foo')
|
|
14
|
+
# Digest::MD5.hexdigest('foo')
|
|
15
|
+
#
|
|
16
|
+
# # good
|
|
17
|
+
# OpenSSL::Digest::SHA256.hexdigest('foo')
|
|
8
18
|
class MD5 < RuboCop::Cop::Base
|
|
9
19
|
include Gitlab::Styles::Common::BannedConstants
|
|
10
20
|
|
|
@@ -5,6 +5,17 @@ require_relative '../../../gitlab/styles/common/banned_constants'
|
|
|
5
5
|
module Rubocop
|
|
6
6
|
module Cop
|
|
7
7
|
module Fips
|
|
8
|
+
# Flags usage of the Digest class (which is not FIPS-compliant) and suggests replacing it with OpenSSL::Digest
|
|
9
|
+
# (which is FIPS-compliant).
|
|
10
|
+
#
|
|
11
|
+
# @example
|
|
12
|
+
# # bad
|
|
13
|
+
# Digest::SHA1.hexdigest('foo')
|
|
14
|
+
# Digest::SHA512('foo')
|
|
15
|
+
#
|
|
16
|
+
# # good
|
|
17
|
+
# OpenSSL::Digest::SHA1.hexdigest('foo')
|
|
18
|
+
# OpenSSL::Digest::SHA512.hexdigest('foo')
|
|
8
19
|
class OpenSSL < RuboCop::Cop::Base
|
|
9
20
|
extend RuboCop::Cop::AutoCorrector
|
|
10
21
|
include Gitlab::Styles::Common::BannedConstants
|
|
@@ -5,6 +5,14 @@ require_relative '../../../gitlab/styles/common/banned_constants'
|
|
|
5
5
|
module Rubocop
|
|
6
6
|
module Cop
|
|
7
7
|
module Fips
|
|
8
|
+
# Cop that denies the use of Digest::SHA1
|
|
9
|
+
# @example
|
|
10
|
+
# # bad
|
|
11
|
+
# OpenSSL::Digest::SHA1.hexdigest('foo')
|
|
12
|
+
# Digest::SHA1('ABC')
|
|
13
|
+
#
|
|
14
|
+
# # good
|
|
15
|
+
# OpenSSL::Digest::SHA256.hexdigest('foo')
|
|
8
16
|
class SHA1 < RuboCop::Cop::Base
|
|
9
17
|
include Gitlab::Styles::Common::BannedConstants
|
|
10
18
|
|
|
@@ -5,6 +5,12 @@ module Rubocop
|
|
|
5
5
|
# Prevents usage of the `git` and `github` arguments to `gem` in a
|
|
6
6
|
# `Gemfile` in order to avoid additional points of failure beyond
|
|
7
7
|
# rubygems.org.
|
|
8
|
+
# @example
|
|
9
|
+
# # bad
|
|
10
|
+
# gem 'rack', git: 'https://github.com/rack/rack'
|
|
11
|
+
#
|
|
12
|
+
# # good
|
|
13
|
+
# gem "rack"
|
|
8
14
|
class GemFetcher < RuboCop::Cop::Base
|
|
9
15
|
MSG = 'Do not use gems from git repositories, only use gems from RubyGems or vendored gems. ' \
|
|
10
16
|
'See https://docs.gitlab.com/ee/development/gemfile.html#no-gems-fetched-from-git-repositories'
|
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
module Rubocop
|
|
4
4
|
module Cop
|
|
5
5
|
# Cop that prevents the use of `in_batches`
|
|
6
|
+
# @example
|
|
7
|
+
# # bad
|
|
8
|
+
# Foo.in_batches do |relation|
|
|
9
|
+
# end
|
|
10
|
+
#
|
|
11
|
+
# # good
|
|
12
|
+
# Foo.each_batch do |relation|
|
|
13
|
+
# end
|
|
6
14
|
class InBatches < RuboCop::Cop::Base
|
|
7
15
|
MSG = 'Do not use `in_batches`, use `each_batch` from the EachBatch module instead'
|
|
8
16
|
|
|
@@ -81,7 +81,7 @@ module Rubocop
|
|
|
81
81
|
index_of_example = lines.index { |line| line.text.match?(/# @example( |$)/) }
|
|
82
82
|
return false unless index_of_example
|
|
83
83
|
|
|
84
|
-
lines_after_example = lines[index_of_example + 1..]
|
|
84
|
+
lines_after_example = lines[(index_of_example + 1)..]
|
|
85
85
|
|
|
86
86
|
lines_after_example.any? { |line| line.text.downcase.match?(/# # good( |$)/) } &&
|
|
87
87
|
lines_after_example.any? { |line| line.text.downcase.match?(/# # bad( |$)/) }
|
|
@@ -4,6 +4,18 @@ module Rubocop
|
|
|
4
4
|
module Cop
|
|
5
5
|
module InternalAffairs
|
|
6
6
|
# Cop that denies the use of CopHelper.
|
|
7
|
+
# @example
|
|
8
|
+
# # bad
|
|
9
|
+
# include CopHelper
|
|
10
|
+
#
|
|
11
|
+
# inspect_source(<<~RUBY)
|
|
12
|
+
# #....
|
|
13
|
+
# RUBY
|
|
14
|
+
#
|
|
15
|
+
# # good
|
|
16
|
+
# expect_offense(<<~RUBY)
|
|
17
|
+
# # ....
|
|
18
|
+
# RUBY
|
|
7
19
|
class DeprecateCopHelper < RuboCop::Cop::Base
|
|
8
20
|
MSG = 'Do not use `CopHelper` or methods from it, use improved patterns described in https://www.rubydoc.info/gems/rubocop/RuboCop/RSpec/ExpectOffense'
|
|
9
21
|
|
|
@@ -8,6 +8,12 @@ module Rubocop
|
|
|
8
8
|
# files and directories, this can be very expensive even when the archive's size
|
|
9
9
|
# in bytes is small.
|
|
10
10
|
#
|
|
11
|
+
# @example
|
|
12
|
+
# # bad
|
|
13
|
+
# Zip::File.open('file_path.zip', &block)
|
|
14
|
+
#
|
|
15
|
+
# # good
|
|
16
|
+
# Zip::InputStream.open('file_path.zip')
|
|
11
17
|
# See also:
|
|
12
18
|
# - https://github.com/rubyzip/rubyzip/issues/506
|
|
13
19
|
# - https://github.com/rubyzip/rubyzip#notes-on-zipinputstream
|
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
module Rubocop
|
|
4
4
|
module Cop
|
|
5
5
|
# Cop that prevents the use of polymorphic associations
|
|
6
|
+
# @example
|
|
7
|
+
# # bad
|
|
8
|
+
# class Comment < ApplicationRecord
|
|
9
|
+
# belongs_to :commentable, polymorphic: true
|
|
10
|
+
# end
|
|
11
|
+
#
|
|
12
|
+
# # good
|
|
13
|
+
# class Comment < ApplicationRecord
|
|
14
|
+
# belongs_to :post
|
|
15
|
+
# belongs_to :article
|
|
16
|
+
# end
|
|
6
17
|
class PolymorphicAssociations < RuboCop::Cop::Base
|
|
7
18
|
MSG = 'Do not use polymorphic associations, use separate tables instead'
|
|
8
19
|
|
|
@@ -14,7 +14,8 @@ module Rubocop
|
|
|
14
14
|
# css_classes = ["gl-mt-3", "md:gl-mt-5"]
|
|
15
15
|
# %div{ class: ["gl-mt-3", "md:gl-mt-5"] }
|
|
16
16
|
class MaxWidthMediaQueries < RuboCop::Cop::Base
|
|
17
|
-
|
|
17
|
+
ALLOWLIST = ['hidden'].freeze
|
|
18
|
+
TAILWIND_CSS_CLASS = /max-(sm|md|lg|xl):gl-(?!#{ALLOWLIST.join('|')})/
|
|
18
19
|
MSG = 'Do not use max-width media query utility classes unless absolutely necessary. ' \
|
|
19
20
|
'Use min-width media query utility classes instead.'
|
|
20
21
|
|
data/rubocop-naming.yml
CHANGED
data/rubocop-style.yml
CHANGED
|
@@ -475,6 +475,10 @@ Style/TrailingCommaInArguments:
|
|
|
475
475
|
Enabled: true
|
|
476
476
|
EnforcedStyleForMultiline: no_comma
|
|
477
477
|
|
|
478
|
+
# Checks for the use of logical operators in an unless condition.
|
|
479
|
+
Style/UnlessLogicalOperators:
|
|
480
|
+
Enabled: true
|
|
481
|
+
|
|
478
482
|
# Don't interpolate global, instance and class variables directly in strings.
|
|
479
483
|
Style/VariableInterpolation:
|
|
480
484
|
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: 14.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:
|
|
11
|
+
date: 2026-01-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rubocop
|
|
@@ -16,110 +16,110 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - '='
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 1.
|
|
19
|
+
version: 1.81.7
|
|
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.81.7
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rubocop-capybara
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - '='
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: 2.21.0
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - '='
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: 2.21.0
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rubocop-factory_bot
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- -
|
|
45
|
+
- - '='
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: 2.26.1
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- -
|
|
52
|
+
- - '='
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: 2.26.1
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: rubocop-graphql
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - '='
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: 1.5.4
|
|
62
62
|
type: :runtime
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- -
|
|
66
|
+
- - '='
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: 1.5.4
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: rubocop-performance
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- -
|
|
73
|
+
- - '='
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 1.
|
|
75
|
+
version: 1.23.1
|
|
76
76
|
type: :runtime
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- -
|
|
80
|
+
- - '='
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 1.
|
|
82
|
+
version: 1.23.1
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: rubocop-rails
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- -
|
|
87
|
+
- - '='
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 2.
|
|
89
|
+
version: 2.29.1
|
|
90
90
|
type: :runtime
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- -
|
|
94
|
+
- - '='
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 2.
|
|
96
|
+
version: 2.29.1
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: rubocop-rspec
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- -
|
|
101
|
+
- - '='
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: 3.0
|
|
103
|
+
version: 3.4.0
|
|
104
104
|
type: :runtime
|
|
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: 3.0
|
|
110
|
+
version: 3.4.0
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: rubocop-rspec_rails
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
|
-
- -
|
|
115
|
+
- - '='
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
117
|
version: 2.30.0
|
|
118
118
|
type: :runtime
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
|
-
- -
|
|
122
|
+
- - '='
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: 2.30.0
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
@@ -409,7 +409,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
409
409
|
- !ruby/object:Gem::Version
|
|
410
410
|
version: '0'
|
|
411
411
|
requirements: []
|
|
412
|
-
rubygems_version: 3.
|
|
412
|
+
rubygems_version: 3.5.22
|
|
413
413
|
signing_key:
|
|
414
414
|
specification_version: 4
|
|
415
415
|
summary: GitLab style guides and shared style configs.
|