From 461fe81dcf311494db7e2c3e5c8d5a624df9a9fc Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Thu, 17 Jul 2025 11:01:50 +0200 Subject: golangci.yml: keep linters sorted --- .golangci.yml | 97 +++++++++++++++++++++++++++++++---------------------------- 1 file changed, 51 insertions(+), 46 deletions(-) (limited to '.golangci.yml') diff --git a/.golangci.yml b/.golangci.yml index e5d605ce5..1b95a5a99 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,66 +24,85 @@ formatters: linters: enable: - - lll - - govet - - revive - - unconvert + # keep-sorted start + - dupl + - errorlint + - funlen + - gocognit - goconst - - unused - - misspell - gocyclo + - godot + - goprintffuncname - govet - - whitespace + - lll + - misspell - nestif - - goprintffuncname - - godot - - gocognit - - funlen - - dupl + - recvcheck + - revive - staticcheck - syz-linter - - errorlint - - recvcheck + - unconvert + - unused + - whitespace + # keep-sorted end disable: + # keep-sorted start - bodyclose - depguard - dogsled + # errcheck would be good to enable, but we need to fix existing warnings first. + - errcheck - gochecknoglobals - gochecknoinits + - gocritic - godox - gomodguard - gosec - - rowserrcheck - - testpackage - ineffassign - # errcheck would be good to enable, but we need to fix existing warnings first. - - errcheck - - unparam - nakedret - prealloc - - gocritic + - rowserrcheck + - testpackage + - unparam - wsl + # keep-sorted end settings: - revive: - rules: - - name: package-comments - disabled: true - - name: argument-limit - arguments: [ 7 ] - lll: - line-length: 120 - gocyclo: - # TODO: consider reducing this value. - min-complexity: 24 + # keep-sorted start block=yes + custom: + syz-linter: + path: bin/syz-linter.so dupl: threshold: 60 + errorlint: + comparison: false # we want to use "err == iterator.Done" + funlen: + # TODO: consider reducing these value. + lines: 140 + statements: 80 + gocognit: + # TODO: consider reducing this value. + min-complexity: 70 goconst: min-len: 3 min-occurrences: 3 ignore-string-values: ['\.html|^true$'] + gocyclo: + # TODO: consider reducing this value. + min-complexity: 24 + godot: + scope: toplevel + exclude: ["keep-sorted"] + lll: + line-length: 120 nestif: # TODO: consider reducing this value. min-complexity: 12 + revive: + rules: + - name: package-comments + disabled: true + - name: argument-limit + arguments: [ 7 ] staticcheck: checks: - all @@ -92,21 +111,7 @@ linters: - -ST1021 # comment on exported type Foo should be of the form "Foo ..." (with optional leading article) - -ST1022 # comment on exported const Foo should be of the form "Foo ..." - -QF1008 # could remove embedded field "..." from selector - godot: - scope: toplevel - exclude: ["keep-sorted"] - gocognit: - # TODO: consider reducing this value. - min-complexity: 70 - funlen: - # TODO: consider reducing these value. - lines: 140 - statements: 80 - custom: - syz-linter: - path: bin/syz-linter.so - errorlint: - comparison: false # we want to use "err == iterator.Done" + # keep-sorted end exclusions: warn-unused: true # Log a warning if an exclusion path is unused. rules: -- cgit mrf-deployment