chutney 3.8.2 → 3.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d591126bb019a5a5805ea5ee0678e19e848e3c6dd6f36baf48ea398f5bd2832
4
- data.tar.gz: 4d2579c84397ff586ca987f5824432958deffdcaa08a429eccaff8c8ab29ec51
3
+ metadata.gz: 6734d8a322d5394f40d363d0ad93def2424ea97be81f4a13cd7bb92c91ade597
4
+ data.tar.gz: 0146772a58c64cfa3aa8f7ab05861c94945d37abec3ff10c93bd3f653c9784b4
5
5
  SHA512:
6
- metadata.gz: f71bbc66a6a5c9d81b240d08e4bc6817a0c9b98ec9a8c80f31f71a4a0104239e4b674f303453761bcab8c4785fc6bd12ba8c15e64963e466f8dea3b7bea0a635
7
- data.tar.gz: c6a8ae299506b6f1519275f2aa9f5e962c6191958265e154e51e98625aa8825f0869cc4e580cef7340708dd15416241aa81f2eff94423022dae2ce9ecf9e85f9
6
+ metadata.gz: 9f869fc17e30cee78412fab391049971c81316937148e73dcd6111afb6d55a5c60e9ac5db24d36917b9be63556dd8ee63ea4b1d082f8fd4a8b3edb3bae037ba4
7
+ data.tar.gz: 87f372ffc4bcef3f514aef73ae971d8a5dd8545d6bd7897770e7c69808c11fd7f0740afd0befe271ef49274720e91da5a92a4913cd108737bf2e1fbe99f1dd5e
@@ -1,80 +1,84 @@
1
+ AvoidColonsAtStartOfNames:
2
+ Enabled: true
3
+ AvoidCommaInTags:
4
+ Enabled: true
1
5
  AvoidOutlineForSingleExample:
2
- Enabled: true
6
+ Enabled: true
3
7
  AvoidFullStop:
4
- Enabled: true
8
+ Enabled: true
5
9
  AvoidScripting:
6
- Enabled: true
10
+ Enabled: true
7
11
  AvoidSplatStepsInBackground:
8
- Enabled: true
12
+ Enabled: true
9
13
  AvoidSplatStepsInScenarios:
10
- Enabled: true
14
+ Enabled: true
11
15
  AvoidTypographersQuotes:
12
- Enabled: true
16
+ Enabled: true
13
17
  BackgroundDoesMoreThanSetup:
14
- Enabled: true
18
+ Enabled: true
15
19
  BackgroundRequiresMultipleScenarios:
16
- Enabled: true
20
+ Enabled: true
17
21
  BadScenarioName:
18
- Enabled: true
22
+ Enabled: true
19
23
  EmptyFeatureFile:
20
- Enabled: true
24
+ Enabled: true
21
25
  FileNameDiffersFeatureName:
22
- Enabled: true
26
+ Enabled: true
23
27
  GivensAfterBackground:
24
- Enabled: true
28
+ Enabled: true
25
29
  MissingExampleName:
26
- Enabled: true
30
+ Enabled: true
27
31
  MissingExampleTable:
28
- Enabled: true
32
+ Enabled: true
29
33
  MissingFeatureDescription:
30
- Enabled: true
34
+ Enabled: true
31
35
  MissingFeatureName:
32
- Enabled: true
36
+ Enabled: true
33
37
  MissingScenarioName:
34
- Enabled: true
38
+ Enabled: true
35
39
  MissingScenarioOutline:
36
- Enabled: true
40
+ Enabled: true
37
41
  MissingTestAction:
38
- Enabled: true
42
+ Enabled: true
39
43
  MissingVerification:
40
- Enabled: true
44
+ Enabled: true
41
45
  InconsistentQuoting:
42
- Enabled: true
46
+ Enabled: true
43
47
  InvalidFileName:
44
- Enabled: true
48
+ Enabled: true
45
49
  InvalidStepFlow:
46
- Enabled: true
50
+ Enabled: true
47
51
  RequiredTagsStartsWith:
48
- Enabled: false
52
+ Enabled: false
49
53
  SameTagDifferentCase:
50
- Enabled: true
54
+ Enabled: true
51
55
  SameTagForAllScenarios:
52
- Enabled: true
56
+ Enabled: true
53
57
  ScenarioNamesMatch:
54
- Enabled: false
58
+ Enabled: false
55
59
  TagUsedMultipleTimes:
56
- Enabled: true
60
+ Enabled: true
57
61
  TooClumsy:
58
- Enabled: true
62
+ Enabled: true
59
63
  TooManyDifferentTags:
60
- Enabled: true
61
- MaxCount: 3
64
+ Enabled: true
65
+ MaxCount: 3
62
66
  TooManySteps:
63
- Enabled: true
64
- MaxCount: 10
67
+ Enabled: true
68
+ MaxCount: 10
65
69
  TooManyTags:
66
- Enabled: true
67
- MaxCount: 3
70
+ Enabled: true
71
+ MaxCount: 3
68
72
  TooLongStep:
69
- Enabled: true
70
- MaxLength: 80
73
+ Enabled: true
74
+ MaxLength: 80
71
75
  UniqueScenarioNames:
