chutney 2.0.3.1 → 2.1.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: e2638bbebf9e9f48bf42c2871d2c5c3ef4a13b06bd67d3c52096fd270135e759
4
- data.tar.gz: 18c502227f4918d434dc876fd3548bd532218b2e3250f94cdd33b4860119eea2
3
+ metadata.gz: 9b678f90aea391f8707bda58ec5e2f6caf9b5d1f1bf5b1503c6862d4023d5f18
4
+ data.tar.gz: ecb2e762fa06c882869ff007e80261137816f431a78c07257d2f140e8f8f6f78
5
5
  SHA512:
6
- metadata.gz: e5ca617c4feec58478cef5f00784e52425b79489cac43244824019e1ab7e7f7136dc4a7f355175282e55e634fb924ebd52a69400dfadace0bf140c824aa8a922
7
- data.tar.gz: 4effe41d2b7d6213aff06a4083d78b57461366f540508c1ad946028a6c19d3e96f77411bc134e82de337a3fcdf376faf7fde96d7475fe82ab05a6c5d36b40b66
6
+ metadata.gz: 5f1f5c793a5d0080320606d56471f8ebcb7b0c3ceedca3e5e492eb877d1f0582aef997cd686c9e4782afeff407fb0346a0acbee288bca7306b39f2d8dc951540
7
+ data.tar.gz: 362d6bf5c6a1cb8c14a005534259e0ad5592df046a6dc3f747562b0b1875ee22e19b2076ff60873ca54967e2bd2188513566c36d0433ccd1c886fbc73b5c71ab
data/.rufo ADDED
@@ -0,0 +1 @@
1
+ quote_style :single
@@ -51,10 +51,11 @@ Gem::Specification.new do |spec|
51
51
 
52
52
  spec.add_development_dependency 'coveralls', '~> 0.8'
53
53
  spec.add_development_dependency 'cucumber', '~> 3.0'
54
+ spec.add_development_dependency 'pry-byebug', '~> 3.0'
54
55
  spec.add_development_dependency 'rake', '~> 13.0'
55
56
  spec.add_development_dependency 'rerun', '~> 0.13'
56
57
  spec.add_development_dependency 'rspec-expectations', '~> 3.0'
57
- spec.add_development_dependency 'rubocop', '~> 0.82.0'
58
+ spec.add_development_dependency 'rubocop', '~> 0.85.1'
58
59
  spec.add_development_dependency 'rspec', '~> 3.8'
59
60
 
60
61
  end
@@ -4,6 +4,8 @@ AvoidFullStop:
4
4
  Enabled: true
5
5
  AvoidScripting:
6
6
  Enabled: true
7
+ AvoidTypographersQuotes:
8
+ Enabled: true
7
9
  BackgroundDoesMoreThanSetup:
8
10
  Enabled: true
9
11
  BackgroundRequiresMultipleScenarios:
@@ -4,6 +4,7 @@ require 'chutney/linter'
4
4
  require 'chutney/linter/avoid_full_stop'
5
5
  require 'chutney/linter/avoid_outline_for_single_example'
6
6
  require 'chutney/linter/avoid_scripting'
7
+ require 'chutney/linter/avoid_typographers_quotes'
7
8
  require 'chutney/linter/background_does_more_than_setup'
8
9
  require 'chutney/linter/background_requires_multiple_scenarios'
9
10
  require 'chutney/linter/bad_scenario_name'
@@ -0,0 +1,37 @@
1
+ module Chutney
2
+ # service class to lint for avoid scripting
3
+ class AvoidTypographersQuotes < Linter
4
+ TYPOGRAPHER_QUOTES = ["\u201c", "\u201d", "\u2018", "\u2019"].map(&:encode)
5
+
6
+ def lint
7
+ scenarios do |_feature, scenario|
8
+ lint_steps(scenario[:steps])
9
+
10
+ example_count = scenario[:examples]&.length || 0
11
+ next unless example_count.positive?
12
+
13
+ lint_examples(scenario[:examples])
14
+ end
15
+ end
16
+
17
+ def lint_steps(steps)
18
+ steps.each do |step|
19
+ issue(step) if TYPOGRAPHER_QUOTES.any? { |tq| step[:text].include? tq }
20
+ end
21
+ end
22
+
23
+ def lint_examples(examples)
24
+ examples.each do |example|
25
+ example[:tableBody].each do |body|
26
+ body[:cells].each do |cell|
27
+ issue(cell) if TYPOGRAPHER_QUOTES.any? { |tq| cell[:value].include? tq }
28
+ end
29
+ end
30
+ end
31
+ end
32
+
33
+ def issue(location)
34
+ add_issue(I18n.t('linters.avoid_typographers_quotes'), location)
35
+ end
36
+ end
37
+ end
@@ -1,3 +1,3 @@
1
1
  module Chutney
