Skip to content

Commit cdb9b56

Browse files
committed
Spellig with cspell
1 parent 980b0e6 commit cdb9b56

36 files changed

+369
-95
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,12 @@ format: vendor
8484
${ENGINERUN} bash ./scripts/format.sh
8585

8686

87+
.PHONY: spelling
88+
spelling: format
89+
${ENGINERUN} bash ./scripts/spelling.sh
90+
8791
.PHONY: secure
88-
secure: format
92+
secure: spelling
8993
${ENGINERUN} bash ./scripts/secure.sh
9094

9195
.PHONY: check

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Pipe from STDIN:
1919
yq '.a.b[0].c' < file.yaml
2020
```
2121

22-
Update a yaml file, inplace
22+
Update a yaml file, in place
2323
```bash
2424
yq -i '.a.b[0].c = "cool"' file.yaml
2525
```
@@ -310,7 +310,7 @@ https://pkgs.alpinelinux.org/package/edge/community/x86/yq
310310
- [Deeply data structures](https://mikefarah.gitbook.io/yq/operators/traverse-read)
311311
- [Sort keys](https://mikefarah.gitbook.io/yq/operators/sort-keys)
312312
- Manipulate yaml [comments](https://mikefarah.gitbook.io/yq/operators/comment-operators), [styling](https://mikefarah.gitbook.io/yq/operators/style), [tags](https://mikefarah.gitbook.io/yq/operators/tag) and [anchors and aliases](https://mikefarah.gitbook.io/yq/operators/anchor-and-alias-operators).
313-
- [Update inplace](https://mikefarah.gitbook.io/yq/v/v4.x/commands/evaluate#flags)
313+
- [Update in place](https://mikefarah.gitbook.io/yq/v/v4.x/commands/evaluate#flags)
314314
- [Complex expressions to select and update](https://mikefarah.gitbook.io/yq/operators/select#select-and-update-matching-values-in-map)
315315
- Keeps yaml formatting and comments when updating (though there are issues with whitespace)
316316
- [Decode/Encode base64 data](https://mikefarah.gitbook.io/yq/operators/encode-decode)
@@ -337,7 +337,7 @@ Examples:
337337
# yq defaults to 'eval' command if no command is specified. See "yq eval --help" for more examples.
338338
yq '.stuff' < myfile.yml # outputs the data at the "stuff" node from "myfile.yml"
339339
340-
yq -i '.stuff = "foo"' myfile.yml # update myfile.yml inplace
340+
yq -i '.stuff = "foo"' myfile.yml # update myfile.yml in place
341341
342342
343343
Available Commands:
@@ -354,7 +354,7 @@ Flags:
354354
--header-preprocess Slurp any header comments and separators before processing expression. (default true)
355355
-h, --help help for yq
356356
-I, --indent int sets indent level for output (default 2)
357-
-i, --inplace update the file inplace of first file given.
357+
-i, --inplace update the file in place of first file given.
358358
-p, --input-format string [yaml|y|xml|x] parse format for input. Note that json is a subset of yaml. (default "yaml")
359359
-M, --no-colors force print with no colors
360360
-N, --no-doc Don't print document separators (---)

acceptance_tests/bad_args.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
testWriteInPlacePipeIn() {
44
result=$(./yq e -i -n '.a' 2>&1)
55
assertEquals 1 $?
6-
assertEquals "Error: write inplace flag only applicable when giving an expression and at least one file" "$result"
6+
assertEquals "Error: write in place flag only applicable when giving an expression and at least one file" "$result"
77
}
88

99
testWriteInPlacePipeInEvalall() {
1010
result=$(./yq ea -i -n '.a' 2>&1)
1111
assertEquals 1 $?
12-
assertEquals "Error: write inplace flag only applicable when giving an expression and at least one file" "$result"
12+
assertEquals "Error: write in place flag only applicable when giving an expression and at least one file" "$result"
1313
}
1414

1515
testWriteInPlaceWithSplit() {
1616
result=$(./yq e -s "cat" -i '.a = "thing"' test.yml 2>&1)
1717
assertEquals 1 $?
18-
assertEquals "Error: write inplace cannot be used with split file" "$result"
18+
assertEquals "Error: write in place cannot be used with split file" "$result"
1919
}
2020

2121
testWriteInPlaceWithSplitEvalAll() {
2222
result=$(./yq ea -s "cat" -i '.a = "thing"' test.yml 2>&1)
2323
assertEquals 1 $?
24-
assertEquals "Error: write inplace cannot be used with split file" "$result"
24+
assertEquals "Error: write in place cannot be used with split file" "$result"
2525
}
2626

2727
testNullWithFiles() {

acceptance_tests/basic.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ testBasicCatWithFilesNoDash() {
143143
}
144144

145145
# when the nullinput flag is used
146-
# dont automatically read STDIN (this breaks github actions)
146+
# don't automatically read STDIN (this breaks github actions)
147147
testBasicCreateFileGithubAction() {
148148
cat /dev/null | ./yq -n ".a = 123" > test.yml
149149
}
@@ -302,7 +302,7 @@ testBasicExitStatusNoEval() {
302302
assertEquals 1 "$?"
303303
}
304304

305-
testBasicExtractFieldWithSeperator() {
305+
testBasicExtractFieldWithSeparator() {
306306
cat >test.yml <<EOL
307307
---
308308
name: chart-name
@@ -312,7 +312,7 @@ EOL
312312
assertEquals "chart-name" "$X"
313313
}
314314

315-
testBasicExtractMultipleFieldWithSeperator() {
315+
testBasicExtractMultipleFieldWithSeparator() {
316316
cat >test.yml <<EOL
317317
---
318318
name: chart-name

acceptance_tests/leading-seperator.sh

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ a: test
1111
EOL
1212
}
1313

14-
testLeadingSeperatorWithDoc() {
14+
testLeadingSeparatorWithDoc() {
1515
cat >test.yml <<EOL
1616
# hi peeps
1717
# cool
@@ -35,7 +35,7 @@ EOM
3535
}
3636

3737

38-
testLeadingSeperatorWithNewlinesNewDoc() {
38+
testLeadingSeparatorWithNewlinesNewDoc() {
3939
cat >test.yml <<EOL
4040
# hi peeps
4141
# cool
@@ -62,7 +62,7 @@ EOM
6262
assertEquals "$expected" "$X"
6363
}
6464

65-
testLeadingSeperatorWithNewlinesMoreComments() {
65+
testLeadingSeparatorWithNewlinesMoreComments() {
6666
cat >test.yml <<EOL
6767
# hi peeps
6868
# cool
@@ -92,7 +92,7 @@ EOM
9292
}
9393

9494

95-
testLeadingSeperatorWithDirective() {
95+
testLeadingSeparatorWithDirective() {
9696
cat >test.yml <<EOL
9797
%YAML 1.1
9898
---
@@ -110,18 +110,18 @@ EOM
110110
}
111111

112112

113-
testLeadingSeperatorPipeIntoEvalSeq() {
113+
testLeadingSeparatorPipeIntoEvalSeq() {
114114
X=$(./yq e - < test.yml)
115115
expected=$(cat test.yml)
116116
assertEquals "$expected" "$X"
117117
}
118118

119-
testLeadingSeperatorExtractField() {
119+
testLeadingSeparatorExtractField() {
120120
X=$(./yq e '.a' - < test.yml)
121121
assertEquals "test" "$X"
122122
}
123123

124-
testLeadingSeperatorExtractFieldWithCommentsAfterSep() {
124+
testLeadingSeparatorExtractFieldWithCommentsAfterSep() {
125125
cat >test.yml <<EOL
126126
---
127127
# hi peeps
@@ -132,7 +132,7 @@ EOL
132132
assertEquals "test" "$X"
133133
}
134134

135-
testLeadingSeperatorExtractFieldWithCommentsBeforeSep() {
135+
testLeadingSeparatorExtractFieldWithCommentsBeforeSep() {
136136
cat >test.yml <<EOL
137137
# hi peeps
138138
# cool
@@ -144,7 +144,7 @@ EOL
144144
}
145145

146146

147-
testLeadingSeperatorExtractFieldMultiDoc() {
147+
testLeadingSeparatorExtractFieldMultiDoc() {
148148
cat >test.yml <<EOL
149149
---
150150
a: test
@@ -161,7 +161,7 @@ EOM
161161
assertEquals "$expected" "$X"
162162
}
163163

164-
testLeadingSeperatorExtractFieldMultiDocWithComments() {
164+
testLeadingSeparatorExtractFieldMultiDocWithComments() {
165165
cat >test.yml <<EOL
166166
# here
167167
---
@@ -184,26 +184,26 @@ EOM
184184
}
185185

186186

187-
testLeadingSeperatorEvalSeq() {
187+
testLeadingSeparatorEvalSeq() {
188188
X=$(./yq e test.yml)
189189
expected=$(cat test.yml)
190190
assertEquals "$expected" "$X"
191191
}
192192

193-
testLeadingSeperatorPipeIntoEvalAll() {
193+
testLeadingSeparatorPipeIntoEvalAll() {
194194
X=$(./yq ea - < test.yml)
195195
expected=$(cat test.yml)
196196
assertEquals "$expected" "$X"
197197
}
198198

199199

200-
testLeadingSeperatorEvalAll() {
200+
testLeadingSeparatorEvalAll() {
201201
X=$(./yq ea test.yml)
202202
expected=$(cat test.yml)
203203
assertEquals "$expected" "$X"
204204
}
205205

206-
testLeadingSeperatorMultiDocEvalSimple() {
206+
testLeadingSeparatorMultiDocEvalSimple() {
207207
read -r -d '' expected << EOM
208208
---
209209
a: test
@@ -217,7 +217,7 @@ EOM
217217
assertEquals "$expected" "$X"
218218
}
219219

220-
testLeadingSeperatorMultiDocInOneFile() {
220+
testLeadingSeparatorMultiDocInOneFile() {
221221
cat >test.yml <<EOL
222222
---
223223
# hi peeps
@@ -231,7 +231,7 @@ EOL
231231
assertEquals "$expected" "$X"
232232
}
233233

234-
testLeadingSeperatorMultiDocInOneFileEvalAll() {
234+
testLeadingSeparatorMultiDocInOneFileEvalAll() {
235235
cat >test.yml <<EOL
236236
---
237237
# hi peeps
@@ -245,7 +245,7 @@ EOL
245245
assertEquals "$expected" "$X"
246246
}
247247

248-
testLeadingSeperatorMultiDocEvalComments() {
248+
testLeadingSeparatorMultiDocEvalComments() {
249249
cat >test.yml <<EOL
250250
# hi peeps
251251
# cool
@@ -273,7 +273,7 @@ EOM
273273
assertEquals "$expected" "$X"
274274
}
275275

276-
testLeadingSeperatorMultiDocEvalCommentsTrailingSep() {
276+
testLeadingSeparatorMultiDocEvalCommentsTrailingSep() {
277277
cat >test.yml <<EOL
278278
# hi peeps
279279
# cool
@@ -305,7 +305,7 @@ EOM
305305
assertEquals "$expected" "$X"
306306
}
307307

308-
testLeadingSeperatorMultiMultiDocEvalCommentsTrailingSep() {
308+
testLeadingSeparatorMultiMultiDocEvalCommentsTrailingSep() {
309309
cat >test.yml <<EOL
310310
# hi peeps
311311
# cool
@@ -345,7 +345,7 @@ EOM
345345
assertEquals "$expected" "$X"
346346
}
347347

348-
testLeadingSeperatorMultiDocEvalCommentsLeadingSep() {
348+
testLeadingSeparatorMultiDocEvalCommentsLeadingSep() {
349349
cat >test.yml <<EOL
350350
---
351351
# hi peeps
@@ -405,7 +405,7 @@ EOM
405405
assertEquals "$expected" "$X"
406406
}
407407

408-
testLeadingSeperatorMultiDocEvalCommentsStripComments() {
408+
testLeadingSeparatorMultiDocEvalCommentsStripComments() {
409409
cat >test.yml <<EOL
410410
---
411411
# hi peeps
@@ -428,7 +428,7 @@ EOM
428428
assertEquals "$expected" "$X"
429429
}
430430

431-
testLeadingSeperatorMultiDocEvalCommentsLeadingSepNoDocFlag() {
431+
testLeadingSeparatorMultiDocEvalCommentsLeadingSepNoDocFlag() {
432432
cat >test.yml <<EOL
433433
---
434434
# hi peeps
@@ -454,7 +454,7 @@ EOM
454454
assertEquals "$expected" "$X"
455455
}
456456

457-
testLeadingSeperatorMultiDocEvalJsonFlag() {
457+
testLeadingSeparatorMultiDocEvalJsonFlag() {
458458
cat >test.yml <<EOL
459459
---
460460
# hi peeps
@@ -483,7 +483,7 @@ EOM
483483
assertEquals "$expected" "$X"
484484
}
485485

486-
testLeadingSeperatorMultiDocEvalAllJsonFlag() {
486+
testLeadingSeparatorMultiDocEvalAllJsonFlag() {
487487
cat >test.yml <<EOL
488488
---
489489
# hi peeps
@@ -512,7 +512,7 @@ EOM
512512
assertEquals "$expected" "$X"
513513
}
514514

515-
testLeadingSeperatorMultiDocEvalAll() {
515+
testLeadingSeparatorMultiDocEvalAll() {
516516
read -r -d '' expected << EOM
517517
---
518518
a: test

cmd/evaluate_all_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func createEvaluateAllCommand() *cobra.Command {
1313
Aliases: []string{"ea"},
1414
Short: "Loads _all_ yaml documents of _all_ yaml files and runs expression once",
1515
Example: `
16-
# Merge f2.yml into f1.yml (inplace)
16+
# Merge f2.yml into f1.yml (in place)
1717
yq eval-all --inplace 'select(fileIndex == 0) * select(fileIndex == 1)' f1.yml f2.yml
1818
## the same command and expression using shortened names:
1919
yq ea -i 'select(fi == 0) * select(fi == 1)' f1.yml f2.yml

