Skip to content

Commit

Permalink
test/lint: Swap to golangci-lint instead of golint
Browse files Browse the repository at this point in the history
More configuration and options for controlling linters.
  • Loading branch information
jacobbednarz committed Jul 8, 2021
1 parent 0bd6dc3 commit 716baa2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint
on: [push, pull_request]
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: "--config .golintci.yaml"
only-new-issues: true # only show new issues in the PR, not all.
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ jobs:
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
- name: Lint
if: matrix.os != 'windows-latest'
run: |
go get -v -u golang.org/x/lint/golint
$(go env GOPATH)/bin/golint -set_exit_status . cmd/flarectl
- name: Vet
run: go vet ./...
- name: Test
Expand Down
19 changes: 19 additions & 0 deletions .golintci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
run:

# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 1m

# exit code when at least one issue was found, default is 1
issues-exit-code: 1

# include test files or not, default is true
tests: true

# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true

modules-download-mode: readonly

output:
format: colored-line-number

0 comments on commit 716baa2

Please sign in to comment.