2
- VERSION = '2.0.3.1'.freeze
2
+ VERSION = '2.1.0'.freeze
3
3
  end
@@ -11,6 +11,10 @@ en:
11
11
  avoid_scripting: >-
12
12
  You have %{count} When steps when you should only have one.
13
13
  Be careful not to add And steps following a When.
14
+ avoid_typographers_quotes: >-
15
+ You are using typographers quotation marks (curly quotes).
16
+ Make sure you intend to use this character and not a neutral quote
17
+ (straight quote) instead.
14
18
  background_does_more_than_setup: >-
15
19
  The Background does more than setup. It should only contain Given steps.
16
20
  background_requires_multiple_scenarios: >-
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chutney
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nigel Brookes-Thomas
8
8
  - Stefan Rohe
9
9
  - Nishtha Argawal
10
10
  - John Gluck
11
- autorequire:
11
+ autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2020-04-28 00:00:00.000000000 Z
14
+ date: 2020-07-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: amatch
@@ -111,6 +111,20 @@ dependencies:
111
111
  - - "~>"
112
112
  - !ruby/object:Gem::Version
113
113
  version: '3.0'
114
+ - !ruby/object:Gem::Dependency
115
+ name: pry-byebug
116
+ requirement: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - "~>"
119
+ - !ruby/object:Gem::Version
120
+ version: '3.0'
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - "~>"
126
+ - !ruby/object:Gem::Version
127
+ version: '3.0'
114
128
  - !ruby/object:Gem::Dependency
115
129
  name: rake
116
130
  requirement: !ruby/object:Gem::Requirement
@@ -159,14 +173,14 @@ dependencies:
159
173
  requirements:
160
174
  - - "~>"
161
175
  - !ruby/object:Gem::Version
162
- version: 0.82.0
176
+ version: 0.85.1
163
177
  type: :development
164
178
  prerelease: false
165
179
  version_requirements: !ruby/object:Gem::Requirement
166
180
  requirements:
167
181
  - - "~>"
168
182
  - !ruby/object:Gem::Version
169
- version: 0.82.0
183
+ version: 0.85.1
170
184
  - !ruby/object:Gem::Dependency
171
185
  name: rspec
172
186
  requirement: !ruby/object:Gem::Requirement
@@ -195,6 +209,7 @@ files:
195
209
  - ".gitignore"
196
210
  - ".rspec"
197
211
  - ".rubocop.yml"
212
+ - ".rufo"
198
213
  - Gemfile
199
214
  - LICENSE.txt
200
215
  - README.md
@@ -228,6 +243,7 @@ files:
228
243
  - lib/chutney/linter/avoid_full_stop.rb
229
244
  - lib/chutney/linter/avoid_outline_for_single_example.rb
230
245
  - lib/chutney/linter/avoid_scripting.rb
246
+ - lib/chutney/linter/avoid_typographers_quotes.rb
231
247
  - lib/chutney/linter/background_does_more_than_setup.rb
232
248
  - lib/chutney/linter/background_requires_multiple_scenarios.rb
233
249
  - lib/chutney/linter/bad_scenario_name.rb
@@ -266,7 +282,7 @@ metadata:
266
282
  homepage_uri: https://billyruffian.github.io/chutney/
267
283
  source_code_uri: https://github.com/BillyRuffian/chutney
268
284
  changelog_uri: https://github.com/BillyRuffian/chutney/releases
269
- post_install_message:
285
+ post_install_message:
270
286
  rdoc_options: []
271
287
  require_paths:
272
288
  - lib
@@ -282,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
298
  version: '0'
283
299
  requirements: []
284
300
  rubygems_version: 3.1.2
285
- signing_key:
301
+ signing_key:
286
302
  specification_version: 4
287
303
  summary: A linter for English language Gherkin
288
304
  test_files: []