Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #812 from kinvolk/knrt10/golint-ci-config-file
Browse files Browse the repository at this point in the history
Add golangci-lint config file
  • Loading branch information
knrt10 authored Aug 20, 2020
2 parents 8ad1c1b + ff08e54 commit 295807c
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
82 changes: 82 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
run:
build-tags:
- aws
- packet
- aks
- e2e
- baremetal
- disruptivee2e
- poste2e

modules-download-mode: vendor

timeout: 5m

issues:
exclude-use-default: false
max-same-issues: 0
max-issues-per-linter: 0

# List for enabled linters can be generated for updates using the following command.
# golangci-lint linters | grep -v -E '(by your configuration linters|^$)' | cut -d: -f1 | cut -d ' ' -f1 | sort | sed 's/^/ - /g'
linters:
disable-all: false
enable:
- asciicheck
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- exhaustive
- funlen
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- gofumpt
- goimports
- golint
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- maligned
- misspell
- nakedret
- nestif
- noctx
- nolintlint
- prealloc
- rowserrcheck
- scopelint
- staticcheck
- structcheck
- stylecheck
- testpackage
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
- wsl

disable:
- exportloopref
- gci
- gochecknoglobals
- godox
- goerr113
- goheader
- gomodguard
- nlreturn
- sqlclosecheck
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test: run-unit-tests
.PHONY: lint
lint: build-slim build-test
@if [ "$$(git config --get diff.noprefix)" = "true" ]; then printf "\n\ngolangci-lint has a bug and can't run with the current git configuration: 'diff.noprefix' is set to 'true'. To override this setting for this repository, run the following command:\n\n'git config diff.noprefix false'\n\nFor more details, see https://github.com/golangci/golangci-lint/issues/948.\n\n\n"; exit 1; fi
golangci-lint run --enable-all --disable=gci,godox,gochecknoglobals,goerr113 --max-same-issues=0 --max-issues-per-linter=0 --build-tags $(ALL_BUILD_TAGS) --new-from-rev=$$(git merge-base $$(cat .git/resource/base_sha 2>/dev/null || echo "origin/master") HEAD) --modules-download-mode=$(MOD) --timeout=5m --exclude-use-default=false ./...
golangci-lint run --new-from-rev=$$(git merge-base $$(cat .git/resource/base_sha 2>/dev/null || echo "origin/master") HEAD) --verbose ./...

.PHONY: lint-docker
lint-docker:
Expand Down

0 comments on commit 295807c

Please sign in to comment.