cuke_linter 0.11.0 → 0.11.1

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: 2262e2bfc35fa228578832a6dcaaf98c414ae641316de99c0e4123d58951bbf6
4
- data.tar.gz: 02334cd45f28a225cef180e451f95eac230bcbc7912ae41637e6e999abe539f8
3
+ metadata.gz: 05f9639710a8ee90502992efd3bf5a0cd23d989e10f8b2699ca2120c25729c64
4
+ data.tar.gz: 6aeae6c4a917210bc09de39b0d751de4c0c15c929478dd362f65c6ac3e88dc70
5
5
  SHA512:
6
- metadata.gz: 93e8b329df051721fd6ca9405740863ca4c8bcee606cbfe33854ad9d57e63bb4d5c3da99c0a4345d349e77f3adb39d676cec088ed469a557f44c90dcff1b6111
7
- data.tar.gz: 31bdfa3dcb5dd22066b481aa45d9499b2f5c96a2f31f79581a8c1d2afa5d0d2d136ef247199e2ee5846914779f6955fad373ce9783bf7c4907ad6df4102c621e
6
+ metadata.gz: 6e11d0529be4f2202de3f98bf2cf7149822fd2378f5ec18de2b4c2a0cbdc56f7b8534614de911ffd570823e4faf0ffb06ceed31df392a37ab7911c1edd1c3715
7
+ data.tar.gz: c5152f78a6092267fe7050445c72864807cd70ce61af044292c5af3be5a91e180d236680ca3e3622795417d08e1c47ada1bbfcaf8cb99a7607df8a22f91e5885
data/CHANGELOG.md CHANGED
@@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
 
9
9
  Nothing yet... *(see development branch)*
10
10
 
11
+
12
+ ## [0.11.1] - 2019-11-07
13
+
14
+ ### Fixed
15
+ - Fixed the Pretty formatter so that it can handle linting problems whose locations do not have a line number.
16
+
17
+
11
18
  ## [0.11.0] - 2019-11-01
12
19
 
13
20
  ### Added
@@ -112,7 +119,8 @@ Nothing yet... *(see development branch)*
112
119
  - Custom linters, formatters, and command line usability
113
120
 
114
121
 
115
- [Unreleased]: https://github.com/enkessler/cuke_linter/compare/v0.11.0...HEAD
122
+ [Unreleased]: https://github.com/enkessler/cuke_linter/compare/v0.11.1...HEAD
123
+ [0.11.1]: https://github.com/enkessler/cuke_linter/compare/v0.11.0...v0.11.1
116
124
  [0.11.0]: https://github.com/enkessler/cuke_linter/compare/v0.10.0...v0.11.0
117
125
  [0.10.0]: https://github.com/enkessler/cuke_linter/compare/v0.9.0...v0.10.0
118
126
  [0.9.0]: https://github.com/enkessler/cuke_linter/compare/v0.8.0...v0.9.0
@@ -21,10 +21,10 @@ module CukeLinter
21
21
  formatted_data << " #{problem}" + "\n"
22
22
 
23
23
  sorted_locations = locations.sort do |a, b|
24
- file_name_1 = a.match(/(.*):\d+$/)[1]
25
- line_number_1 = a.match(/:(\d+)$/)[1].to_i
26
- file_name_2 = b.match(/(.*):\d+$/)[1]
27
- line_number_2 = b.match(/:(\d+)$/)[1].to_i
24
+ file_name_1 = a.match(/(.*?)(?::\d+)?$/)[1]
25
+ line_number_1 = a.match(/:(\d+)$/) ? a.match(/:(\d+)$/)[1].to_i : 0
26
+ file_name_2 = b.match(/(.*?)(?::\d+)?$/)[1]
27
+ line_number_2 = b.match(/:(\d+)$/) ? b.match(/:(\d+)$/)[1].to_i : 0
28
28
 
29
29
  case
30
30
  when (file_name_1 < file_name_2) ||
@@ -1,4 +1,4 @@
1
1
  module CukeLinter
2
2
  # The release version of this gem
3
- VERSION = '0.11.0'
3
+ VERSION = '0.11.1'
4
4
  end
@@ -12,7 +12,10 @@ RSpec.describe CukeLinter::PrettyFormatter do
12
12
  location: 'path/to/the_file:1' },
13
13
  { linter: 'SomeOtherLinter',
14
14
  problem: 'Some other problem',
15
- location: 'path/to/the_file:1' }]
15
+ location: 'path/to/the_file:1' },
16
+ { linter: 'YetAnotherLinter',
17
+ problem: 'Yet another problem',
18
+ location: 'path/to/the_file' }]
16
19
 
17
20
  results = subject.format(linting_data)
18
21
 
@@ -22,8 +25,11 @@ RSpec.describe CukeLinter::PrettyFormatter do
22
25
  'SomeOtherLinter',
23
26
  ' Some other problem',
24
27
  ' path/to/the_file:1',
28
+ 'YetAnotherLinter',
29
+ ' Yet another problem',
30
+ ' path/to/the_file',
25
31
  '',
26
- '2 issues found'].join("\n"))
32
+ '3 issues found'].join("\n"))
27
33
  end
28
34
 
29
35
  it 'groups data by linter and problem' do
@@ -50,7 +56,7 @@ RSpec.describe CukeLinter::PrettyFormatter do
50
56
  '3 issues found'].join("\n"))
51
57
  end
52
58
 
53
- it 'orders violations within the same category by file path' do
59
+ it 'orders violations within the same problem category by file path' do
54
60
  linting_data = [{ linter: 'SomeLinter',
55
61
  problem: 'Some problem',
56
62
  location: 'path/to/the_file:1' },
@@ -85,6 +91,9 @@ RSpec.describe CukeLinter::PrettyFormatter do
85
91
  { linter: 'SomeLinter',
86
92
  problem: 'Some problem',
87
93
  location: 'path/to/the_file:3' }, # duplicate number
94
+ { linter: 'SomeLinter',
95
+ problem: 'Some problem',
96
+ location: 'path/to/the_file' }, # no number
88
97
  { linter: 'SomeLinter',
89
98
  problem: 'Some problem',
90
99
  location: 'path/to/the_file:1' }]
@@ -93,13 +102,14 @@ RSpec.describe CukeLinter::PrettyFormatter do
93
102
 
94
103
  expect(results).to eq(['SomeLinter',
95
104
  ' Some problem',
105
+ ' path/to/the_file',
96
106
  ' path/to/the_file:1',
97
107
  ' path/to/the_file:2',
98
108
  ' path/to/the_file:3',
99
109
  ' path/to/the_file:3',
100
110
  ' path/to/the_file:11',
101
111
  '',
102
- '5 issues found'].join("\n"))
112
+ '6 issues found'].join("\n"))
103
113
  end
104
114
 
105
115
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuke_linter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kessler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-01 00:00:00.000000000 Z
11
+ date: 2019-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cuke_modeler