Skip to content

Commit bc34216

Browse files
committed
Fixing more spelling
1 parent 0754211 commit bc34216

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

pkg/yqlib/doc/operators/anchor-and-alias-operators.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ see https://yaml.org/type/merge.html
2222

2323
Given a sample.yml file of:
2424
```yaml
25-
- &CENTER
25+
- &CENTRE
2626
x: 1
2727
y: 2
2828
- &LEFT
@@ -32,7 +32,7 @@ Given a sample.yml file of:
3232
r: 10
3333
- &SMALL
3434
r: 1
35-
- !!merge <<: *CENTER
35+
- !!merge <<: *CENTRE
3636
r: 10
3737
```
3838
then
@@ -288,7 +288,7 @@ see https://yaml.org/type/merge.html. This has the correct data, but the wrong k
288288
289289
Given a sample.yml file of:
290290
```yaml
291-
- &CENTER
291+
- &CENTRE
292292
x: 1
293293
y: 2
294294
- &LEFT
@@ -299,7 +299,7 @@ Given a sample.yml file of:
299299
- &SMALL
300300
r: 1
301301
- !!merge <<:
302-
- *CENTER
302+
- *CENTRE
303303
- *BIG
304304
```
305305
then
@@ -318,7 +318,7 @@ see https://yaml.org/type/merge.html. This has the correct data, but the wrong k
318318
319319
Given a sample.yml file of:
320320
```yaml
321-
- &CENTER
321+
- &CENTRE
322322
x: 1
323323
y: 2
324324
- &LEFT
@@ -401,7 +401,7 @@ Taken from https://yaml.org/type/merge.html. Same values as legacy, but with the
401401

402402
Given a sample.yml file of:
403403
```yaml
404-
- &CENTER
404+
- &CENTRE
405405
x: 1
406406
y: 2
407407
- &LEFT
@@ -412,7 +412,7 @@ Given a sample.yml file of:
412412
- &SMALL
413413
r: 1
414414
- !!merge <<:
415-
- *CENTER
415+
- *CENTRE
416416
- *BIG
417417
```
418418
then
@@ -432,7 +432,7 @@ Taken from https://yaml.org/type/merge.html. Same values as legacy, but with the
432432

433433
Given a sample.yml file of:
434434
```yaml
435-
- &CENTER
435+
- &CENTRE
436436
x: 1
437437
y: 2
438438
- &LEFT

pkg/yqlib/encoder_toml.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ func (te *tomlEncoder) Encode(writer io.Writer, node *CandidateNode) error {
4545
}
4646

4747
if te.prefs.ColorsEnabled {
48-
colorized := te.colorizeToml(buf.Bytes())
49-
_, err := writer.Write(colorized)
48+
colourised := te.colorizeToml(buf.Bytes())
49+
_, err := writer.Write(colourised)
5050
return err
5151
}
5252

