gl_rubocop 0.2.15 → 0.2.17
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 +7 -0
- data/gl_rubocop.gemspec +3 -0
- data/lib/gl_rubocop/gl_cops/callback_method_names.rb +2 -0
- data/lib/gl_rubocop/gl_cops/limit_flash_options.rb +4 -5
- data/lib/gl_rubocop/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '000623795bad5a89e554dbc2774b53e05ff5e032cbda1ae383c328ba4b47b288'
|
4
|
+
data.tar.gz: 73ba4a320bd8a2f3676cc8b4e491e65c0b4d7cb2605288fc51521c28c2ea9208
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40220d47e0dfb92de08a9ecf69508a97d6b3cc53699c33cddb590f7a10b5f8681c7ad611c849f9025e040ceefcfc6c24838f4efef70abd0cda3deef5e669be8b
|
7
|
+
data.tar.gz: c7ad410f1a653213ec1f18e9b8fa1effb8ef895b1d46408985954042364ae4d5a0c9a9e6ba78843e8b1a853bb9c47c901e9342d1c7e02ff09cf26419d4667371
|
data/default.yml
CHANGED
@@ -4,6 +4,7 @@ require:
|
|
4
4
|
- rubocop-rspec
|
5
5
|
- rubocop-magic_numbers
|
6
6
|
- rubocop-haml
|
7
|
+
- rubocop-i18n
|
7
8
|
- rubocop-rake
|
8
9
|
- rubocop-sorbet
|
9
10
|
- ./lib/gl_rubocop/gl_cops/callback_method_names.rb
|
@@ -66,6 +67,12 @@ GLCops/UniqueIdentifier:
|
|
66
67
|
Include:
|
67
68
|
- "app/components/**/*.haml"
|
68
69
|
|
70
|
+
I18n/GetText:
|
71
|
+
Enabled: false
|
72
|
+
|
73
|
+
I18n/RailsI18n:
|
74
|
+
Enabled: true
|
75
|
+
|
69
76
|
Layout/ClassStructure:
|
70
77
|
Enabled: true
|
71
78
|
|
data/gl_rubocop.gemspec
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative 'lib/gl_rubocop/version'
|
4
4
|
|
5
|
+
# rubocop:disable I18n/RailsI18n/DecorateString
|
5
6
|
NON_GEM_FILES = ['Gemfile', 'Gemfile.lock', 'Guardfile', 'bin/lint'].freeze
|
6
7
|
|
7
8
|
Gem::Specification.new do |spec|
|
@@ -27,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
27
28
|
|
28
29
|
spec.add_dependency 'rubocop', '~> 1.62.1'
|
29
30
|
spec.add_dependency 'rubocop-haml', '~> 0.2.4'
|
31
|
+
spec.add_dependency 'rubocop-i18n'
|
30
32
|
spec.add_dependency 'rubocop-magic_numbers'
|
31
33
|
spec.add_dependency 'rubocop-performance'
|
32
34
|
spec.add_dependency 'rubocop-rails'
|
@@ -36,3 +38,4 @@ Gem::Specification.new do |spec|
|
|
36
38
|
|
37
39
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
38
40
|
end
|
41
|
+
# rubocop:enable I18n/RailsI18n/DecorateString
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# rubocop:disable I18n/RailsI18n/DecorateString
|
1
2
|
module GLRubocop
|
2
3
|
module GLCops
|
3
4
|
# This cop ensures that controller callbacks are named methods, not inline blocks.
|
@@ -21,3 +22,4 @@ module GLRubocop
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
25
|
+
# rubocop:enable I18n/RailsI18n/DecorateString
|
@@ -16,10 +16,6 @@ module GLRubocop
|
|
16
16
|
# flash.now[:anything_else] = "Not allowed"
|
17
17
|
# Alert::Component.new(type: :notice, message: "Error")
|
18
18
|
# Notifications::Dismissible::Component.new(variant: :blue_box, message: "Error")
|
19
|
-
|
20
|
-
MSG = 'This cop checks for the use of flash options not in the allowlist. ' \
|
21
|
-
'Please limit flash options to those defined in the application configuration.'
|
22
|
-
|
23
19
|
ALLOWED_FLASH_KEYS = %i[success info warning danger].freeze
|
24
20
|
|
25
21
|
# Matches the Rails flash hash assignment
|
@@ -74,7 +70,10 @@ module GLRubocop
|
|
74
70
|
return false unless key
|
75
71
|
return false if ALLOWED_FLASH_KEYS.include?(key)
|
76
72
|
|
77
|
-
add_offense(
|
73
|
+
add_offense(
|
74
|
+
node,
|
75
|
+
message: "'#{key}' is not one of the permitted flash keys: #{ALLOWED_FLASH_KEYS}"
|
76
|
+
)
|
78
77
|
end
|
79
78
|
end
|
80
79
|
end
|
data/lib/gl_rubocop/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gl_rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Give Lively
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.2.4
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop-i18n
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rubocop-magic_numbers
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|