From 12adcfc0f7a7434fc2fff02bcbeeabcbb31fb082 Mon Sep 17 00:00:00 2001 From: bayashi <42190+bayashi@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:48:05 +0000 Subject: [PATCH 1/4] improve error message --- highlightrepo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/highlightrepo.go b/highlightrepo.go index 7ff5aa3..8f8d707 100644 --- a/highlightrepo.go +++ b/highlightrepo.go @@ -62,7 +62,7 @@ func (h *highlightrepo) highlightline(line string) error { } if _, err := os.Stat(absPath); err != nil { - return err + return fmt.Errorf("orig %s, abs %s : %w", line, absPath, err) } paths := strings.Split(absPath, SEP) From d5aa503821e3f2d35783183912ba2cf20344ffa3 Mon Sep 17 00:00:00 2001 From: bayashi <42190+bayashi@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:53:57 +0000 Subject: [PATCH 2/4] fix indent --- arg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arg.go b/arg.go index 04283b9..8e0ef47 100644 --- a/arg.go +++ b/arg.go @@ -24,7 +24,7 @@ var ( type options struct { color string noTilde bool - nonTTY bool + nonTTY bool } func (cli *runner) parseArgs() *options { From b475828c3babdc6fba51ee27c66887cd66189a23 Mon Sep 17 00:00:00 2001 From: bayashi <42190+bayashi@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:10:19 +0000 Subject: [PATCH 3/4] Add a step to create testdata/ --- .github/workflows/run-tests.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 7144f77..17d1cec 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -43,6 +43,14 @@ jobs: mkdir -p $HOME/.config/irir curl -L https://bit.ly/irir-gotest-conf > $HOME/.config/irir/irir_rule.yaml + - name: Set up test structure + run: | + mkdir testdata + mkdir testdata/foo + mkdir testdata/bar + touch testdata/bar/.git + mkdir -p testdata/baz/.git + - name: Test with the Go CLI shell: 'script -q -e -c "bash {0}"' run: irir gotest -- go test -v -shuffle=on -timeout=3m -cover ./... From a2c2965d75f69b4f9afa2360519ee53a6f04c844 Mon Sep 17 00:00:00 2001 From: bayashi <42190+bayashi@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:13:23 +0000 Subject: [PATCH 4/4] Not support Windows --- .github/workflows/run-tests.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 17d1cec..250ecad 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -59,7 +59,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["windows-latest", "macOS-latest"] + os: ["macOS-latest"] runs-on: ${{ matrix.os }} @@ -81,5 +81,13 @@ jobs: - name: Build run: go build -v ./... + - name: Set up test structure + run: | + mkdir testdata + mkdir testdata/foo + mkdir testdata/bar + touch testdata/bar/.git + mkdir -p testdata/baz/.git + - name: Test with the Go CLI run: go test ./... -race -shuffle=on -timeout=3m -cover -v