Skip to content

Commit

Permalink
Merge pull request #915 from ydb-platform/revert-golangci-config
Browse files Browse the repository at this point in the history
Revert golangci config
  • Loading branch information
asmyasnikov authored Dec 30, 2023
2 parents 74b968a + f2718e1 commit d011ece
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 83 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.0
version: v1.55.2
golangci-examples:
name: golangci-lint-examples
concurrency:
Expand All @@ -34,7 +34,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.0
version: v1.55.2
working-directory: examples
golangci-slo:
name: golangci-lint-slo
Expand All @@ -51,7 +51,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.0
version: v1.55.2
working-directory: tests/slo
autoformatter:
name: autoformat check
Expand Down
139 changes: 59 additions & 80 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# options for analysis running
run:
# default concurrency is a available CPU number
concurrency: 4

# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 5m

# exit code when at least one issue was found, default is 1
issues-exit-code: 1

Expand Down Expand Up @@ -58,7 +52,6 @@ linters-settings:
govet:
# report about shadowed variables
check-shadowing: true
fieldalignment: true
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
Expand All @@ -76,9 +69,6 @@ linters-settings:
min-len: 2
# minimal occurrences count to trigger, 3 by default
min-occurrences: 2
fieldalignment:
# print struct with more effective memory layout or not, false by default
suggest-new: true
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
Expand Down Expand Up @@ -109,17 +99,7 @@ linters-settings:
- name: empty-block
- name: superfluous-else
- name: unreachable-code
unused:
# treat code as a program (not a library) and report unused exported identifiers; default is false.
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
unparam:
# call graph construction algorithm (cha, rta). In general, use cha for libraries,
# and rta for programs with main packages. Default is cha.
algo: cha

# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
Expand All @@ -130,7 +110,7 @@ linters-settings:
- whyNoLint # https://github.com/go-critic/go-critic/issues/1063
- importShadow
- sloppyReassign
# - typeDefFirst
# - typeDefFirst
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
# See https://github.com/go-critic/go-critic#usage -> section "Tags".
# Default: []
Expand Down Expand Up @@ -225,66 +205,68 @@ linters-settings:
# Default: false
checkExported: true
linters:
disable-all: true
enable:
# - cyclop
enable-all: true
disable:
- asasalint
- bodyclose
- containedctx
- contextcheck
- cyclop
- deadcode
- depguard
- dogsled
# - dupl
- errcheck
- errorlint
# - exhaustive
# - exhaustivestruct
# - forbidigo
# - funlen
# - gci
# - gocognit
- dupl
- dupword
- durationcheck
- errname
- exhaustive
- exhaustivestruct
- exhaustruct
- forbidigo
- forcetypeassert
- funlen
- gci
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
# - godot
- godox
- gofmt # On why gofmt when goimports is enabled - https://github.com/golang/go/issues/21476
- gofumpt
- goheader
- goimports
# - gomnd
# - gomoddirectives
# - gomodguard
- godot
- goerr113
- golint
- gomnd
- gomoddirectives
- gosec
- gosimple
- govet
- depguard
# - ifshort
# - ireturn
- lll
- makezero
- misspell
- ineffassign
- misspell
- ifshort
- inamedparam
- interfacebloat
- interfacer
- ireturn
- maintidx
- maligned
- nakedret
- nestif
# - nilnil
# - nlreturn
- nolintlint
- prealloc
- predeclared
- rowserrcheck
- nilerr
- nilnil
- nlreturn
- noctx
- nonamedreturns
- nosnakecase
- paralleltest
- promlinter
- protogetter
- revive
- staticcheck
- stylecheck
# - tagliatelle
# - testpackage
# - thelper
# - tenv
- typecheck
- unconvert
- unparam
- unused
# - varnamelen
- whitespace
# - wrapcheck
# - wsl
- scopelint
- sqlclosecheck
- structcheck
- tagalign
- tagliatelle
- testableexamples
- testifylint
- testpackage
- thelper
- varcheck
- varnamelen
- wastedassign
- wrapcheck
- wsl

issues:
# List of regexps of issue texts to exclude, empty list by default.
Expand All @@ -309,9 +291,6 @@ issues:
# Default value for this option is true.
exclude-use-default: true

# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-per-linter: 0

# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0

Expand Down Expand Up @@ -341,4 +320,4 @@ issues:
linters:
- staticcheck
- path: _test\.go
text: "ydb.Connection is deprecated"
text: "ydb.Connection is deprecated"

0 comments on commit d011ece

Please sign in to comment.