@@ -547,7 +547,7 @@ func (te *tomlEncoder) colorizeToml(input []byte) []byte {
547547
boolColor := color.New(color.FgHiMagenta).SprintFunc()
548548
sectionColor := color.New(color.FgYellow, color.Bold).SprintFunc()
549549

550-
// Simple tokenization for TOML coloring
550+
// Simple tokenization for TOML colouring
551551
i := 0
552552
for i < len(toml) {
553553
ch := toml[i]

pkg/yqlib/toml_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -695,14 +695,14 @@ func TestTomlColorisationNumberBug(t *testing.T) {
695695
encoder := NewTomlEncoder()
696696
tomlEncoder := encoder.(*tomlEncoder)
697697

698-
// Test case that exposes the bug: "123-+-45" should NOT be colorized as a single number
698+
// Test case that exposes the bug: "123-+-45" should NOT be colourised as a single number
699699
input := "A = 123-+-45\n"
700700
result := string(tomlEncoder.colorizeToml([]byte(input)))
701701

702-
// The bug causes "123-+-45" to be colorized as one token
702+
// The bug causes "123-+-45" to be colourised as one token
703703
// It should stop at "123" because the next character '-' is not valid in this position
704704
if strings.Contains(result, "123-+-45") {
705-
// Check if it's colorized as a single token (no color codes in the middle)
705+
// Check if it's colourised as a single token (no color codes in the middle)
706706
idx := strings.Index(result, "123-+-45")
707707
// Look backwards for color code
708708
beforeIdx := idx - 1
@@ -722,8 +722,8 @@ func TestTomlColorisationNumberBug(t *testing.T) {
722722

723723
if beforeIdx >= 0 && hasResetAfter {
724724
// The entire "123-+-45" is wrapped in color codes - this is the bug!
725-
t.Errorf("BUG DETECTED: '123-+-45' is incorrectly colorized as a single number")
726-
t.Errorf("Expected only '123' to be colorized as a number, but got the entire '123-+-45'")
725+
t.Errorf("BUG DETECTED: '123-+-45' is incorrectly colourised as a single number")
726+
t.Errorf("Expected only '123' to be colourised as a number, but got the entire '123-+-45'")
727727
t.Logf("Full output: %q", result)
728728
t.Fail()
729729
}
@@ -740,13 +740,13 @@ func TestTomlColorisationNumberBug(t *testing.T) {
740740
name: "consecutive minuses",
741741
input: "A = 123--45\n",
742742
invalidSequence: "123--45",
743-
description: "'123--45' should not be colorized as a single number",
743+
description: "'123--45' should not be colourised as a single number",
744744
},
745745
{
746746
name: "plus in middle",
747747
input: "A = 123+45\n",
748748
invalidSequence: "123+45",
749-
description: "'123+45' should not be colorized as a single number",
749+
description: "'123+45' should not be colourised as a single number",
750750
},
751751
}
752752

@@ -791,7 +791,7 @@ func TestTomlColorisationNumberBug(t *testing.T) {
791791
t.Run(tt.name, func(t *testing.T) {
792792
result := tomlEncoder.colorizeToml([]byte(tt.input))
793793
if len(result) == 0 {
794-
t.Error("Expected non-empty colorized output")
794+
t.Error("Expected non-empty colourised output")
795795
}
796796
})
797797
}
@@ -816,7 +816,7 @@ func TestTomlStringEscapeColourization(t *testing.T) {
816816
{
817817
name: "escaped quote at end",
818818
input: `A = "test\""` + "\n",
819-
description: "String ending with escaped quote should be colorized correctly",
819+
description: "String ending with escaped quote should be colourised correctly",
820820
},
821821
{
822822
name: "escaped backslash then quote",
@@ -826,7 +826,7 @@ func TestTomlStringEscapeColourization(t *testing.T) {
826826
{
827827
name: "escaped quote in middle",
828828
input: `A = "test\"middle"` + "\n",
829-
description: "String with escaped quote in the middle should be colorized correctly",
829+
description: "String with escaped quote in the middle should be colourised correctly",
830830
},
831831
{
832832
name: "multiple escaped quotes",
@@ -836,7 +836,7 @@ func TestTomlStringEscapeColourization(t *testing.T) {
836836
{
837837
name: "escaped newline",
838838
input: `A = "test\n"` + "\n",
839-
description: "String with escaped newline should be colorized correctly",
839+
description: "String with escaped newline should be colourised correctly",
840840
},
841841
{
842842
name: "single quote with escaped single quote",
@@ -850,7 +850,7 @@ func TestTomlStringEscapeColourization(t *testing.T) {
850850
// The test should not panic and should return some output
851851
result := tomlEncoder.colorizeToml([]byte(tt.input))
852852
if len(result) == 0 {
853-
t.Error("Expected non-empty colorized output")
853+
t.Error("Expected non-empty colourised output")
854854
}
855855

856856
// Check that the result contains the input string (with color codes)

project-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,4 @@ nohcl
277277
zclconf
278278
cty
279279
go-cty
280+
Colorisation

0 commit comments

Comments
 (0)