chutney 3.12.4 → 3.13.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/config/chutney_defaults.yml +3 -0
- data/lib/chutney/linter/too_short_tag.rb +22 -0
- data/lib/chutney/version.rb +1 -1
- data/lib/chutney.rb +1 -0
- data/lib/config/locales/en.yml +2 -0
- data/usechutney.com.site/site/src/docs/rules/index.page.md +1 -0
- data/usechutney.com.site/site/src/docs/rules/too_short_tag.page.md +25 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f2cf6323ca7856c5f58637ddc7ea3a4dd74222099a0dcb0a9b0768d95569bb5
|
|
4
|
+
data.tar.gz: bae06f03776f2c4d0be16f2a5bbd2f142e0a1259822076801924e0c02ee11e09
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c9461d317783650437e56da8bada9a15e3cf28974d6f28aec466c28b7fd066ec7eda520cfb2f419710c81b6f78ab94e8cb3aa403dcd28fa0f725d9aa03c19e6
|
|
7
|
+
data.tar.gz: 6e313a2aab39d318b2415c5d50e4df6a9ba373b4d00d07525dea132c3ea4d2610a5fea0469439d81d6cc6f513f6972a5a2356af35cbd647e76469981a6e86e71
|
data/config/chutney_defaults.yml
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chutney
|
|
4
|
+
# service class to lint for tags that are too short, such as @t
|
|
5
|
+
class TooShortTag < Linter
|
|
6
|
+
def lint
|
|
7
|
+
scenarios do |feature, scenario|
|
|
8
|
+
tags = tags_for(feature) + tags_for(scenario)
|
|
9
|
+
next unless tags.any? { |tag| tag.length < min_length }
|
|
10
|
+
|
|
11
|
+
add_issue(
|
|
12
|
+
I18n.t('linters.too_short_tag', min_length:, tags:),
|
|
13
|
+
feature
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def min_length
|
|
19
|
+
configuration['MinLength']&.to_i || 2
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
data/lib/chutney/version.rb
CHANGED
data/lib/chutney.rb
CHANGED
|
@@ -40,6 +40,7 @@ require 'chutney/linter/too_long_step'
|
|
|
40
40
|
require 'chutney/linter/too_many_different_tags'
|
|
41
41
|
require 'chutney/linter/too_many_steps'
|
|
42
42
|
require 'chutney/linter/too_many_tags'
|
|
43
|
+
require 'chutney/linter/too_short_tag'
|
|
43
44
|
require 'chutney/linter/unique_scenario_names'
|
|
44
45
|
require 'chutney/linter/unknown_variable'
|
|
45
46
|
require 'chutney/linter/unused_variable'
|
data/lib/config/locales/en.yml
CHANGED
|
@@ -108,6 +108,8 @@ en:
|
|
|
108
108
|
There are too many steps in this feature. There are %{count} and the maximum is %{max}.
|
|
109
109
|
too_many_tags: >-
|
|
110
110
|
There are too many tags in this feature. There are %{count} and the maximum is %{max}.
|
|
111
|
+
too_short_tag: >-
|
|
112
|
+
Your tag is too short: %{tags}. The minimum length of a tag is %{min_length}. Tags should have meaning.
|
|
111
113
|
unique_scenario_names: >-
|
|
112
114
|
The scenario name '%{name}' is duplicated, first used at line %{line}, column %{column}.
|
|
113
115
|
unknown_variable: >-
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
* [Too Many Different Tags](/docs/rules/too-many-different-tags)
|
|
37
37
|
* [Too Many Steps](/docs/rules/too-many-steps)
|
|
38
38
|
* [Too Many Tags](/docs/rules/too-many-tags)
|
|
39
|
+
* [Too Short Tag](/docs/rules/too_short_tag)
|
|
39
40
|
* [Unique Scenario Names](/docs/rules/unique-scenario-names)
|
|
40
41
|
* [Unknown Variable](/docs/rules/unknown-variable)
|
|
41
42
|
* [Unused Variable](/docs/rules/unused-variable)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Too Short Tag
|
|
2
|
+
|
|
3
|
+
If you have used a tag that is too short, you have probably done it while locally testing. This is a bad practice because it makes your tests harder to read and maintain.
|
|
4
|
+
|
|
5
|
+
It is much better to use tags that relate to the test, such as a ticket number to connect the development work you are testing
|
|
6
|
+
|
|
7
|
+
## Bad
|
|
8
|
+
|
|
9
|
+
```gherkin
|
|
10
|
+
@t
|
|
11
|
+
Scenario: Log in with valid credentials
|
|
12
|
+
Given I have visited the website
|
|
13
|
+
When I log in with "user1" and "pass1"
|
|
14
|
+
Then I will see my account
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Good
|
|
18
|
+
|
|
19
|
+
```gherkin
|
|
20
|
+
@QE-0001
|
|
21
|
+
Scenario: Log in with valid credentials
|
|
22
|
+
Given I have visited the website
|
|
23
|
+
When I log in with "user1" and "pass1"
|
|
24
|
+
Then I will see my account
|
|
25
|
+
```
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chutney
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nigel Brookes-Thomas
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
- John Gluck
|
|
11
11
|
bindir: exe
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2026-03-06 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: amatch
|
|
@@ -212,6 +212,7 @@ files:
|
|
|
212
212
|
- lib/chutney/linter/too_many_different_tags.rb
|
|
213
213
|
- lib/chutney/linter/too_many_steps.rb
|
|
214
214
|
- lib/chutney/linter/too_many_tags.rb
|
|
215
|
+
- lib/chutney/linter/too_short_tag.rb
|
|
215
216
|
- lib/chutney/linter/unique_scenario_names.rb
|
|
216
217
|
- lib/chutney/linter/unknown_variable.rb
|
|
217
218
|
- lib/chutney/linter/unused_variable.rb
|
|
@@ -280,6 +281,7 @@ files:
|
|
|
280
281
|
- usechutney.com.site/site/src/docs/rules/too-many-different-tags.page.md
|
|
281
282
|
- usechutney.com.site/site/src/docs/rules/too-many-steps.page.md
|
|
282
283
|
- usechutney.com.site/site/src/docs/rules/too-many-tags.page.md
|
|
284
|
+
- usechutney.com.site/site/src/docs/rules/too_short_tag.page.md
|
|
283
285
|
- usechutney.com.site/site/src/docs/rules/unique-scenario-names.page.md
|
|
284
286
|
- usechutney.com.site/site/src/docs/rules/unknown-variable.page.md
|
|
285
287
|
- usechutney.com.site/site/src/docs/rules/unused-variable.page.md
|