Skip to content

Commit

Permalink
chore: update golangci-lint configuration to enforce logging standard…
Browse files Browse the repository at this point in the history
…s and refine exclusions

Signed-off-by: lvlcn-t <[email protected]>
  • Loading branch information
lvlcn-t committed Dec 4, 2024
1 parent 08ba8ce commit a9c6fcd
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json
linters-settings:
depguard:
# new configuration
rules:
logger:
deny:
# logging is allowed only by logutils.Log,
# logrus is allowed to use only in logutils package.
- pkg: "github.com/sirupsen/logrus"
desc: logging is allowed only by logutils.Log
desc: use the standard library's slog.Logger instead
- pkg: "github.com/ueber-go/zap"
desc: use the standard library's slog.Logger instead
dupl:
threshold: 100
funlen:
Expand Down Expand Up @@ -71,17 +70,13 @@ linters-settings:
nolintlint:
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
require-specific: true # require nolint directives to be specific about which linter is being skipped
revive:
rules:
- name: unexported-return
disabled: true
- name: unused-parameter

gosec:
excludes:
- "G115" # Excluded per default https://github.com/golangci/golangci-lint/pull/4941

linters:
disable-all: true
enable:
Expand Down Expand Up @@ -137,10 +132,9 @@ linters:
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-dirs:
- test/testdata_etc # test files
- internal/cache # extracted from Go code
- internal/renameio # extracted from Go code
- internal/robustio # extracted from Go code
- test/data # test files
- test/testdata # test files
- internal/cache # internal package
exclude-rules:
- path: _test\.go
linters:
Expand Down

0 comments on commit a9c6fcd

Please sign in to comment.