From 754a5226136ca7e707e3d78853367dd756f31f33 Mon Sep 17 00:00:00 2001 From: Marcel Schramm Date: Sun, 10 Nov 2024 13:52:36 +0100 Subject: [PATCH] Update linter settings * Remove old deprecated linters * Add new deprecated linters * disable annoying style rules --- .golangci.yml | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index c35781f0..e303a677 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,17 +1,10 @@ linters: enable-all: true disable: - ## These are all deprecated - - golint - - ifshort - - exhaustivestruct - - deadcode - - nosnakecase - - varcheck - - interfacer - - maligned - - structcheck - - scopelint + ## These are deprecated + - execinquery + - exportloopref + - gomnd ## These are too strict for our taste # Whitespace linter @@ -19,7 +12,7 @@ linters: # Demands a newline before each return - nlreturn # Magic numbers - - gomnd + - mnd # function, line and variable length - funlen - lll @@ -46,7 +39,11 @@ linters: # Requires certain types of tags, such as json or mapstructure. # While very useful, I don't care right now. - musttag - - goerr113 + # Not wrapping errors + - err113 + - wrapcheck + # Code duplications + - dupl ## Provides no real value - testifylint @@ -64,12 +61,24 @@ linters-settings: # This has false positives and provides little value. - ifElseChain + revive: + rules: + - name: var-naming + disabled: true + + stylecheck: + checks: ["all", "-ST1003"] + run: - skip-files: + exclude-files: - ".*_easyjson.go" issues: exclude-rules: + - path: translations\\[^e][^n].*?\.go + linters: + # Too many potential false positives + - misspell # Exclude some linters from running on tests files. In tests, we often have # code that is rather unsafe and only has one purpose, or furthermore things # that indicate an issue in production, but are fine for testing only small