ezcater_rubocop 6.0.0 → 6.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/CHANGELOG.md +8 -1
- data/conf/rubocop.yml +3 -3
- data/ezcater_rubocop.gemspec +1 -1
- data/lib/ezcater_rubocop/version.rb +1 -1
- data/lib/rubocop/cop/ezcater/feature_flag_name_valid.rb +8 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74dad3c36b4474ebb1ed730e204ed1256715708736a388dc809ae106256b3b08
|
4
|
+
data.tar.gz: 34751bbd4b890ba18a534bc5f47860cc6e00121d43ce3b398ddcb921c56afbb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9762748a349377a1f673572a21e5fd71ad80f4a5213f4fb1b95670c65b6cb7093e77b7d01168d0cd8e2bc6947321ebcf8d888f6f9fe945e9d70daee1ad019b1
|
7
|
+
data.tar.gz: e8da642c516edf9dd7a916ae664261aab3db90873fd68247012a017b22d5affac97f806bc4dbd3a5a2721ab3ebf64d97ade3bf75bc6a872e59b34d01bcfa9d5e
|
data/CHANGELOG.md
CHANGED
@@ -6,11 +6,18 @@ This gem is moving onto its own [Semantic Versioning](https://semver.org/) schem
|
|
6
6
|
|
7
7
|
Prior to v1.0.0 this gem was versioned based on the `MAJOR`.`MINOR` version of RuboCop. The first release of the ezcater_rubocop gem was `v0.49.0`.
|
8
8
|
|
9
|
+
## 6.0.2
|
10
|
+
- Upgrade rubocop-rspec to v2.22.0 to use the new FactoryBot namespaces.
|
11
|
+
- Fix the following wrong namespaces related to `FactoryBot`: `RSpec/FactoryBot/AttributeDefinedStatically`, `RSpec/FactoryBot/CreateList` and `RSpec/FactoryBot/FactoryClassName`.
|
12
|
+
|
13
|
+
## 6.0.1
|
14
|
+
- Fix a bug in the `FeatureFlagNameValid` cop where the titlecase regex matcher was incorrectly finding offenses.
|
15
|
+
|
9
16
|
## 6.0.0
|
10
17
|
- Add `FeatureFlagNameValid` cop to validate correct feature flag name format, [adopted from the cop](https://github.com/ezcater/ez-rails/blob/2d9272eb3d2c71dc5ebc2aa01a849cf9cfae3df2/cops/rubocop/cops/feature_flags_flag_name.rb_) in `ez-rails`.
|
11
18
|
|
12
19
|
## 5.2.1
|
13
|
-
- Fix the
|
20
|
+
- Fix the wrong namespace for `RSpec/Capybara/CurrentPathExpectation` and `RSpec/Capybara/VisibilityMatcher` cops, since [they've been extracted](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md#2180-2023-01-16) into a separate repo [rubocop-capybara](https://github.com/rubocop/rubocop-capybara).
|
14
21
|
|
15
22
|
## 5.2.0
|
16
23
|
|
data/conf/rubocop.yml
CHANGED
@@ -245,13 +245,13 @@ RSpec/Capybara/FeatureMethods:
|
|
245
245
|
RSpec/EmptyHook:
|
246
246
|
Enabled: true
|
247
247
|
|
248
|
-
|
248
|
+
FactoryBot/AttributeDefinedStatically:
|
249
249
|
Enabled: true
|
250
250
|
|
251
|
-
|
251
|
+
FactoryBot/CreateList:
|
252
252
|
Enabled: true
|
253
253
|
|
254
|
-
|
254
|
+
FactoryBot/FactoryClassName:
|
255
255
|
Enabled: true
|
256
256
|
|
257
257
|
RSpec/MultipleMemoizedHelpers:
|
data/ezcater_rubocop.gemspec
CHANGED
@@ -55,5 +55,5 @@ Gem::Specification.new do |spec|
|
|
55
55
|
spec.add_runtime_dependency "rubocop", ">= 1.16.0", "< 2.0"
|
56
56
|
spec.add_runtime_dependency "rubocop-graphql", ">= 0.14.0", "< 1.0"
|
57
57
|
spec.add_runtime_dependency "rubocop-rails", ">= 2.10.1", "< 3.0"
|
58
|
-
spec.add_runtime_dependency "rubocop-rspec", ">= 2.
|
58
|
+
spec.add_runtime_dependency "rubocop-rspec", ">= 2.22.0", "< 3.0"
|
59
59
|
end
|
@@ -22,11 +22,11 @@ module RuboCop
|
|
22
22
|
# EzFF.active?("foo::bar", identifiers: ["user:1"])
|
23
23
|
# MY_FLAG="Foo:bar"
|
24
24
|
class FeatureFlagNameValid < Cop
|
25
|
-
WHITESPACE = /\s
|
26
|
-
ISOLATED_COLON = /(?<!:):(?!:)
|
27
|
-
TRIPLE_COLON =
|
28
|
-
INVALID_CHARACTERS = /[^a-zA-Z0-9:]
|
29
|
-
TITLECASE_SEGMENT =
|
25
|
+
WHITESPACE = /\s/
|
26
|
+
ISOLATED_COLON = /(?<!:):(?!:)/
|
27
|
+
TRIPLE_COLON = /:::/
|
28
|
+
INVALID_CHARACTERS = /[^a-zA-Z0-9:]/
|
29
|
+
TITLECASE_SEGMENT = /^([A-Z][a-z0-9]*)+$/
|
30
30
|
|
31
31
|
WHITESPACE_MSG = "Feature flag names must not contain whitespace."
|
32
32
|
DOUBLE_COLON_MSG = "Feature flag names must use double colons (::) as namespace separators."
|
@@ -39,7 +39,7 @@ module RuboCop
|
|
39
39
|
|
40
40
|
def_node_matcher :feature_flag_method_call, <<~PATTERN
|
41
41
|
(send
|
42
|
-
(_ _ {:EzFF :EzcaterFeatureFlag}) {:active? | :at_100? | :random_sample_active?} (str $_
|
42
|
+
(_ _ {:EzFF :EzcaterFeatureFlag}) {:active? | :at_100? | :random_sample_active?} <(str $_) ...>)
|
43
43
|
PATTERN
|
44
44
|
|
45
45
|
def on_casgn(node)
|
@@ -53,7 +53,7 @@ module RuboCop
|
|
53
53
|
|
54
54
|
def on_send(node)
|
55
55
|
return unless feature_flag_method_call(node)
|
56
|
-
|
56
|
+
|
57
57
|
feature_flag_method_call(node) do |flag_name|
|
58
58
|
errors = find_name_violations(flag_name)
|
59
59
|
add_offense(node, location: :expression, message: errors.join(", ")) if errors.any?
|
@@ -88,5 +88,5 @@ module RuboCop
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
91
|
-
end
|
91
|
+
end
|
92
92
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ezcater_rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ezCater, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -174,7 +174,7 @@ dependencies:
|
|
174
174
|
requirements:
|
175
175
|
- - ">="
|
176
176
|
- !ruby/object:Gem::Version
|
177
|
-
version: 2.
|
177
|
+
version: 2.22.0
|
178
178
|
- - "<"
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '3.0'
|
@@ -184,7 +184,7 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - ">="
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 2.
|
187
|
+
version: 2.22.0
|
188
188
|
- - "<"
|
189
189
|
- !ruby/object:Gem::Version
|
190
190
|
version: '3.0'
|