From 6edaf7291d41d3710f2e698441291ebdf5fb6f6f Mon Sep 17 00:00:00 2001 From: haya14busa Date: Sun, 9 Jun 2024 21:18:49 +0900 Subject: [PATCH 1/7] Support related locations --- to-rdjsonl.jq | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/to-rdjsonl.jq b/to-rdjsonl.jq index 0acff9b..04dd614 100644 --- a/to-rdjsonl.jq +++ b/to-rdjsonl.jq @@ -11,8 +11,28 @@ start: { line: .location.line, column: .location.column + }, + end: { + line: .end.line, + column: .end.column } } }, + related_locations: (.related // {}) | map({ + message: .message, + location: { + path: .location.file, + range: { + start: { + line: .location.line, + column: .location.column + }, + end: { + line: .end.line, + column: .end.column + } + } + } + }), severity: ((.severity|ascii_upcase|select(match("ERROR|WARNING|INFO")))//null) } From ad7ea017daa5cbf3d3be6e28851f7561225b863b Mon Sep 17 00:00:00 2001 From: haya14busa Date: Mon, 17 Jun 2024 22:54:25 +0900 Subject: [PATCH 2/7] test with nightly --- action.yml | 4 +++- script.sh | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 70ddacd..8604b03 100644 --- a/action.yml +++ b/action.yml @@ -38,10 +38,12 @@ inputs: runs: using: 'composite' steps: + - uses: reviewdog/action-setup@v1 + with: + reviewdog_version: nightly - run: $GITHUB_ACTION_PATH/script.sh shell: bash env: - REVIEWDOG_VERSION: 'v0.17.5' INPUT_GITHUB_TOKEN: '${{ inputs.github_token }}' INPUT_WORKDIR: '${{ inputs.workdir }}' INPUT_LEVEL: '${{ inputs.level }}' diff --git a/script.sh b/script.sh index ccd9326..a8c3a66 100755 --- a/script.sh +++ b/script.sh @@ -7,10 +7,6 @@ TEMP_PATH="$(mktemp -d)" PATH="${TEMP_PATH}:$PATH" export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" -echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog' -curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" "${REVIEWDOG_VERSION}" 2>&1 -echo '::endgroup::' - echo '::group:: Installing staticcheck ... https://staticcheck.io' curl -sfL "https://github.com/dominikh/go-tools/releases/latest/download/staticcheck_linux_amd64.tar.gz" | tar -xvz -C "${TEMP_PATH}" --strip-components=1 echo '::endgroup::' From 5d4d6a795889df87f0b48f1a441ac5944092ffd2 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Mon, 17 Jun 2024 22:55:57 +0900 Subject: [PATCH 3/7] update test data --- testdata/testdata.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testdata/testdata.go b/testdata/testdata.go index db75a85..e2fd0f4 100644 --- a/testdata/testdata.go +++ b/testdata/testdata.go @@ -21,7 +21,7 @@ func unused() { regexp.Compile(".\\") s := []string{} - if s != nil { + if s != nil { // test for _, x := range s { fmt.Println(x) } From e1c729d88ca47eb0ea106eaa44e3e114836f4877 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Mon, 17 Jun 2024 22:57:06 +0900 Subject: [PATCH 4/7] Update test data --- testdata/testdata.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testdata/testdata.go b/testdata/testdata.go index e2fd0f4..44fbbb1 100644 --- a/testdata/testdata.go +++ b/testdata/testdata.go @@ -14,6 +14,8 @@ const ( func unused() { regexp.Compile(".+") + nonNilVar := []int{} + if errors.New("abcd") == errors.New("abcd") { // Test SA4000 } @@ -26,4 +28,8 @@ func unused() { fmt.Println(x) } } + + if nonNilVar != nil { + fmt.Println(nonNilVar) + } } From 97409bade5018ac0a459ccfbf31c28ce8dbfe87f Mon Sep 17 00:00:00 2001 From: haya14busa Date: Mon, 17 Jun 2024 23:45:04 +0900 Subject: [PATCH 5/7] Bump up reviewdog version to v0.18.0 --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 8604b03..cf5a476 100644 --- a/action.yml +++ b/action.yml @@ -40,7 +40,7 @@ runs: steps: - uses: reviewdog/action-setup@v1 with: - reviewdog_version: nightly + reviewdog_version: v0.18.0 - run: $GITHUB_ACTION_PATH/script.sh shell: bash env: From 9a218906971762822b019d33e992c6646048d04c Mon Sep 17 00:00:00 2001 From: haya14busa Date: Sat, 22 Jun 2024 22:38:16 +0900 Subject: [PATCH 6/7] Bump up reviewdog version to v0.18.1 --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index cf5a476..9217bfe 100644 --- a/action.yml +++ b/action.yml @@ -40,7 +40,7 @@ runs: steps: - uses: reviewdog/action-setup@v1 with: - reviewdog_version: v0.18.0 + reviewdog_version: v0.18.1 - run: $GITHUB_ACTION_PATH/script.sh shell: bash env: From 081d68cfdb40ee1f792cfc77c27f90b175b23317 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Sat, 22 Jun 2024 22:39:28 +0900 Subject: [PATCH 7/7] empty commit