cucumber-cucumber-expressions 16.1.2 → 17.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +27 -0
- data/.rubocop_todo.yml +524 -0
- data/Gemfile +2 -1
- data/Rakefile +4 -17
- data/VERSION +1 -1
- data/cucumber-cucumber-expressions.gemspec +11 -9
- data/lib/cucumber/cucumber_expressions/argument.rb +6 -3
- data/lib/cucumber/cucumber_expressions/ast.rb +24 -59
- data/lib/cucumber/cucumber_expressions/combinatorial_generated_expression_factory.rb +6 -13
- data/lib/cucumber/cucumber_expressions/cucumber_expression.rb +9 -11
- data/lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb +7 -11
- data/lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb +37 -53
- data/lib/cucumber/cucumber_expressions/cucumber_expression_tokenizer.rb +13 -18
- data/lib/cucumber/cucumber_expressions/errors.rb +119 -101
- data/lib/cucumber/cucumber_expressions/expression_factory.rb +2 -0
- data/lib/cucumber/cucumber_expressions/generated_expression.rb +2 -0
- data/lib/cucumber/cucumber_expressions/group.rb +2 -0
- data/lib/cucumber/cucumber_expressions/group_builder.rb +2 -0
- data/lib/cucumber/cucumber_expressions/parameter_type.rb +13 -23
- data/lib/cucumber/cucumber_expressions/parameter_type_matcher.rb +8 -6
- data/lib/cucumber/cucumber_expressions/parameter_type_registry.rb +23 -20
- data/lib/cucumber/cucumber_expressions/regular_expression.rb +3 -2
- data/lib/cucumber/cucumber_expressions/tree_regexp.rb +5 -4
- data/spec/cucumber/cucumber_expressions/argument_spec.rb +4 -2
- data/spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_test.rb +7 -6
- data/spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb +104 -101
- data/spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb +2 -0
- data/spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb +84 -87
- data/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb +3 -1
- data/spec/cucumber/cucumber_expressions/cucumber_expression_transformation_spec.rb +2 -0
- data/spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb +79 -60
- data/spec/cucumber/cucumber_expressions/expression_factory_spec.rb +2 -0
- data/spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb +43 -48
- data/spec/cucumber/cucumber_expressions/parameter_type_spec.rb +3 -1
- data/spec/cucumber/cucumber_expressions/regular_expression_spec.rb +37 -28
- data/spec/cucumber/cucumber_expressions/tree_regexp_spec.rb +23 -22
- metadata +21 -9
- data/.rspec +0 -1
- data/scripts/update-gemspec +0 -32
- data/spec/capture_warnings.rb +0 -74
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee78437294610438135eff4c78486fa4c034890d72212456fdb6b9e5d4d2221c
|
4
|
+
data.tar.gz: 433dabe226348a05dd14d9b36f57ed1c3ddd94c930e1f8e81332f9f1bb7659f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5a748f6a88bcc7b29c89ec6802f50fe1cab28740685f47ceb4e2cf53db64741006ea43dcb57d6bc420ad5a90d2fbb11f15a39fe0a596237ae1276926696fa6b
|
7
|
+
data.tar.gz: 51c50ce450733d911e8277e515fd1c7e0bd3621c065132e214fbb5b543965f6c873608b35b8436a8cccc87c49fab73d141bf731e2afe979e52c7819bb512e57f
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
inherit_mode:
|
4
|
+
merge:
|
5
|
+
- Exclude
|
6
|
+
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 2.5
|
9
|
+
NewCops: enable
|
10
|
+
|
11
|
+
# Disabled on our repo's to enable polyglot-release
|
12
|
+
Gemspec/RequireMFA:
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Layout/LineLength:
|
16
|
+
Max: 200
|
17
|
+
|
18
|
+
Style/Documentation:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
Style/RegexpLiteral:
|
22
|
+
EnforcedStyle: slashes
|
23
|
+
AllowInnerSlashes: true
|
24
|
+
|
25
|
+
# Once we enable rubocop-rspec
|
26
|
+
#RSpec/MessageSpies:
|
27
|
+
# EnforcedStyle: receive
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,524 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2023-10-06 11:04:10 UTC using RuboCop version 1.27.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# TODO: Oct '23 -> 33 files inspected, 1004 offenses detected, 859 offenses auto-correctable
|
10
|
+
# TODO: Oct '23 (later) -> 33 files inspected, 344 offenses detected, 205 offenses auto-correctable
|
11
|
+
|
12
|
+
# Offense count: 1
|
13
|
+
# This cop supports safe auto-correction (--auto-correct).
|
14
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
15
|
+
# SupportedStyles: outdent, indent
|
16
|
+
Layout/AccessModifierIndentation:
|
17
|
+
Exclude:
|
18
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb'
|
19
|
+
|
20
|
+
# Offense count: 2
|
21
|
+
# This cop supports safe auto-correction (--auto-correct).
|
22
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
23
|
+
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
|
24
|
+
Layout/FirstArrayElementIndentation:
|
25
|
+
Exclude:
|
26
|
+
- 'spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_test.rb'
|
27
|
+
|
28
|
+
# Offense count: 2
|
29
|
+
# This cop supports safe auto-correction (--auto-correct).
|
30
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
31
|
+
# SupportedStyles: special_inside_parentheses, consistent, align_braces
|
32
|
+
Layout/FirstHashElementIndentation:
|
33
|
+
Exclude:
|
34
|
+
- 'cucumber-cucumber-expressions.gemspec'
|
35
|
+
|
36
|
+
# Offense count: 4
|
37
|
+
# This cop supports safe auto-correction (--auto-correct).
|
38
|
+
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
39
|
+
# SupportedHashRocketStyles: key, separator, table
|
40
|
+
# SupportedColonStyles: key, separator, table
|
41
|
+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
42
|
+
Layout/HashAlignment:
|
43
|
+
Exclude:
|
44
|
+
- 'cucumber-cucumber-expressions.gemspec'
|
45
|
+
|
46
|
+
# Offense count: 2
|
47
|
+
# This cop supports safe auto-correction (--auto-correct).
|
48
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
49
|
+
# URISchemes: http, https
|
50
|
+
Layout/LineLength:
|
51
|
+
Max: 252
|
52
|
+
|
53
|
+
# Offense count: 1
|
54
|
+
# This cop supports safe auto-correction (--auto-correct).
|
55
|
+
# Configuration parameters: EnforcedStyle.
|
56
|
+
# SupportedStyles: symmetrical, new_line, same_line
|
57
|
+
Layout/MultilineMethodCallBraceLayout:
|
58
|
+
Exclude:
|
59
|
+
- 'spec/cucumber/cucumber_expressions/parameter_type_spec.rb'
|
60
|
+
|
61
|
+
# Offense count: 3
|
62
|
+
# This cop supports safe auto-correction (--auto-correct).
|
63
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
64
|
+
# SupportedStyles: aligned, indented, indented_relative_to_receiver
|
65
|
+
Layout/MultilineMethodCallIndentation:
|
66
|
+
Exclude:
|
67
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb'
|
68
|
+
|
69
|
+
# Offense count: 4
|
70
|
+
# This cop supports safe auto-correction (--auto-correct).
|
71
|
+
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
|
72
|
+
# SupportedStylesForExponentOperator: space, no_space
|
73
|
+
Layout/SpaceAroundOperators:
|
74
|
+
Exclude:
|
75
|
+
- 'lib/cucumber/cucumber_expressions/tree_regexp.rb'
|
76
|
+
|
77
|
+
# Offense count: 57
|
78
|
+
# This cop supports safe auto-correction (--auto-correct).
|
79
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
80
|
+
# SupportedStyles: space, no_space
|
81
|
+
# SupportedStylesForEmptyBraces: space, no_space
|
82
|
+
Layout/SpaceInsideBlockBraces:
|
83
|
+
Exclude:
|
84
|
+
- 'cucumber-cucumber-expressions.gemspec'
|
85
|
+
- 'lib/cucumber/cucumber_expressions/group_builder.rb'
|
86
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
|
87
|
+
- 'lib/cucumber/cucumber_expressions/regular_expression.rb'
|
88
|
+
- 'spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_test.rb'
|
89
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb'
|
90
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb'
|
91
|
+
- 'spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb'
|
92
|
+
- 'spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb'
|
93
|
+
- 'spec/cucumber/cucumber_expressions/parameter_type_spec.rb'
|
94
|
+
- 'spec/cucumber/cucumber_expressions/tree_regexp_spec.rb'
|
95
|
+
|
96
|
+
# Offense count: 1
|
97
|
+
# This cop supports safe auto-correction (--auto-correct).
|
98
|
+
Lint/AmbiguousOperatorPrecedence:
|
99
|
+
Exclude:
|
100
|
+
- 'lib/cucumber/cucumber_expressions/errors.rb'
|
101
|
+
|
102
|
+
# Offense count: 3
|
103
|
+
# Configuration parameters: AllowedMethods.
|
104
|
+
# AllowedMethods: enums
|
105
|
+
Lint/ConstantDefinitionInBlock:
|
106
|
+
Exclude:
|
107
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb'
|
108
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
|
109
|
+
|
110
|
+
# Offense count: 8
|
111
|
+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
|
112
|
+
Lint/DuplicateBranch:
|
113
|
+
Exclude:
|
114
|
+
- 'lib/cucumber/cucumber_expressions/ast.rb'
|
115
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
|
116
|
+
|
117
|
+
# Offense count: 10
|
118
|
+
# Configuration parameters: AllowComments.
|
119
|
+
Lint/EmptyClass:
|
120
|
+
Exclude:
|
121
|
+
- 'spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_test.rb'
|
122
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb'
|
123
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
|
124
|
+
- 'spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb'
|
125
|
+
|
126
|
+
# Offense count: 1
|
127
|
+
Lint/MixedRegexpCaptureTypes:
|
128
|
+
Exclude:
|
129
|
+
- 'spec/cucumber/cucumber_expressions/tree_regexp_spec.rb'
|
130
|
+
|
131
|
+
# Offense count: 1
|
132
|
+
# This cop supports unsafe auto-correction (--auto-correct-all).
|
133
|
+
Lint/NonDeterministicRequireOrder:
|
134
|
+
Exclude:
|
135
|
+
- 'Rakefile'
|
136
|
+
|
137
|
+
# Offense count: 1
|
138
|
+
Lint/NonLocalExitFromIterator:
|
139
|
+
Exclude:
|
140
|
+
- 'lib/cucumber/cucumber_expressions/combinatorial_generated_expression_factory.rb'
|
141
|
+
|
142
|
+
# Offense count: 7
|
143
|
+
# Configuration parameters: AllowKeywordBlockArguments.
|
144
|
+
Lint/UnderscorePrefixedVariableName:
|
145
|
+
Exclude:
|
146
|
+
- 'lib/cucumber/cucumber_expressions/ast.rb'
|
147
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
|
148
|
+
- 'lib/cucumber/cucumber_expressions/group.rb'
|
149
|
+
|
150
|
+
# Offense count: 14
|
151
|
+
# This cop supports safe auto-correction (--auto-correct).
|
152
|
+
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
|
153
|
+
Lint/UnusedBlockArgument:
|
154
|
+
Exclude:
|
155
|
+
- 'spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_test.rb'
|
156
|
+
- 'spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb'
|
157
|
+
|
158
|
+
# Offense count: 10
|
159
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
160
|
+
Metrics/AbcSize:
|
161
|
+
Max: 59
|
162
|
+
|
163
|
+
# Offense count: 11
|
164
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
165
|
+
# IgnoredMethods: refine
|
166
|
+
Metrics/BlockLength:
|
167
|
+
Max: 183
|
168
|
+
|
169
|
+
# Offense count: 1
|
170
|
+
# Configuration parameters: CountBlocks.
|
171
|
+
Metrics/BlockNesting:
|
172
|
+
Max: 4
|
173
|
+
|
174
|
+
# Offense count: 1
|
175
|
+
# Configuration parameters: CountComments, CountAsOne.
|
176
|
+
Metrics/ClassLength:
|
177
|
+
Max: 141
|
178
|
+
|
179
|
+
# Offense count: 7
|
180
|
+
# Configuration parameters: IgnoredMethods.
|
181
|
+
Metrics/CyclomaticComplexity:
|
182
|
+
Max: 15
|
183
|
+
|
184
|
+
# Offense count: 20
|
185
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
186
|
+
Metrics/MethodLength:
|
187
|
+
Max: 61
|
188
|
+
|
189
|
+
# Offense count: 4
|
190
|
+
# Configuration parameters: CountComments, CountAsOne.
|
191
|
+
Metrics/ModuleLength:
|
192
|
+
Max: 184
|
193
|
+
|
194
|
+
# Offense count: 1
|
195
|
+
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
196
|
+
Metrics/ParameterLists:
|
197
|
+
Max: 6
|
198
|
+
|
199
|
+
# Offense count: 6
|
200
|
+
# Configuration parameters: IgnoredMethods.
|
201
|
+
Metrics/PerceivedComplexity:
|
202
|
+
Max: 17
|
203
|
+
|
204
|
+
# Offense count: 10
|
205
|
+
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
206
|
+
Naming/BlockParameterName:
|
207
|
+
Exclude:
|
208
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
|
209
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
|
210
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_matcher.rb'
|
211
|
+
|
212
|
+
# Offense count: 2
|
213
|
+
# Configuration parameters: ForbiddenDelimiters.
|
214
|
+
# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
|
215
|
+
Naming/HeredocDelimiterNaming:
|
216
|
+
Exclude:
|
217
|
+
- 'lib/cucumber/cucumber_expressions/errors.rb'
|
218
|
+
|
219
|
+
# Offense count: 7
|
220
|
+
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
221
|
+
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
|
222
|
+
Naming/MethodParameterName:
|
223
|
+
Exclude:
|
224
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb'
|
225
|
+
- 'lib/cucumber/cucumber_expressions/tree_regexp.rb'
|
226
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
|
227
|
+
- 'spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb'
|
228
|
+
|
229
|
+
# Offense count: 3
|
230
|
+
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
|
231
|
+
# NamePrefix: is_, has_, have_
|
232
|
+
# ForbiddenPrefixes: is_, has_, have_
|
233
|
+
# AllowedMethods: is_a?
|
234
|
+
# MethodDefinitionMacros: define_method, define_singleton_method
|
235
|
+
Naming/PredicateName:
|
236
|
+
Exclude:
|
237
|
+
- 'lib/cucumber/cucumber_expressions/ast.rb'
|
238
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type.rb'
|
239
|
+
- 'lib/cucumber/cucumber_expressions/tree_regexp.rb'
|
240
|
+
|
241
|
+
# Offense count: 20
|
242
|
+
# Configuration parameters: EnforcedStyle, AllowedIdentifiers.
|
243
|
+
# SupportedStyles: snake_case, camelCase
|
244
|
+
Naming/VariableName:
|
245
|
+
Exclude:
|
246
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
|
247
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
|
248
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_matcher.rb'
|
249
|
+
|
250
|
+
# Offense count: 2
|
251
|
+
# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols.
|
252
|
+
# SupportedStyles: inline, group
|
253
|
+
Style/AccessModifierDeclarations:
|
254
|
+
Exclude:
|
255
|
+
- 'lib/cucumber/cucumber_expressions/tree_regexp.rb'
|
256
|
+
|
257
|
+
# Offense count: 5
|
258
|
+
# This cop supports safe auto-correction (--auto-correct).
|
259
|
+
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
|
260
|
+
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
|
261
|
+
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
262
|
+
# FunctionalMethods: let, let!, subject, watch
|
263
|
+
# IgnoredMethods: lambda, proc, it
|
264
|
+
Style/BlockDelimiters:
|
265
|
+
Exclude:
|
266
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
|
267
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
|
268
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_transformation_spec.rb'
|
269
|
+
- 'spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb'
|
270
|
+
- 'spec/cucumber/cucumber_expressions/tree_regexp_spec.rb'
|
271
|
+
|
272
|
+
# Offense count: 1
|
273
|
+
# This cop supports unsafe auto-correction (--auto-correct-all).
|
274
|
+
Style/CaseLikeIf:
|
275
|
+
Exclude:
|
276
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
|
277
|
+
|
278
|
+
# Offense count: 3
|
279
|
+
# This cop supports safe auto-correction (--auto-correct).
|
280
|
+
Style/ColonMethodCall:
|
281
|
+
Exclude:
|
282
|
+
- 'lib/cucumber/cucumber_expressions/errors.rb'
|
283
|
+
|
284
|
+
# Offense count: 1
|
285
|
+
# This cop supports safe auto-correction (--auto-correct).
|
286
|
+
Style/EmptyLiteral:
|
287
|
+
Exclude:
|
288
|
+
- 'lib/cucumber/cucumber_expressions/ast.rb'
|
289
|
+
|
290
|
+
# Offense count: 1
|
291
|
+
# This cop supports safe auto-correction (--auto-correct).
|
292
|
+
Style/Encoding:
|
293
|
+
Exclude:
|
294
|
+
- 'cucumber-cucumber-expressions.gemspec'
|
295
|
+
|
296
|
+
# Offense count: 1
|
297
|
+
# This cop supports safe auto-correction (--auto-correct).
|
298
|
+
Style/ExpandPathArguments:
|
299
|
+
Exclude:
|
300
|
+
- 'Rakefile'
|
301
|
+
|
302
|
+
# Offense count: 2
|
303
|
+
# This cop supports safe auto-correction (--auto-correct).
|
304
|
+
# Configuration parameters: EnforcedStyle.
|
305
|
+
# SupportedStyles: each, for
|
306
|
+
Style/For:
|
307
|
+
Exclude:
|
308
|
+
- 'lib/cucumber/cucumber_expressions/errors.rb'
|
309
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb'
|
310
|
+
|
311
|
+
# Offense count: 1
|
312
|
+
# This cop supports safe auto-correction (--auto-correct).
|
313
|
+
# Configuration parameters: EnforcedStyle.
|
314
|
+
# SupportedStyles: format, sprintf, percent
|
315
|
+
Style/FormatString:
|
316
|
+
Exclude:
|
317
|
+
- 'lib/cucumber/cucumber_expressions/generated_expression.rb'
|
318
|
+
|
319
|
+
# Offense count: 2
|
320
|
+
# Configuration parameters: MinBodyLength.
|
321
|
+
Style/GuardClause:
|
322
|
+
Exclude:
|
323
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb'
|
324
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
|
325
|
+
|
326
|
+
# Offense count: 1
|
327
|
+
# This cop supports unsafe auto-correction (--auto-correct-all).
|
328
|
+
# Configuration parameters: InverseMethods, InverseBlocks.
|
329
|
+
Style/InverseMethods:
|
330
|
+
Exclude:
|
331
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type.rb'
|
332
|
+
|
333
|
+
# Offense count: 1
|
334
|
+
# This cop supports safe auto-correction (--auto-correct).
|
335
|
+
Style/MultilineTernaryOperator:
|
336
|
+
Exclude:
|
337
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
|
338
|
+
|
339
|
+
# Offense count: 1
|
340
|
+
# This cop supports safe auto-correction (--auto-correct).
|
341
|
+
Style/NegatedIfElseCondition:
|
342
|
+
Exclude:
|
343
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
|
344
|
+
|
345
|
+
# Offense count: 1
|
346
|
+
# This cop supports safe auto-correction (--auto-correct).
|
347
|
+
Style/NestedTernaryOperator:
|
348
|
+
Exclude:
|
349
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
|
350
|
+
|
351
|
+
# Offense count: 2
|
352
|
+
# This cop supports safe auto-correction (--auto-correct).
|
353
|
+
# Configuration parameters: IncludeSemanticChanges.
|
354
|
+
Style/NonNilCheck:
|
355
|
+
Exclude:
|
356
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
|
357
|
+
|
358
|
+
# Offense count: 11
|
359
|
+
# This cop supports unsafe auto-correction (--auto-correct-all).
|
360
|
+
# Configuration parameters: EnforcedStyle, IgnoredMethods.
|
361
|
+
# SupportedStyles: predicate, comparison
|
362
|
+
Style/NumericPredicate:
|
363
|
+
Exclude:
|
364
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
|
365
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
|
366
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_tokenizer.rb'
|
367
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_matcher.rb'
|
368
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
|
369
|
+
|
370
|
+
# Offense count: 6
|
371
|
+
# This cop supports safe auto-correction (--auto-correct).
|
372
|
+
Style/ParallelAssignment:
|
373
|
+
Exclude:
|
374
|
+
- 'lib/cucumber/cucumber_expressions/argument.rb'
|
375
|
+
- 'lib/cucumber/cucumber_expressions/ast.rb'
|
376
|
+
- 'lib/cucumber/cucumber_expressions/generated_expression.rb'
|
377
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type.rb'
|
378
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_matcher.rb'
|
379
|
+
- 'spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb'
|
380
|
+
|
381
|
+
# Offense count: 1
|
382
|
+
# This cop supports safe auto-correction (--auto-correct).
|
383
|
+
Style/PerlBackrefs:
|
384
|
+
Exclude:
|
385
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type.rb'
|
386
|
+
|
387
|
+
# Offense count: 1
|
388
|
+
# This cop supports unsafe auto-correction (--auto-correct-all).
|
389
|
+
# Configuration parameters: EnforcedStyle.
|
390
|
+
# SupportedStyles: short, verbose
|
391
|
+
Style/PreferredHashMethods:
|
392
|
+
Exclude:
|
393
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
|
394
|
+
|
395
|
+
# Offense count: 9
|
396
|
+
# This cop supports safe auto-correction (--auto-correct).
|
397
|
+
# Configuration parameters: AllowedCompactTypes.
|
398
|
+
# SupportedStyles: compact, exploded
|
399
|
+
Style/RaiseArgs:
|
400
|
+
EnforcedStyle: compact
|
401
|
+
|
402
|
+
# Offense count: 6
|
403
|
+
# This cop supports unsafe auto-correction (--auto-correct-all).
|
404
|
+
# Configuration parameters: Methods.
|
405
|
+
Style/RedundantArgument:
|
406
|
+
Exclude:
|
407
|
+
- 'lib/cucumber/cucumber_expressions/ast.rb'
|
408
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
|
409
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_tokenizer.rb'
|
410
|
+
- 'lib/cucumber/cucumber_expressions/errors.rb'
|
411
|
+
|
412
|
+
# Offense count: 1
|
413
|
+
# This cop supports safe auto-correction (--auto-correct).
|
414
|
+
Style/RedundantInterpolation:
|
415
|
+
Exclude:
|
416
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
|
417
|
+
|
418
|
+
# Offense count: 1
|
419
|
+
# This cop supports safe auto-correction (--auto-correct).
|
420
|
+
Style/RedundantRegexpCharacterClass:
|
421
|
+
Exclude:
|
422
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
|
423
|
+
|
424
|
+
# Offense count: 19
|
425
|
+
# This cop supports safe auto-correction (--auto-correct).
|
426
|
+
# Configuration parameters: AllowMultipleReturnValues.
|
427
|
+
Style/RedundantReturn:
|
428
|
+
Exclude:
|
429
|
+
- 'lib/cucumber/cucumber_expressions/ast.rb'
|
430
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
|
431
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type.rb'
|
432
|
+
|
433
|
+
# Offense count: 1
|
434
|
+
# This cop supports safe auto-correction (--auto-correct).
|
435
|
+
Style/RedundantSelf:
|
436
|
+
Exclude:
|
437
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
|
438
|
+
|
439
|
+
# Offense count: 1
|
440
|
+
# This cop supports safe auto-correction (--auto-correct).
|
441
|
+
Style/SelectByRegexp:
|
442
|
+
Exclude:
|
443
|
+
- 'cucumber-cucumber-expressions.gemspec'
|
444
|
+
|
445
|
+
# Offense count: 1
|
446
|
+
# This cop supports safe auto-correction (--auto-correct).
|
447
|
+
# Configuration parameters: AllowAsExpressionSeparator.
|
448
|
+
Style/Semicolon:
|
449
|
+
Exclude:
|
450
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
|
451
|
+
|
452
|
+
# Offense count: 1
|
453
|
+
# This cop supports safe auto-correction (--auto-correct).
|
454
|
+
# Configuration parameters: RequireEnglish.
|
455
|
+
# SupportedStyles: use_perl_names, use_english_names
|
456
|
+
Style/SpecialGlobalVars:
|
457
|
+
EnforcedStyle: use_perl_names
|
458
|
+
|
459
|
+
# Offense count: 3
|
460
|
+
# This cop supports unsafe auto-correction (--auto-correct-all).
|
461
|
+
# Configuration parameters: Mode.
|
462
|
+
Style/StringConcatenation:
|
463
|
+
Exclude:
|
464
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
|
465
|
+
- 'lib/cucumber/cucumber_expressions/errors.rb'
|
466
|
+
|
467
|
+
# Offense count: 7
|
468
|
+
# This cop supports unsafe auto-correction (--auto-correct-all).
|
469
|
+
# Configuration parameters: AllowMethodsWithArguments, IgnoredMethods.
|
470
|
+
# IgnoredMethods: respond_to, define_method
|
471
|
+
Style/SymbolProc:
|
472
|
+
Exclude:
|
473
|
+
- 'lib/cucumber/cucumber_expressions/ast.rb'
|
474
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
|
475
|
+
- 'lib/cucumber/cucumber_expressions/errors.rb'
|
476
|
+
- 'spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_test.rb'
|
477
|
+
- 'spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb'
|
478
|
+
- 'spec/cucumber/cucumber_expressions/tree_regexp_spec.rb'
|
479
|
+
|
480
|
+
# Offense count: 2
|
481
|
+
# This cop supports safe auto-correction (--auto-correct).
|
482
|
+
# Configuration parameters: EnforcedStyleForMultiline.
|
483
|
+
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
|
484
|
+
Style/TrailingCommaInArrayLiteral:
|
485
|
+
Exclude:
|
486
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
|
487
|
+
- 'spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_test.rb'
|
488
|
+
|
489
|
+
# Offense count: 1
|
490
|
+
# This cop supports safe auto-correction (--auto-correct).
|
491
|
+
# Configuration parameters: EnforcedStyleForMultiline.
|
492
|
+
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
|
493
|
+
Style/TrailingCommaInHashLiteral:
|
494
|
+
Exclude:
|
495
|
+
- 'cucumber-cucumber-expressions.gemspec'
|
496
|
+
|
497
|
+
# Offense count: 9
|
498
|
+
# This cop supports safe auto-correction (--auto-correct).
|
499
|
+
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods.
|
500
|
+
# AllowedMethods: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
|
501
|
+
Style/TrivialAccessors:
|
502
|
+
Exclude:
|
503
|
+
- 'lib/cucumber/cucumber_expressions/ast.rb'
|
504
|
+
|
505
|
+
# Offense count: 1
|
506
|
+
# This cop supports safe auto-correction (--auto-correct).
|
507
|
+
Style/WhileUntilDo:
|
508
|
+
Exclude:
|
509
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
|
510
|
+
|
511
|
+
# Offense count: 6
|
512
|
+
# This cop supports safe auto-correction (--auto-correct).
|
513
|
+
# Configuration parameters: MinSize, WordRegex.
|
514
|
+
# SupportedStyles: percent, brackets
|
515
|
+
Style/WordArray:
|
516
|
+
EnforcedStyle: brackets
|
517
|
+
|
518
|
+
# Offense count: 6
|
519
|
+
# This cop supports unsafe auto-correction (--auto-correct-all).
|
520
|
+
Style/ZeroLengthPredicate:
|
521
|
+
Exclude:
|
522
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
|
523
|
+
- 'lib/cucumber/cucumber_expressions/cucumber_expression_tokenizer.rb'
|
524
|
+
- 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,25 +1,12 @@
|
|
1
|
-
#
|
2
|
-
require 'rubygems'
|
3
|
-
require 'bundler'
|
4
|
-
Bundler::GemHelper.install_tasks
|
1
|
+
# frozen_string_literal: true
|
5
2
|
|
6
|
-
$:.unshift File.expand_path(
|
3
|
+
$:.unshift File.expand_path('../lib', __FILE__)
|
7
4
|
|
8
5
|
Dir['./rake/*.rb'].each do |f|
|
9
6
|
require f
|
10
7
|
end
|
11
8
|
|
12
|
-
require
|
9
|
+
require 'rspec/core/rake_task'
|
13
10
|
RSpec::Core::RakeTask.new(:spec)
|
14
11
|
|
15
|
-
|
16
|
-
include CaptureWarnings
|
17
|
-
namespace :spec do
|
18
|
-
task :warnings do
|
19
|
-
report_warnings do
|
20
|
-
Rake::Task['spec'].invoke
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
task default: ['spec:warnings']
|
12
|
+
task default: :spec
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
17.0.0
|
@@ -1,20 +1,21 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
version = File.read(File.expand_path(
|
4
|
+
version = File.read(File.expand_path('VERSION', __dir__)).strip
|
4
5
|
|
5
6
|
Gem::Specification.new do |s|
|
6
7
|
s.name = 'cucumber-cucumber-expressions'
|
7
8
|
s.version = version
|
8
|
-
s.authors = [
|
9
|
+
s.authors = ['Aslak Hellesøy']
|
9
10
|
s.description = 'Cucumber Expressions - a simpler alternative to Regular Expressions'
|
10
11
|
s.summary = "cucumber-expressions-#{s.version}"
|
11
12
|
s.email = 'cukes@googlegroups.com'
|
12
|
-
s.homepage =
|
13
|
+
s.homepage = 'https://github.com/cucumber/cucumber-expressions-ruby#readme'
|
13
14
|
s.platform = Gem::Platform::RUBY
|
14
|
-
s.license =
|
15
|
-
s.required_ruby_version =
|
15
|
+
s.license = 'MIT'
|
16
|
+
s.required_ruby_version = '>= 2.5'
|
16
17
|
|
17
|
-
s.metadata
|
18
|
+
s.metadata = {
|
18
19
|
'bug_tracker_uri' => 'https://github.com/cucumber/cucumber/issues',
|
19
20
|
'changelog_uri' => 'https://github.com/cucumber/common/blob/main/cucumber-expressions/CHANGELOG.md',
|
20
21
|
'documentation_uri' => 'https://cucumber.io/docs/cucumber/cucumber-expressions/',
|
@@ -24,10 +25,11 @@ Gem::Specification.new do |s|
|
|
24
25
|
|
25
26
|
s.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
|
26
27
|
s.add_development_dependency 'rspec', '~> 3.11', '>= 3.11.0'
|
28
|
+
s.add_development_dependency 'rubocop', '~> 1.27.0'
|
27
29
|
|
28
|
-
s.rubygems_version =
|
30
|
+
s.rubygems_version = '>= 3.0.8'
|
29
31
|
s.files = `git ls-files`.split("\n").reject {|path| path =~ /\.gitignore$/ }
|
30
32
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
31
|
-
s.rdoc_options = [
|
32
|
-
s.require_path =
|
33
|
+
s.rdoc_options = ['--charset=UTF-8']
|
34
|
+
s.require_path = 'lib'
|
33
35
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'cucumber/cucumber_expressions/group'
|
2
4
|
require 'cucumber/cucumber_expressions/errors'
|
3
5
|
|
@@ -14,7 +16,7 @@ module Cucumber
|
|
14
16
|
|
15
17
|
if arg_groups.length != parameter_types.length
|
16
18
|
raise CucumberExpressionError.new(
|
17
|
-
|
19
|
+
"Expression #{tree_regexp.regexp.inspect} has #{arg_groups.length} capture groups (#{arg_groups.map(&:value)}), but there were #{parameter_types.length} parameter types (#{parameter_types.map(&:name)})"
|
18
20
|
)
|
19
21
|
end
|
20
22
|
|
@@ -27,8 +29,9 @@ module Cucumber
|
|
27
29
|
@group, @parameter_type = group, parameter_type
|
28
30
|
end
|
29
31
|
|
30
|
-
def value(self_obj
|
31
|
-
raise
|
32
|
+
def value(self_obj = :nil)
|
33
|
+
raise 'No self_obj' if self_obj == :nil
|
34
|
+
|
32
35
|
group_values = @group ? @group.values : nil
|
33
36
|
@parameter_type.transform(self_obj, group_values)
|
34
37
|
end
|