gitlab-styles 13.0.1 → 13.0.2
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/Release.md +12 -2
- data/Gemfile.lock +3 -3
- data/gitlab-styles.gemspec +1 -1
- data/lib/gitlab/styles/version.rb +1 -1
- data/lib/rubocop/cop/tailwind/max_width_media_queries.rb +34 -0
- data/rubocop-style.yml +1 -3
- data/rubocop-tailwind.yml +4 -0
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1b05957f6a3353a50fe37009f0c78239677857f28e6d16589de5eb3aa8120868
|
|
4
|
+
data.tar.gz: d3169d41ff1af9327b2e1e3a8fb2a5a2357915542ad0bb3352e52451e3cfb0dc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53891b9794f187eaa55f40dd87d2f89bbe84d4d7204fb40b40de4b7dc3761b2e4a265a670ed4255d49ef419df682a5d5e44d8283e12d01bf530be1a684527ba2
|
|
7
|
+
data.tar.gz: d77ec1fb537c34c438527eb019c12bfff2f463bfd78212384f15e2cdd327e5de2cd9572d91d6020ef72f3c885bc4f5de244d5b9a1bc842d2aa0347b0bfb75fbd
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
commit from this merge request, and `<NEW_VERSION>` with the upcoming version number. -->
|
|
3
3
|
## Diff
|
|
4
4
|
|
|
5
|
-
https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles/-/compare
|
|
5
|
+
https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles/-/compare/<PREVIOUS_VERSION>...<COMMIT_UPDATING_VERSION>
|
|
6
|
+
|
|
7
|
+
<!--
|
|
8
|
+
|
|
9
|
+
NOTE:
|
|
10
|
+
If you are working with a fork use: https://gitlab.com/<YOUR_NAMESPACE>/gitlab-styles/-/compare/<PREVIOUS_VERSION>...<COMMIT_UPDATING_VERSION>?from_project_id=4176070
|
|
11
|
+
|
|
12
|
+
-->
|
|
6
13
|
|
|
7
14
|
## Checklist
|
|
8
15
|
|
|
@@ -10,6 +17,7 @@ https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles/-/compare/v<PREVIOUS_VERSI
|
|
|
10
17
|
- [ ] Ensure the diff link above is up-to-date.
|
|
11
18
|
- [ ] Add release notes to the [Changelog](#changelog) section below.
|
|
12
19
|
- [ ] Based on the diff and the release notes, update the `version.rb` according to [SemVer](https://semver.org).
|
|
20
|
+
- [ ] Run `bundle install` to update `Gemfile.lock`
|
|
13
21
|
- [ ] Create an MR on `gitlab-org/gitlab` project [with the `New Version of gitlab-styles.md` template](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/merge_request_templates/New%20Version%20of%20gitlab-styles.md) to test the new version of `gitlab-styles`, and follow the MR instructions.
|
|
14
22
|
|
|
15
23
|
## Changelog
|
|
@@ -19,7 +27,9 @@ Paste output of:
|
|
|
19
27
|
|
|
20
28
|
curl https://gitlab.com/api/v4/projects/4176070/repository/changelog?version=<NEW_VERSION> | jq -r ".notes"
|
|
21
29
|
|
|
22
|
-
NOTE:
|
|
30
|
+
NOTE:
|
|
31
|
+
Emphasize changes via `**BREAKING CHANGE**` or `**IMPORTANT**` etc. if actions are required by users
|
|
32
|
+
Example: https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles/-/releases/13.0.0
|
|
23
33
|
|
|
24
34
|
-->
|
|
25
35
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
gitlab-styles (13.0.
|
|
5
|
-
rubocop (~> 1.
|
|
4
|
+
gitlab-styles (13.0.2)
|
|
5
|
+
rubocop (~> 1.68.0)
|
|
6
6
|
rubocop-capybara (~> 2.21.0)
|
|
7
7
|
rubocop-factory_bot (~> 2.26.1)
|
|
8
8
|
rubocop-graphql (~> 1.5.4)
|
|
@@ -156,7 +156,7 @@ GEM
|
|
|
156
156
|
binding_of_caller
|
|
157
157
|
rspec-parameterized-core (< 2)
|
|
158
158
|
rspec-support (3.12.0)
|
|
159
|
-
rubocop (1.
|
|
159
|
+
rubocop (1.68.0)
|
|
160
160
|
json (~> 2.3)
|
|
161
161
|
language_server-protocol (>= 3.17.0)
|
|
162
162
|
parallel (~> 1.10)
|
data/gitlab-styles.gemspec
CHANGED
|
@@ -22,7 +22,7 @@ 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.68.0'
|
|
26
26
|
spec.add_dependency 'rubocop-capybara', '~> 2.21.0'
|
|
27
27
|
spec.add_dependency 'rubocop-factory_bot', '~> 2.26.1'
|
|
28
28
|
spec.add_dependency 'rubocop-graphql', '~> 1.5.4'
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Rubocop
|
|
4
|
+
module Cop
|
|
5
|
+
module Tailwind
|
|
6
|
+
# This prevents the use of max-width media query Tailwind CSS utility classes unless absolutely necessary.
|
|
7
|
+
# min-width media query Tailwind CSS utility classes should be used instead.
|
|
8
|
+
# @example
|
|
9
|
+
# # bad
|
|
10
|
+
# css_classes = ["gl-mt-5", "max-md:gl-mt-3"]
|
|
11
|
+
# %div{ class: ["gl-mt-5", "max-md:gl-mt-3"] }
|
|
12
|
+
#
|
|
13
|
+
# # good
|
|
14
|
+
# css_classes = ["gl-mt-3", "md:gl-mt-5"]
|
|
15
|
+
# %div{ class: ["gl-mt-3", "md:gl-mt-5"] }
|
|
16
|
+
class MaxWidthMediaQueries < RuboCop::Cop::Base
|
|
17
|
+
TAILWIND_CSS_CLASS = /max-(sm|md|lg|xl):gl-/
|
|
18
|
+
MSG = 'Do not use max-width media query utility classes unless absolutely necessary. ' \
|
|
19
|
+
'Use min-width media query utility classes instead.'
|
|
20
|
+
|
|
21
|
+
# @!method max_width_media_query_class?(node)
|
|
22
|
+
def_node_matcher :max_width_media_query_class?, <<~PATTERN
|
|
23
|
+
(str /#{TAILWIND_CSS_CLASS}/)
|
|
24
|
+
PATTERN
|
|
25
|
+
|
|
26
|
+
def on_str(node)
|
|
27
|
+
return unless max_width_media_query_class?(node)
|
|
28
|
+
|
|
29
|
+
add_offense(node)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
data/rubocop-style.yml
CHANGED
|
@@ -182,11 +182,9 @@ Style/HashLikeCase:
|
|
|
182
182
|
|
|
183
183
|
# Prefer Ruby 1.9 hash syntax `{ a: 1, b: 2 }`
|
|
184
184
|
# over 1.8 syntax `{ :a => 1, :b => 2 }`.
|
|
185
|
-
# Short-hand Hash syntax does not work prior 3.1.
|
|
186
|
-
# See https://gitlab.com/gitlab-org/gitlab/-/issues/435940#note_1703307479
|
|
187
185
|
Style/HashSyntax:
|
|
188
186
|
Enabled: true
|
|
189
|
-
EnforcedShorthandSyntax:
|
|
187
|
+
EnforcedShorthandSyntax: either_consistent
|
|
190
188
|
|
|
191
189
|
# looks for uses of _.each_with_object({}) {...}, _.map {...}.to_h, and Hash[_.map {...}]
|
|
192
190
|
# that are actually just transforming the keys of a hash, and tries to use a simpler & faster
|
data/rubocop-tailwind.yml
CHANGED
|
@@ -5,3 +5,7 @@ require:
|
|
|
5
5
|
# Prevent string interpolation when building Tailwind CSS utils names
|
|
6
6
|
Tailwind/StringInterpolation:
|
|
7
7
|
Enabled: false
|
|
8
|
+
|
|
9
|
+
# Prevent max-width media query Tailwind CSS utility classes. min-width media queries should be used instead.
|
|
10
|
+
Tailwind/MaxWidthMediaQueries:
|
|
11
|
+
Enabled: false
|
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: 13.0.
|
|
4
|
+
version: 13.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GitLab
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-11-27 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.68.0
|
|
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.68.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rubocop-capybara
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -365,6 +365,7 @@ files:
|
|
|
365
365
|
- lib/rubocop/cop/style/hash_transformation.rb
|
|
366
366
|
- lib/rubocop/cop/style/iso8601_date.rb
|
|
367
367
|
- lib/rubocop/cop/style/open_struct_use.rb
|
|
368
|
+
- lib/rubocop/cop/tailwind/max_width_media_queries.rb
|
|
368
369
|
- lib/rubocop/cop/tailwind/string_interpolation.rb
|
|
369
370
|
- rubocop-all.yml
|
|
370
371
|
- rubocop-bundler.yml
|