diff options
author | Oleksandr Redko <oleksandr.red+github@gmail.com> | 2023-02-11 09:35:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-11 15:35:15 +0800 |
commit | 934f04e33096b7884d96135d44f2879a82e54a94 (patch) | |
tree | 98cd897d8d434aee3c5a95046f9f02ebfcb3721d /.github | |
parent | Rename unexported funcs, vars to match common Go (#1488) (diff) | |
download | fasthttp-934f04e33096b7884d96135d44f2879a82e54a94.tar.gz fasthttp-934f04e33096b7884d96135d44f2879a82e54a94.tar.bz2 fasthttp-934f04e33096b7884d96135d44f2879a82e54a94.zip |
Refactor golangci-lint config and remove redundant nolints (#1486)
* Refactor golangci-lint config
- Use golangci-lint-action for GitHub workflow.
- Add additional golangci-lint run options.
- Remove unused nolint directives.
* Revert exclude-use-default option
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/lint.yml | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fc1fe71..7ea38d7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,37 +12,10 @@ jobs: - uses: actions/setup-go@v3 with: go-version: 1.20.x - - - name: Get Go cache paths - id: go-env - run: | - echo "::set-output name=cache::$(go env GOCACHE)" - echo "::set-output name=modcache::$(go env GOMODCACHE)" - - name: Set up Go cache - uses: actions/cache@v3 - with: - key: golangci-lint-${{ runner.os }}-go-${{ hashFiles('go.mod') }} - restore-keys: golangci-lint-${{ runner.os }}-go- - path: | - ${{ steps.go-env.outputs.cache }} - ${{ steps.go-env.outputs.modcache }} - - - name: Install golangci-lint - run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0 - - - name: Get golangci-lint cache path - id: golangci-lint-cache-status - run: | - echo "::set-output name=dir::$(golangci-lint cache status | head -1 | sed 's/^Dir: //')" - - - name: Set up golangci-lint cache - uses: actions/cache@v3 - with: - key: golangci-lint-${{ runner.os }}-golangci-lint-${{ hashFiles('go.mod') }} - restore-keys: golangci-lint-${{ runner.os }}-golangci-lint- - path: ${{ steps.golangci-lint-cache-status.outputs.dir }} - - run: go version - run: diff -u <(echo -n) <(gofmt -d .) - name: Run golangci-lint - run: golangci-lint run + uses: golangci/golangci-lint-action@v3 + with: + version: v1.51.1 + args: --enable=nolintlint --enable=gochecknoinits --verbose |