cmd/evalute_sequence_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cat file2.yml | yq e '.a.b' file1.yml - file3.yml
2828
## Note that editing an empty file does not work.
2929
yq e -n '.a.b.c = "cat"'
3030
31-
# Update a file inplace
31+
# Update a file in place
3232
yq e '.a.b = "cool"' -i file.yaml
3333
`,
3434
Long: `yq is a portable command-line YAML processor (https://github.com/mikefarah/yq/)

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ yq -P sample.json
8888

8989
rootCmd.PersistentFlags().IntVarP(&indent, "indent", "I", 2, "sets indent level for output")
9090
rootCmd.Flags().BoolVarP(&version, "version", "V", false, "Print version information and quit")
91-
rootCmd.PersistentFlags().BoolVarP(&writeInplace, "inplace", "i", false, "update the file inplace of first file given.")
91+
rootCmd.PersistentFlags().BoolVarP(&writeInplace, "inplace", "i", false, "update the file in place of first file given.")
9292
rootCmd.PersistentFlags().VarP(unwrapScalarFlag, "unwrapScalar", "r", "unwrap scalar, print the value with no quotes, colors or comments. Defaults to true for yaml")
9393
rootCmd.PersistentFlags().Lookup("unwrapScalar").NoOptDefVal = "true"
9494
rootCmd.PersistentFlags().BoolVarP(&nulSepOutput, "nul-output", "0", false, "Use NUL char to separate values. If unwrap scalar is also set, fail if unwrapped scalar contains NUL char.")

cmd/unwrap_flag.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ import (
88

99
type boolFlag interface {
1010
pflag.Value
11-
IsExplicitySet() bool
11+
IsExplicitlySet() bool
1212
IsSet() bool
1313
}
1414

1515
type unwrapScalarFlagStrc struct {
16-
explicitySet bool
17-
value bool
16+
explicitlySet bool
17+
value bool
1818
}
1919

2020
func newUnwrapFlag() boolFlag {
2121
return &unwrapScalarFlagStrc{value: true}
2222
}
2323

24-
func (f *unwrapScalarFlagStrc) IsExplicitySet() bool {
25-
return f.explicitySet
24+
func (f *unwrapScalarFlagStrc) IsExplicitlySet() bool {
25+
return f.explicitlySet
2626
}
2727

2828
func (f *unwrapScalarFlagStrc) IsSet() bool {
@@ -37,7 +37,7 @@ func (f *unwrapScalarFlagStrc) Set(value string) error {
3737

3838
v, err := strconv.ParseBool(value)
3939
f.value = v
40-
f.explicitySet = true
40+
f.explicitlySet = true
4141
return err
4242
}
4343

0 commit comments

Comments
 (0)