chutney 3.8.2 → 3.9.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/lib/chutney/linter/avoid_comma_in_tags.rb +18 -0
- data/lib/chutney/lsp/server.rb +2 -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/_config.yml +1 -1
- data/usechutney.com/docs/rules/avoid-comma-in-tags/index.md +26 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fb7860cfd94d79eb4aae1f69269c7aa0178d81cb155844dac4b67905e5caf55
|
4
|
+
data.tar.gz: 710d27816dfa2226e9b5384e88c7cd568a6096bea8e9078bd1898ee4eab5f218
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7d58d734669f76a342c4a570c1cca7ae179d1439f0426b256f673f48772a3709bec4e327ca6ee5e198493d4e5951ab4158e68d4bb333f70ce6def94f7aa0acf
|
7
|
+
data.tar.gz: e71d49b4ef0d6a6acbb21e601d8cd6ec55b100bcc63ac87199b8aace0b43e28d53279f68c9a38f6f620f30511d22dc86b48f1e70decec3e898f32038bea742de
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Chutney
|
4
|
+
# service class to lint for too many tags
|
5
|
+
class AvoidCommaInTags < Linter
|
6
|
+
def lint
|
7
|
+
scenarios do |feature, scenario|
|
8
|
+
tags = tags_for(feature) + tags_for(scenario)
|
9
|
+
next unless tags.any? { |tag| tag.include?(',') }
|
10
|
+
|
11
|
+
add_issue(
|
12
|
+
I18n.t('linters.avoid_comma_in_tags'),
|
13
|
+
feature
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/chutney/lsp/server.rb
CHANGED
@@ -134,6 +134,8 @@ module Chutney
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def to_range(location)
|
137
|
+
return { start: { character: 0, line: 0 }, end: { character: 0, line: 0 } } unless location
|
138
|
+
|
137
139
|
{
|
138
140
|
start: { character: location.fetch(:column, 1) - 1, line: location.fetch(:line, 1) - 1 },
|
139
141
|
end: { character: 0, line: location.fetch(:line, 1) }
|
data/lib/chutney/version.rb
CHANGED
data/lib/chutney.rb
CHANGED
@@ -4,6 +4,7 @@ require 'amatch'
|
|
4
4
|
|
5
5
|
require 'chutney/configuration'
|
6
6
|
require 'chutney/linter'
|
7
|
+
require 'chutney/linter/avoid_comma_in_tags'
|
7
8
|
require 'chutney/linter/avoid_full_stop'
|
8
9
|
require 'chutney/linter/avoid_outline_for_single_example'
|
9
10
|
require 'chutney/linter/avoid_scripting'
|
data/lib/config/locales/en.yml
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
# God save the Queen, etc. etc.
|
4
4
|
en:
|
5
5
|
linters:
|
6
|
+
avoid_comma_in_tags: >-
|
7
|
+
Avoid using commas in tags. Tags should be separated by spaces.
|
6
8
|
avoid_full_stop: >- # https://en.wikipedia.org/wiki/Full_stop
|
7
9
|
Avoid using a full-stop in steps so that it is easier to re-use them.
|
8
10
|
avoid_outline_for_single_example: >-
|
data/usechutney.com/_config.yml
CHANGED
@@ -74,7 +74,7 @@ masthead_title: # overrides the website title displayed in the masthead, use " "
|
|
74
74
|
breadcrumbs: # true, false (default)
|
75
75
|
words_per_minute: 200
|
76
76
|
enable_copy_code_button: true # true, false (default)
|
77
|
-
copyright: # "copyright" name, defaults to site.title
|
77
|
+
copyright: Nigel Brookes-Thomas # "copyright" name, defaults to site.title
|
78
78
|
copyright_url: # "copyright" URL, defaults to site.url
|
79
79
|
comments:
|
80
80
|
provider: # false (default), "disqus", "discourse", "facebook", "staticman", "staticman_v2", "utterances", "giscus", "custom"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
title: "Avoid Comma in Tags"
|
3
|
+
layout: single
|
4
|
+
permalink: /docs/rules/avoid-comma-in-tags/
|
5
|
+
---
|
6
|
+
|
7
|
+
Don't put a comma in tags. It's probably a mistake if you have them from trying write a list of tags but the comma will form part of the name and makes it hard to include or exclude the tag from a Cucumber run.
|
8
|
+
|
9
|
+
|
10
|
+
## Bad
|
11
|
+
|
12
|
+
```gherkin
|
13
|
+
@web, @login
|
14
|
+
Given I have visited the website
|
15
|
+
When I log in.
|
16
|
+
Then I will see my account
|
17
|
+
```
|
18
|
+
|
19
|
+
## Good
|
20
|
+
|
21
|
+
```gherkin
|
22
|
+
@web @login
|
23
|
+
Given I have visited the website
|
24
|
+
When I log in
|
25
|
+
Then I will see my account
|
26
|
+
```
|
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.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nigel Brookes-Thomas
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2024-
|
14
|
+
date: 2024-11-19 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: amatch
|
@@ -155,6 +155,7 @@ files:
|
|
155
155
|
- lib/chutney/formatter/rainbow_formatter.rb
|
156
156
|
- lib/chutney/issue.rb
|
157
157
|
- lib/chutney/linter.rb
|
158
|
+
- lib/chutney/linter/avoid_comma_in_tags.rb
|
158
159
|
- lib/chutney/linter/avoid_full_stop.rb
|
159
160
|
- lib/chutney/linter/avoid_outline_for_single_example.rb
|
160
161
|
- lib/chutney/linter/avoid_scripting.rb
|
@@ -213,6 +214,7 @@ files:
|
|
213
214
|
- usechutney.com/docs/disabling-rules/index.md
|
214
215
|
- usechutney.com/docs/installing/index.md
|
215
216
|
- usechutney.com/docs/language-server/index.md
|
217
|
+
- usechutney.com/docs/rules/avoid-comma-in-tags/index.md
|
216
218
|
- usechutney.com/docs/rules/avoid-full-stops/index.md
|
217
219
|
- usechutney.com/docs/rules/avoid-outline-for-single-example/index.md
|
218
220
|
- usechutney.com/docs/rules/avoid-scripting/index.md
|
@@ -277,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
277
279
|
- !ruby/object:Gem::Version
|
278
280
|
version: '0'
|
279
281
|
requirements: []
|
280
|
-
rubygems_version: 3.5.
|
282
|
+
rubygems_version: 3.5.19
|
281
283
|
signing_key:
|
282
284
|
specification_version: 4
|
283
285
|
summary: A linter for multi-lingual Gherkin
|