From eb10a0e70a46cee4d65d1fe3ce16df75e3e61d54 Mon Sep 17 00:00:00 2001 From: Dusan Malusev Date: Tue, 3 Sep 2024 11:27:26 +0200 Subject: [PATCH] improvement(lint): do not lint all the installed packages Signed-off-by: Dusan Malusev --- .golangci.yml | 40 +++++++++++++++++++++++++++++++++++----- Makefile | 3 +-- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index bf3e1cbc..0b0f7778 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,20 +1,44 @@ +run: + concurrency: 8 + timeout: 10m + issues-exit-code: 1 + tests: true + modules-download-mode: mod + allow-parallel-runners: true + go: '1.23' + + +output: + print-issued-lines: true + print-linter-name: true + uniq-by-line: true + sort-results: true + issues: + max-same-issues: 1 + max-issues-per-linter: 50 + new: true exclude: - Error return value of `.*.Unlock` is not checked - Error return value of `.*.Completed` is not checked linters: disable-all: true enable: + - asasalint + - bidichk - errcheck - govet + - bodyclose - ineffassign - unused + - durationcheck - goheader - goimports - misspell - gofumpt - gosimple - staticcheck + - decorder - lll - errorlint - gocritic @@ -25,16 +49,22 @@ linters: - tparallel - typecheck - unused -run: - deadline: 10m - modules-download-mode: readonly + - gomodguard + - gocyclo + - nilerr + - makezero + - wastedassign + - prealloc + + linters-settings: govet: - check-shadowing: true settings: shadow: strict: true enable-all: true + gocyclo: + min-complexity: 50 lll: line-length: 180 goheader: @@ -64,8 +94,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.' + gofumpt: - lang-version: "1.12" extra-rules: true goimports: local-prefixes: github.com/scylladb/gemini \ No newline at end of file diff --git a/Makefile b/Makefile index 55663088..c4217c45 100644 --- a/Makefile +++ b/Makefile @@ -26,8 +26,7 @@ $(GOBIN)/golangci-lint: Makefile .PHONY: check-golangci check-golangci: $(GOBIN)/golangci-lint - @echo $(GOPACKAGES) | sed -e 's/github.com\/scylladb\/gemini/./g' | \ - xargs $(GOBIN)/golangci-lint run --max-issues-per-linter=0 --max-same-issues=0 + $(GOBIN)/golangci-lint run --max-issues-per-linter=0 --max-same-issues=0 # fix-golangci Automated fix for golangci-lint errors. .PHONY: fix-golangci