From 70a46acac10bbb07dbdcc9df8d1e3a467935ded4 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Fri, 29 Mar 2024 19:48:15 +0000 Subject: [PATCH] rename golangci-lint config file and use golangci-lint-action to lint Signed-off-by: Matthieu MOREL --- .github/workflows/pr-linter-check.yml | 25 +++++++++++-------------- .golangci.yaml | 7 +++++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pr-linter-check.yml b/.github/workflows/pr-linter-check.yml index 077753c73e..9e2543dbc3 100644 --- a/.github/workflows/pr-linter-check.yml +++ b/.github/workflows/pr-linter-check.yml @@ -6,17 +6,14 @@ jobs: name: Run Linter Check runs-on: ubuntu-latest steps: - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.22' - - - name: Check out the code - uses: actions/checkout@v4 - - - name: golangci-lint - uses: golangci/golangci-lint-action@v5 - with: - version: v1.57.2 - args: --out-format=colored-line-number + - name: Check out the code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Linter check + uses: golangci/golangci-lint-action@v5 + with: + version: v1.57.2 + args: --verbose diff --git a/.golangci.yaml b/.golangci.yaml index 3f7e0c11f5..e17f938d0b 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -36,7 +36,9 @@ run: # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - formats: colored-line-number + formats: + - format: colored-line-number + path: stdout # print lines of code with issue, default is true print-issued-lines: true @@ -250,6 +252,7 @@ linters-settings: enable: - empty - len + - nil-compare testpackage: # regexp pattern to skip files skip-regexp: (export|internal)_test\.go @@ -411,4 +414,4 @@ severity: rules: - linters: - dupl - severity: info \ No newline at end of file + severity: info