Skip to content

Commit

Permalink
test: Add and clean up lint checks (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
bodgit authored Sep 27, 2023
1 parent d62bcde commit 5e5ddfb
Show file tree
Hide file tree
Showing 22 changed files with 874 additions and 462 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,26 @@ jobs:
with:
go-version: ${{ matrix.go }}

#- name: golangci-lint
# uses: golangci/golangci-lint-action@v3
# if: github.event_name == 'pull_request'
# with:
# only-new-issues: true
- name: golangci-lint (gokrb5)
uses: golangci/golangci-lint-action@v3
if: github.event_name == 'pull_request'
with:
only-new-issues: true

- name: golangci-lint (apcera)
uses: golangci/golangci-lint-action@v3
if: github.event_name == 'pull_request'
with:
only-new-issues: true
args: --build-tags apcera

- name: golangci-lint (SSPI)
uses: golangci/golangci-lint-action@v3
if: github.event_name == 'pull_request'
with:
only-new-issues: true
env:
GOOS: windows

- name: Install Kerberos client
run: |
Expand Down
87 changes: 87 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
issues:
exclude-use-default: false
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- cyclop
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- forbidigo
- forcetypeassert
- funlen
- gci
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- gofumpt
- goheader
- goimports
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- grouper
- importas
- ineffassign
- interfacebloat
- lll
- loggercheck
- maintidx
- makezero
- misspell
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- nosprintfhostport
- paralleltest
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagliatelle
- tenv
- testableexamples
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- wsl
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.5.3
hooks:
- id: commitizen
- repo: https://github.com/golangci/golangci-lint
rev: v1.54.1
hooks:
- id: golangci-lint
Loading

0 comments on commit 5e5ddfb

Please sign in to comment.