72
- Enabled: true
76
+ Enabled: true
73
77
  UnknownVariable:
74
- Enabled: true
78
+ Enabled: true
75
79
  UnusedVariable:
76
- Enabled: true
80
+ Enabled: true
77
81
  UseBackground:
78
- Enabled: true
82
+ Enabled: true
79
83
  UseOutline:
80
- Enabled: true
84
+ Enabled: true
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chutney
4
+ # service class to lint for avoiding colons at the start of names
5
+ class AvoidColonsAtStartOfNames < Linter
6
+ def lint
7
+ add_issue(I18n.t('linters.avoid_colons_at_start_of_names'), feature) if feature.name.start_with? ':'
8
+
9
+ scenarios do |_feature, scenario|
10
+ if scenario.name.start_with? ':'
11
+ add_issue(I18n.t('linters.avoid_colons_at_start_of_names'), feature,
12
+ scenario)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -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
@@ -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) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chutney
4
- VERSION = '3.8.2'
4
+ VERSION = '3.10.0'
5
5
  end
data/lib/chutney.rb CHANGED
@@ -4,6 +4,8 @@ require 'amatch'
4
4
 
5
5
  require 'chutney/configuration'
6
6
  require 'chutney/linter'
7
+ require 'chutney/linter/avoid_colons_at_start_of_names'
8
+ require 'chutney/linter/avoid_comma_in_tags'
7
9
  require 'chutney/linter/avoid_full_stop'
8
10
  require 'chutney/linter/avoid_outline_for_single_example'
9
11
  require 'chutney/linter/avoid_scripting'
@@ -3,6 +3,10 @@
3
3
  # God save the Queen, etc. etc.
4
4
  en:
5
5
  linters:
6
+ avoid_colons_at_start_of_names: >-
7
+ Avoid using colons at the start of names, it can make them hard to read or find.
8
+ avoid_comma_in_tags: >-
9
+ Avoid using commas in tags. Tags should be separated by spaces.
6
10
  avoid_full_stop: >- # https://en.wikipedia.org/wiki/Full_stop
7
11
  Avoid using a full-stop in steps so that it is easier to re-use them.
8
12
  avoid_outline_for_single_example: >-
@@ -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"
@@ -29,6 +29,10 @@ sidebar:
29
29
 
30
30
  - title: "Rules"
31
31
  children:
32
+ - title: "Avoid colons at start of names"
33
+ url: /docs/rules/avoid-colons-at-start-of-names/
34
+ - title: "Avoid comma in tags"
35
+ url: /docs/rules/avoid-comma-in-tags/
32
36
  - title: "Avoid full stops"
33
37
  url: /docs/rules/avoid-full-stops/
34
38
  - title: "Avoid outline for single example"
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: "Avoid Colons at Start of Names"
3
+ layout: single
4
+ permalink: /docs/rules/avoid-colons-at-start-of-names/
5
+ ---
6
+
7
+ Don't have colons at the start of feature or scenario names. It's probably a mistake if you have them from double typing the colon after the `Feature` or `Scenario` keyword.
8
+
9
+
10
+ ## Bad
11
+
12
+ ```gherkin
13
+ Feature: :My Feature
14
+ Scenario: :My Scenario
15
+ Given I have visited the website
16
+ When I log in
17
+ Then I will see my account
18
+ ```
19
+
20
+ ## Good
21
+
22
+ ```gherkin
23
+ Feature: My Feature
24
+ Scenario: My Scenario
25
+ Given I have visited the website
26
+ When I log in
27
+ Then I will see my account
28
+ ```
@@ -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.8.2
4
+ version: 3.10.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-10-10 00:00:00.000000000 Z
14
+ date: 2024-11-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: amatch
@@ -155,6 +155,8 @@ 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_colons_at_start_of_names.rb
159
+ - lib/chutney/linter/avoid_comma_in_tags.rb
158
160
  - lib/chutney/linter/avoid_full_stop.rb
159
161
  - lib/chutney/linter/avoid_outline_for_single_example.rb
160
162
  - lib/chutney/linter/avoid_scripting.rb
@@ -213,6 +215,8 @@ files:
213
215
  - usechutney.com/docs/disabling-rules/index.md
214
216
  - usechutney.com/docs/installing/index.md
215
217
  - usechutney.com/docs/language-server/index.md
218
+ - usechutney.com/docs/rules/avoid-colons-at-start-of-names/index.md
219
+ - usechutney.com/docs/rules/avoid-comma-in-tags/index.md
216
220
  - usechutney.com/docs/rules/avoid-full-stops/index.md
217
221
  - usechutney.com/docs/rules/avoid-outline-for-single-example/index.md
218
222
  - usechutney.com/docs/rules/avoid-scripting/index.md
@@ -277,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
281
  - !ruby/object:Gem::Version
278
282
  version: '0'
279
283
  requirements: []
280
- rubygems_version: 3.5.11
284
+ rubygems_version: 3.5.23
281
285
  signing_key:
282
286
  specification_version: 4
283
287
  summary: A linter for multi-lingual Gherkin