Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: implement common check methods by check base #135

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: rm deprecated configs from golangci-lint config
  • Loading branch information
lvlcn-t committed May 6, 2024
commit 81e0f4f2d2d6ac42e69c66d44b3dd267c0ae4e9d
24 changes: 14 additions & 10 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json
linters-settings:
depguard:
# new configuration
Expand Down Expand Up @@ -36,7 +37,7 @@ linters-settings:
replacement: "any"
goimports:
local-prefixes: github.com/golangci/golangci-lint
gomnd:
mnd:
# don't include the "operation" and "assign"
checks:
- argument
Expand All @@ -52,14 +53,17 @@ linters-settings:
- strings.SplitN

govet:
check-shadowing: true
enable-all: true
disable:
- fieldalignment # disabled because it's too strict, it checks if struct fields are sorted by size
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf

lll:
line-length: 140
misspell:
Expand Down Expand Up @@ -91,7 +95,7 @@ linters:
- gocyclo
- gofmt
- goimports
- gomnd
- mnd
- goprintffuncname
- gosec
- gosimple
Expand Down Expand Up @@ -128,11 +132,16 @@ 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
exclude-rules:
- path: _test\.go
linters:
- gomnd
- revive
- mnd # test files can have magic numbers
- revive # test files can have unused parameters

- path: pkg/golinters/errcheck.go
text: "SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead"
Expand All @@ -154,8 +163,3 @@ issues:

run:
timeout: 5m
skip-dirs:
- test/testdata_etc # test files
- internal/cache # extracted from Go code
- internal/renameio # extracted from Go code
- internal/robustio # extracted from Go code