From 8538ce78594b826dff86d51c7096d9450bf1b44f Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 15 Apr 2022 09:28:56 +0200 Subject: [PATCH] Copy golangci-lint settings from restic --- .github/workflows/tests.yml | 15 ++++++++++++++- .golangci.yml | 6 +++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 91d55c5..a3ccf00 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,6 +50,11 @@ jobs: name: lint runs-on: ubuntu-latest steps: + - name: Set up Go ${{ env.latest_go }} + uses: actions/setup-go@v2 + with: + go-version: ${{ env.latest_go }} + - name: Check out code uses: actions/checkout@v2 @@ -57,8 +62,16 @@ jobs: uses: golangci/golangci-lint-action@v2 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.41 + version: v1.45 + # Optional: show only new issues if it's a pull request. The default value is `false`. + only-new-issues: true args: --verbose --timeout 5m + skip-go-installation: true + + # only run golangci-lint for pull requests, otherwise ALL hints get + # reported. We need to slowly address all issues until we can enable + # linting the master branch :) + if: github.event_name == 'pull_request' - name: Check go.mod/go.sum run: | diff --git a/.golangci.yml b/.golangci.yml index 22c588a..44dfcdc 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -51,7 +51,7 @@ issues: # list of things to not warn about exclude: - # golint: do not warn about missing comments for exported stuff - - exported (function|method|var|type|const) `.*` should have comment or be unexported - # golint: ignore constants in all caps + # revive: do not warn about missing comments for exported stuff + - exported (function|method|var|type|const) .* should have comment or be unexported + # revive: ignore constants in all caps - don't use ALL_CAPS in Go names; use CamelCase