From c132c32731b8c71166d67c655fdc0583e9eeea64 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Dec 2025 04:17:39 +0000 Subject: [PATCH] Convert to UK English spelling (colourization, coloured) Co-authored-by: mikefarah <1151925+mikefarah@users.noreply.github.com> --- pkg/yqlib/encoder_toml.go | 2 +- pkg/yqlib/toml_test.go | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/yqlib/encoder_toml.go b/pkg/yqlib/encoder_toml.go index 69342db5..3b789f04 100644 --- a/pkg/yqlib/encoder_toml.go +++ b/pkg/yqlib/encoder_toml.go @@ -566,7 +566,7 @@ func (te *tomlEncoder) colorizeToml(input []byte) []byte { // Table sections - [section] or [[array]] // Only treat '[' as a table section if it appears at the start of the line - // (possibly after whitespace). This avoids mis-coloring inline arrays like + // (possibly after whitespace). This avoids mis-colouring inline arrays like // "ports = [8000, 8001]" as table sections. if ch == '[' { isSectionHeader := true diff --git a/pkg/yqlib/toml_test.go b/pkg/yqlib/toml_test.go index 7f79403d..028dba02 100644 --- a/pkg/yqlib/toml_test.go +++ b/pkg/yqlib/toml_test.go @@ -628,10 +628,10 @@ func TestTomlScenarios(t *testing.T) { documentScenarios(t, "usage", "toml", genericScenarios, documentTomlScenario) } -// TestTomlColorization tests that colorization correctly distinguishes +// TestTomlColourization tests that colourization correctly distinguishes // between table section headers and inline arrays -func TestTomlColorization(t *testing.T) { - // Test that inline arrays are not colored as table sections +func TestTomlColourization(t *testing.T) { + // Test that inline arrays are not coloured as table sections encoder := &tomlEncoder{prefs: TomlPreferences{ColorsEnabled: true}} // Create TOML with both table sections and inline arrays @@ -647,15 +647,15 @@ alpha = "test" resultStr := string(result) // The bug would cause the inline array [8000, 8001, 8002] to be - // colored with the section color (Yellow + Bold) instead of being - // left uncolored or colored differently. + // coloured with the section colour (Yellow + Bold) instead of being + // left uncoloured or coloured differently. // - // To test this, we check that the section color codes appear only + // To test this, we check that the section colour codes appear only // for actual table sections, not for inline arrays. - // Get the ANSI codes for section color (Yellow + Bold) - sectionColor := color.New(color.FgYellow, color.Bold).SprintFunc() - sampleSection := sectionColor("[database]") + // Get the ANSI codes for section colour (Yellow + Bold) + sectionColour := color.New(color.FgYellow, color.Bold).SprintFunc() + sampleSection := sectionColour("[database]") // Extract just the ANSI codes from the sample // ANSI codes start with \x1b[ @@ -674,14 +674,14 @@ alpha = "test" } } - // Count how many times the section color appears in the output + // Count how many times the section colour appears in the output // It should appear exactly twice: once for [database] and once for [servers] // If it appears more times (e.g., for [8000, 8001, 8002]), that's the bug - sectionColorCount := strings.Count(resultStr, ansiStart) + sectionColourCount := strings.Count(resultStr, ansiStart) // We expect exactly 2 occurrences (for [database] and [servers]) // The bug would cause more occurrences (e.g., also for [8000) - if sectionColorCount != 2 { - t.Errorf("Expected section color to appear exactly 2 times (for [database] and [servers]), but it appeared %d times.\nOutput: %s", sectionColorCount, resultStr) + if sectionColourCount != 2 { + t.Errorf("Expected section colour to appear exactly 2 times (for [database] and [servers]), but it appeared %d times.\nOutput: %s", sectionColourCount, resultStr) } }