cucumber_lint 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/features/cucumber_lint/consistent_empty_lines/{between_description_and_element.feature → between_description_and_element/non_zero_between_feature_and_description.feature} +3 -27
- data/features/cucumber_lint/consistent_empty_lines/between_description_and_element/with_tag.feature +44 -0
- data/features/cucumber_lint/consistent_empty_lines/{between_feature_and_description.feature → between_description_and_element/zero_between_feature_and_description.feature} +13 -6
- data/features/cucumber_lint/consistent_empty_lines/between_elements/with_tag.feature +45 -0
- data/features/cucumber_lint/consistent_empty_lines/{between_feature_and_element.feature → between_feature_and_element/basic.feature} +0 -0
- data/features/cucumber_lint/consistent_empty_lines/between_feature_and_element/with_tag.feature +37 -0
- data/features/step_definitions/env.rb +1 -0
- data/lib/cucumber_lint/cli.rb +1 -0
- data/lib/cucumber_lint/linted_file.rb +2 -0
- data/lib/cucumber_lint/linter/feature_empty_lines_linter.rb +10 -1
- data/lib/cucumber_lint/linter/feature_linter.rb +1 -0
- data/lib/cucumber_lint/linter/table_linter.rb +1 -0
- data/lib/cucumber_lint/version.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14c5f7a327e02199b8c85472fa18939f9e2b1e13
|
4
|
+
data.tar.gz: 0729a48fa5bf275c74de17815e39c05b76129160
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51b6e6b7d97f8d5f80b08b39bdf7c1a74fd03a8e3050bcdaf43736fe77628cf655ae3c6e4b6a22a90c0193000a0de081a48bf9f142a99117b0307384fc158f87
|
7
|
+
data.tar.gz: 41382370be1888ce0d6cb4e3dea6a21672dc9d8e671bcf6e4c18332a5e12ad3f7109bc15fa9623f42f04e58216afc40f8bd30d233e0fcfc18b65a950c8ba2022
|
data/Gemfile.lock
CHANGED
@@ -4,6 +4,7 @@ Feature: consistent_empty_lines between description and element
|
|
4
4
|
Given I have a feature with content
|
5
5
|
"""
|
6
6
|
Feature: Test Feature
|
7
|
+
|
7
8
|
As a user
|
8
9
|
When I have this
|
9
10
|
I expect that
|
@@ -21,35 +22,11 @@ Feature: consistent_empty_lines between description and element
|
|
21
22
|
Given I have "consistent_empty_lines" enabled with
|
22
23
|
| KEY | VALUE |
|
23
24
|
| between_description_and_element | 1 |
|
24
|
-
When I run `cucumber_lint`
|
25
|
-
Then it fails with
|
26
|
-
| LINE | MESSAGE |
|
27
|
-
| 5 | Add empty line |
|
28
|
-
When I run `cucumber_lint --fix`
|
29
|
-
Then my feature now has content
|
30
|
-
"""
|
31
|
-
Feature: Test Feature
|
32
|
-
As a user
|
33
|
-
When I have this
|
34
|
-
I expect that
|
35
|
-
|
36
|
-
Scenario: Test Scenario
|
37
|
-
Given this
|
38
|
-
Then that
|
39
|
-
"""
|
40
|
-
When I run `cucumber_lint`
|
41
|
-
Then it passes
|
42
|
-
|
43
|
-
Scenario: lint and fix (with non-zero between feature and description)
|
44
|
-
Given I have "consistent_empty_lines" enabled with
|
45
|
-
| KEY | VALUE |
|
46
|
-
| between_description_and_element | 2 |
|
47
25
|
| between_feature_and_description | 1 |
|
48
26
|
When I run `cucumber_lint`
|
49
27
|
Then it fails with
|
50
|
-
| LINE | MESSAGE
|
51
|
-
|
|
52
|
-
| 5 | Add 2 empty lines |
|
28
|
+
| LINE | MESSAGE |
|
29
|
+
| 6 | Add empty line |
|
53
30
|
When I run `cucumber_lint --fix`
|
54
31
|
Then my feature now has content
|
55
32
|
"""
|
@@ -59,7 +36,6 @@ Feature: consistent_empty_lines between description and element
|
|
59
36
|
When I have this
|
60
37
|
I expect that
|
61
38
|
|
62
|
-
|
63
39
|
Scenario: Test Scenario
|
64
40
|
Given this
|
65
41
|
Then that
|
data/features/cucumber_lint/consistent_empty_lines/between_description_and_element/with_tag.feature
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
Feature: consistent_empty_lines between description and element
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given I have a feature with content
|
5
|
+
"""
|
6
|
+
Feature: Test Feature
|
7
|
+
As a user
|
8
|
+
When I have this
|
9
|
+
I expect that
|
10
|
+
@tag
|
11
|
+
Scenario: Test Scenario
|
12
|
+
Given this
|
13
|
+
Then that
|
14
|
+
"""
|
15
|
+
|
16
|
+
Scenario: disabled
|
17
|
+
Given I have "consistent_empty_lines" disabled
|
18
|
+
When I run `cucumber_lint`
|
19
|
+
Then it passes
|
20
|
+
|
21
|
+
Scenario: lint and fix
|
22
|
+
Given I have "consistent_empty_lines" enabled with
|
23
|
+
| KEY | VALUE |
|
24
|
+
| between_description_and_element | 1 |
|
25
|
+
| between_feature_and_description | 0 |
|
26
|
+
When I run `cucumber_lint`
|
27
|
+
Then it fails with
|
28
|
+
| LINE | MESSAGE |
|
29
|
+
| 5 | Add empty line |
|
30
|
+
When I run `cucumber_lint --fix`
|
31
|
+
Then my feature now has content
|
32
|
+
"""
|
33
|
+
Feature: Test Feature
|
34
|
+
As a user
|
35
|
+
When I have this
|
36
|
+
I expect that
|
37
|
+
|
38
|
+
@tag
|
39
|
+
Scenario: Test Scenario
|
40
|
+
Given this
|
41
|
+
Then that
|
42
|
+
"""
|
43
|
+
When I run `cucumber_lint`
|
44
|
+
Then it passes
|
@@ -1,13 +1,15 @@
|
|
1
|
-
Feature: consistent_empty_lines between
|
1
|
+
Feature: consistent_empty_lines between description and element
|
2
2
|
|
3
3
|
Background:
|
4
4
|
Given I have a feature with content
|
5
5
|
"""
|
6
6
|
Feature: Test Feature
|
7
|
-
|
8
7
|
As a user
|
9
8
|
When I have this
|
10
9
|
I expect that
|
10
|
+
Scenario: Test Scenario
|
11
|
+
Given this
|
12
|
+
Then that
|
11
13
|
"""
|
12
14
|
|
13
15
|
Scenario: disabled
|
@@ -17,12 +19,13 @@ Feature: consistent_empty_lines between feature and description
|
|
17
19
|
|
18
20
|
Scenario: lint and fix
|
19
21
|
Given I have "consistent_empty_lines" enabled with
|
20
|
-
| KEY
|
21
|
-
|
|
22
|
+
| KEY | VALUE |
|
23
|
+
| between_description_and_element | 1 |
|
24
|
+
| between_feature_and_description | 0 |
|
22
25
|
When I run `cucumber_lint`
|
23
26
|
Then it fails with
|
24
|
-
| LINE | MESSAGE
|
25
|
-
|
|
27
|
+
| LINE | MESSAGE |
|
28
|
+
| 5 | Add empty line |
|
26
29
|
When I run `cucumber_lint --fix`
|
27
30
|
Then my feature now has content
|
28
31
|
"""
|
@@ -30,6 +33,10 @@ Feature: consistent_empty_lines between feature and description
|
|
30
33
|
As a user
|
31
34
|
When I have this
|
32
35
|
I expect that
|
36
|
+
|
37
|
+
Scenario: Test Scenario
|
38
|
+
Given this
|
39
|
+
Then that
|
33
40
|
"""
|
34
41
|
When I run `cucumber_lint`
|
35
42
|
Then it passes
|
@@ -0,0 +1,45 @@
|
|
1
|
+
Feature: consistent_empty_lines between elements (with tag)
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given I have a feature with content
|
5
|
+
"""
|
6
|
+
Feature: Test Feature
|
7
|
+
|
8
|
+
Scenario: Test Scenario
|
9
|
+
Given this
|
10
|
+
Then that
|
11
|
+
@tag
|
12
|
+
Scenario: Test Scenario
|
13
|
+
Given this
|
14
|
+
Then that
|
15
|
+
"""
|
16
|
+
|
17
|
+
Scenario: disabled
|
18
|
+
Given I have "consistent_empty_lines" disabled
|
19
|
+
When I run `cucumber_lint`
|
20
|
+
Then it passes
|
21
|
+
|
22
|
+
Scenario: lint and fix
|
23
|
+
Given I have "consistent_empty_lines" enabled with
|
24
|
+
| KEY | VALUE |
|
25
|
+
| between_elements | 1 |
|
26
|
+
When I run `cucumber_lint`
|
27
|
+
Then it fails with
|
28
|
+
| LINE | MESSAGE |
|
29
|
+
| 6 | Add empty line |
|
30
|
+
When I run `cucumber_lint --fix`
|
31
|
+
Then my feature now has content
|
32
|
+
"""
|
33
|
+
Feature: Test Feature
|
34
|
+
|
35
|
+
Scenario: Test Scenario
|
36
|
+
Given this
|
37
|
+
Then that
|
38
|
+
|
39
|
+
@tag
|
40
|
+
Scenario: Test Scenario
|
41
|
+
Given this
|
42
|
+
Then that
|
43
|
+
"""
|
44
|
+
When I run `cucumber_lint`
|
45
|
+
Then it passes
|
File without changes
|
data/features/cucumber_lint/consistent_empty_lines/between_feature_and_element/with_tag.feature
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
Feature: consistent_empty_lines between feature and element
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given I have a feature with content
|
5
|
+
"""
|
6
|
+
Feature: Test Feature
|
7
|
+
@tag
|
8
|
+
Scenario: Test Scenario
|
9
|
+
Given this
|
10
|
+
Then that
|
11
|
+
"""
|
12
|
+
|
13
|
+
Scenario: disabled
|
14
|
+
Given I have "consistent_empty_lines" disabled
|
15
|
+
When I run `cucumber_lint`
|
16
|
+
Then it passes
|
17
|
+
|
18
|
+
Scenario: lint and fix
|
19
|
+
Given I have "consistent_empty_lines" enabled with
|
20
|
+
| KEY | VALUE |
|
21
|
+
| between_feature_and_element | 1 |
|
22
|
+
When I run `cucumber_lint`
|
23
|
+
Then it fails with
|
24
|
+
| LINE | MESSAGE |
|
25
|
+
| 2 | Add empty line |
|
26
|
+
When I run `cucumber_lint --fix`
|
27
|
+
Then my feature now has content
|
28
|
+
"""
|
29
|
+
Feature: Test Feature
|
30
|
+
|
31
|
+
@tag
|
32
|
+
Scenario: Test Scenario
|
33
|
+
Given this
|
34
|
+
Then that
|
35
|
+
"""
|
36
|
+
When I run `cucumber_lint`
|
37
|
+
Then it passes
|
data/lib/cucumber_lint/cli.rb
CHANGED
@@ -33,6 +33,15 @@ module CucumberLint
|
|
33
33
|
end
|
34
34
|
|
35
35
|
|
36
|
+
def element_start element
|
37
|
+
if element.tags
|
38
|
+
element.tags[0].line
|
39
|
+
else
|
40
|
+
element.line
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
|
36
45
|
def expected_first_element_start
|
37
46
|
spacing = if @description == ''
|
38
47
|
config_value(:between_feature_and_element)
|
@@ -72,7 +81,7 @@ module CucumberLint
|
|
72
81
|
|
73
82
|
expected_element_start = expected_first_element_start
|
74
83
|
@feature.elements.each do |element|
|
75
|
-
resolve_empty_line_difference element
|
84
|
+
resolve_empty_line_difference element_start(element), expected_element_start
|
76
85
|
lint_scenario_outline_and_examples element if element.type == 'scenario_outline'
|
77
86
|
expected_element_start = element_end(element) + config_value(:between_elements) + 1
|
78
87
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- charlierudolph
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -73,13 +73,16 @@ files:
|
|
73
73
|
- config/default.yml
|
74
74
|
- cucumber.yml
|
75
75
|
- cucumber_lint.gemspec
|
76
|
-
- features/cucumber_lint/consistent_empty_lines/between_description_and_element.feature
|
76
|
+
- features/cucumber_lint/consistent_empty_lines/between_description_and_element/non_zero_between_feature_and_description.feature
|
77
|
+
- features/cucumber_lint/consistent_empty_lines/between_description_and_element/with_tag.feature
|
78
|
+
- features/cucumber_lint/consistent_empty_lines/between_description_and_element/zero_between_feature_and_description.feature
|
77
79
|
- features/cucumber_lint/consistent_empty_lines/between_elements/ending_with_docstring.feature
|
78
80
|
- features/cucumber_lint/consistent_empty_lines/between_elements/ending_with_examples.feature
|
79
81
|
- features/cucumber_lint/consistent_empty_lines/between_elements/ending_with_step.feature
|
80
82
|
- features/cucumber_lint/consistent_empty_lines/between_elements/ending_with_table.feature
|
81
|
-
- features/cucumber_lint/consistent_empty_lines/
|
82
|
-
- features/cucumber_lint/consistent_empty_lines/between_feature_and_element.feature
|
83
|
+
- features/cucumber_lint/consistent_empty_lines/between_elements/with_tag.feature
|
84
|
+
- features/cucumber_lint/consistent_empty_lines/between_feature_and_element/basic.feature
|
85
|
+
- features/cucumber_lint/consistent_empty_lines/between_feature_and_element/with_tag.feature
|
83
86
|
- features/cucumber_lint/consistent_table_headers/examples_table.feature
|
84
87
|
- features/cucumber_lint/consistent_table_headers/step_table.feature
|
85
88
|
- features/cucumber_lint/consistent_table_headers/unsupported_style.feature
|
@@ -130,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
133
|
version: '0'
|
131
134
|
requirements: []
|
132
135
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.4.
|
136
|
+
rubygems_version: 2.4.5
|
134
137
|
signing_key:
|
135
138
|
specification_version: 4
|
136
139
|
summary: A command line interface for linting and formatting cucumber features
|