From 8e3b76b9e2cbdb645d672c43e5b1408213265d22 Mon Sep 17 00:00:00 2001 From: cshayner Date: Wed, 24 Jul 2024 17:34:20 +0300 Subject: [PATCH] lint --- .github/workflows/build.yaml | 1 + .github/workflows/test.yaml | 1 + .golangci.yaml | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d97970e2..f55b906d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -92,6 +92,7 @@ jobs: with: tool_name: golangci-lint fail_on_error: true + golangci_lint_flags: "--skip-dirs tests/yor_plugins" integration-tests: runs-on: [self-hosted, public, linux, x64] steps: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 83863f95..a4d1ee4c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -44,6 +44,7 @@ jobs: with: tool_name: golangci-lint fail_on_error: true + golangci_lint_flags: "--skip-dirs tests/yor_plugins" integration-tests: strategy: matrix: diff --git a/.golangci.yaml b/.golangci.yaml index e52b7bdd..6dd34c9c 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -10,6 +10,22 @@ run: # exit code when at least one issue was found, default is 1 issues-exit-code: 1 + # which dirs to skip: issues from them won't be reported; + # can use regexp here: generated.*, regexp is applied on full path; + # default value is empty list, but default dirs are skipped independently + # from this option's value (see skip-dirs-use-default). + skip-dirs: [] + + # default is true. Enables skipping of directories: + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ + skip-dirs-use-default: true + + # which files to skip: they will be analyzed, but issues from them + # won't be reported. Default value is empty list, but there is + # no need to include all autogenerated files, we confidently recognize + # autogenerated files. If it's not please let us know. + skip-files: [] + # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": # If invoked with -mod=readonly, the go command is disallowed from the implicit # automatic updating of go.mod described above. Instead, it fails when any changes @@ -23,6 +39,8 @@ run: # output configuration options output: + # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" + format: colored-line-number # print lines of code with issue, default is true print-issued-lines: true