Skip to content

Commit e53b82e

Browse files
committed
sort validations spec config
1 parent ec78c3d commit e53b82e

File tree

1 file changed

+99
-100
lines changed

1 file changed

+99
-100
lines changed

spec/fixtures/script/validations.yml

Lines changed: 99 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -59,31 +59,41 @@
5959
help: Target filename
6060
unique: true
6161

62-
:command_catch_all_type:
62+
:catch_all_and_repeatable_arg:
6363
name: invalid
64-
help: catch_all must be boolean, string, or hash
65-
catch_all: [1,2]
64+
help: catch_all and repeatable arg make no sense together
65+
catch_all: true
66+
args:
67+
- name: path
68+
help: Path to one or more files
69+
repeatable: true
70+
required: true
71+
72+
:command_catch_all_commands:
73+
name: invalid
74+
catch_all:
75+
label: params
76+
help: catch_all makes no sense with commands
77+
commands:
78+
- name: config
6679

6780
:command_catch_all_hash:
6881
name: invalid
6982
catch_all:
7083
help: catch_all hash must have a label
7184

85+
:command_catch_all_type:
86+
name: invalid
87+
help: catch_all must be boolean, string, or hash
88+
catch_all: [1,2]
89+
7290
:command_catch_all_valid:
7391
name: invalid
7492
catch_all:
7593
label: acceptable
7694
help: catch_all.required should be boolean
7795
required: 1
7896

79-
:command_catch_all_commands:
80-
name: invalid
81-
catch_all:
82-
label: params
83-
help: catch_all makes no sense with commands
84-
commands:
85-
- name: config
86-
8797
:command_dependencies_invalid:
8898
name: invalid
8999
dependencies: 1
@@ -117,22 +127,22 @@
117127
docker:
118128
invalid_key: goes here
119129

120-
:command_expose_invalid_type:
130+
:command_expose_invalid_string:
121131
name: invalid
122132
help: expose should be boolean or 'always'
123133
commands:
124134
- name: config
125-
expose: 1
135+
expose: never
126136
commands:
127137
- name: edit
128138
- name: show
129139

130-
:command_expose_invalid_string:
140+
:command_expose_invalid_type:
131141
name: invalid
132142
help: expose should be boolean or 'always'
133143
commands:
134144
- name: config
135-
expose: never
145+
expose: 1
136146
commands:
137147
- name: edit
138148
- name: show
@@ -172,14 +182,14 @@
172182
name: -invalid
173183
help: command.name must not start with a hyphen
174184

185+
:command_name_missing:
186+
help: there is no name
187+
175188
:command_version:
176189
name: invalid
177190
help: version should be a string or a number
178191
version: [1, 0, 0]
179192

180-
:command_name_missing:
181-
help: there is no name
182-
183193
:commands_and_args:
184194
name: invalid
185195
help: there are both commands and args
@@ -210,31 +220,34 @@
210220
default: development
211221
private: 1
212222

213-
:flag_long:
223+
:flag_arg:
214224
name: invalid
215-
help: the long flag is not in the form of --force
225+
help: the flag.arg should not start with --
216226
flags:
217-
- long: force
227+
- long: --user
228+
arg: --name
218229

219-
:flag_short:
230+
:flag_allowed_and_completions:
220231
name: invalid
221-
help: the short flag is not in the form of -f
232+
help: flag with both allowed and completions
222233
flags:
223-
- short: f
234+
- long: --file
235+
allowed: [one, two]
236+
completions: [<file>]
224237

225-
:flag_arg:
238+
:flag_allowed_without_arg:
226239
name: invalid
227-
help: the flag.arg should not start with --
240+
help: flag must have an arg when using allowed
228241
flags:
229-
- long: --user
230-
arg: --name
242+
- long: --role
243+
allowed: [admin, noob]
231244

232-
:flag_conflicts_type:
245+
:flag_completions_without_arg:
233246
name: invalid
234-
help: flag.conflicts should be an array
247+
help: flag must have an arg when using completions
235248
flags:
236-
- long: --cache
237-
conflicts: --no-cache
249+
- long: --target
250+
completions: [<dir>]
238251

