From f02245af79427fe0ce2ae9b07d031aa86191197e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 23 Mar 2025 20:26:10 +0530 Subject: [PATCH] Also run gofmt on kittens subdir in CI --- .github/workflows/ci.py | 2 +- tools/wcswidth/char-props.go | 2 +- tools/wcswidth/char-props_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.py b/.github/workflows/ci.py index b838bf977..446d709b5 100644 --- a/.github/workflows/ci.py +++ b/.github/workflows/ci.py @@ -193,7 +193,7 @@ def main() -> None: elif action == 'test': test_kitty() elif action == 'gofmt': - q = subprocess.check_output('gofmt -s -l tools'.split()).decode() + q = subprocess.check_output('gofmt -s -l tools kittens'.split()).decode() if q.strip(): q = '\n'.join(filter(lambda x: not x.rstrip().endswith('_generated.go'), q.strip().splitlines())).strip() if q: diff --git a/tools/wcswidth/char-props.go b/tools/wcswidth/char-props.go index ed524d10d..7dfacd0bd 100644 --- a/tools/wcswidth/char-props.go +++ b/tools/wcswidth/char-props.go @@ -49,7 +49,7 @@ func IteratorOverGraphemes(text string) iter.Seq[string] { } } if start_pos < len(text) { - yield(text[start_pos:len(text)]) + yield(text[start_pos:]) } } } diff --git a/tools/wcswidth/char-props_test.go b/tools/wcswidth/char-props_test.go index ff9342390..f5321021e 100644 --- a/tools/wcswidth/char-props_test.go +++ b/tools/wcswidth/char-props_test.go @@ -21,8 +21,8 @@ type GraphemeBreakTest struct { func TestSplitIntoGraphemes(t *testing.T) { var m = map[string][]string{ - " \u0308 ": []string{" \u0308", " "}, - "abc": []string{"a", "b", "c"}, + " \u0308 ": {" \u0308", " "}, + "abc": {"a", "b", "c"}, } for text, expected := range m { if diff := cmp.Diff(expected, SplitIntoGraphemes(text)); diff != "" {