239252
:flag_conflicts_array:
240253
name: invalid
@@ -243,14 +256,22 @@
243256
- long: --cache
244257
conflicts: [1, 2]
245258

246-
:flag_required_and_default:
259+
:flag_conflicts_type:
247260
name: invalid
248-
help: flag cannot have both required and default
261+
help: flag.conflicts should be an array
249262
flags:
250-
- long: --role
251-
arg: name
252-
required: true
253-
default: admin
263+
- long: --cache
264+
conflicts: --no-cache
265+
266+
:flag_default_array_without_repeatable:
267+
name: invalid
268+
help: default cannot be an array without repeatable
269+
flags:
270+
- long: --path
271+
arg: location
272+
default:
273+
- spaced file
274+
- other-file
254275

255276
:flag_default_without_arg:
256277
name: invalid
@@ -266,37 +287,26 @@
266287
- long: --role
267288
default: admin
268289

269-
:flag_default_array_without_repeatable:
290+
:flag_long:
270291
name: invalid
271-
help: default cannot be an array without repeatable
292+
help: the long flag is not in the form of --force
272293
flags:
273-
- long: --path
274-
arg: location
275-
default:
276-
- spaced file
277-
- other-file
294+
- long: force
278295

279-
:flag_allowed_without_arg:
296+
:flag_required_and_default:
280297
name: invalid
281-
help: flag must have an arg when using allowed
298+
help: flag cannot have both required and default
282299
flags:
283300
- long: --role
284-
allowed: [admin, noob]
285-
286-
:flag_completions_without_arg:
287-
name: invalid
288-
help: flag must have an arg when using completions
289-
flags:
290-
- long: --target
291-
completions: [<dir>]
301+
arg: name
302+
required: true
303+
default: admin
292304

293-
:flag_allowed_and_completions:
305+
:flag_short:
294306
name: invalid
295-
help: flag with both allowed and completions
307+
help: the short flag is not in the form of -f
296308
flags:
297-
- long: --file
298-
allowed: [one, two]
299-
completions: [<file>]
309+
- short: f
300310

301311
:flag_unique_without_repeatable_and_arg:
302312
name: invalid
@@ -306,35 +316,6 @@
306316
repeatable: true
307317
unique: true
308318

309-
:root_alias:
310-
name: invalid
311-
help: root cannot have alias
312-
alias: i
313-
314-
:root_group:
315-
name: invalid
316-
help: root cannot have group
317-
group: My Commands
318-
319-
:root_default:
320-
name: invalid
321-
help: root cannot have default
322-
default: true
323-
args:
324-
- name: ok
325-
326-
:root_expose:
327-
name: invalid
328-
help: root cannot have expose
329-
expose: true
330-
commands:
331-
- name: config
332-
333-
:root_private:
334-
name: invalid
335-
help: root cannot have private
336-
private: true
337-
338319
:invalid_arg_keys:
339320
name: invalid
340321
help: disallowed arg keys
@@ -368,16 +349,6 @@
368349
flags:
369350
- long: --user
370351
disallowed: true
371-
372-
:catch_all_and_repeatable_arg:
373-
name: invalid
374-
help: catch_all and repeatable arg make no sense together
375-
catch_all: true
376-
args:
377-
- name: path
378-
help: Path to one or more files
379-
repeatable: true
380-
required: true
381352

382353
:non_uniq_command_names:
383354
name: invalid
@@ -425,4 +396,32 @@
425396
args:
426397
- name: file
427398
- name: file
428-
399+
400+
:root_alias:
401+
name: invalid
402+
help: root cannot have alias
403+
alias: i
404+
405+
:root_group:
406+
name: invalid
407+
help: root cannot have group
408+
group: My Commands
409+
410+
:root_default:
411+
name: invalid
412+
help: root cannot have default
413+
default: true
414+
args:
415+
- name: ok
416+
417+
:root_expose:
418+
name: invalid
419+
help: root cannot have expose
420+
expose: true
421+
commands:
422+
- name: config
423+
424+
:root_private:
425+
name: invalid
426+
help: root cannot have private
427+
private: true

0 commit comments

Comments
 (0)