Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
go-version: "1.26.2" # update together with dev.dockerfile
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: "v2.11.4" # update together with dev.dockerfile
version: "v2.12.1" # update together with dev.dockerfile

lint-latest-deps:
runs-on: ubuntu-latest
Expand All @@ -77,7 +77,7 @@ jobs:
- run: make apply-latest-deps
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: "v2.11.4" # update together with dev.dockerfile
version: "v2.12.1" # update together with dev.dockerfile

check-tidy:
name: go mod tidy
Expand Down
25 changes: 10 additions & 15 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ linters:
- bidichk # checks for dangerous unicode character sequences
- bodyclose # checks whether HTTP response body is closed successfully
- canonicalheader # checks whether net/http.Header uses canonical header
- clickhouselint # detects common mistakes with the ClickHouse native Go driver API
- copyloopvar # detects places where loop variables are copied (Go 1.22+)
- cyclop # checks function and package cyclomatic complexity
- depguard # checks if package imports are in a list of acceptable packages
Expand Down Expand Up @@ -89,6 +90,7 @@ linters:
- nolintlint # reports ill-formed or insufficient nolint directives
- nonamedreturns # reports all named returns
- nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL
- paralleltest # detects missing usage of t.Parallel() method in your Go test
- perfsprint # checks that fmt.Sprintf can be replaced with a faster alternative
- predeclared # finds code that shadows one of Go's predeclared identifiers
- promlinter # checks Prometheus metrics naming via promlint
Expand Down Expand Up @@ -146,7 +148,6 @@ linters:
#- maintidx # measures the maintainability index of each function
#- misspell # [useless] finds commonly misspelled English words in comments
#- nlreturn # [too strict and mostly code is not more readable] checks for a new line before return and branch statements to increase code clarity
#- paralleltest # [too many false positives] detects missing usage of t.Parallel() method in your Go test
#- tagliatelle # checks the struct tags
#- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers
#- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines
Expand Down Expand Up @@ -395,21 +396,15 @@ linters:
- github.com/jmoiron/sqlx

sloglint:
# Enforce not using global loggers.
# Values:
# - "": disabled
# - "all": report all global loggers
# - "default": report only the default slog logger
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-global
# Default: ""
# Report the use of global loggers.
# https://github.com/go-simpler/sloglint#no-global-logger
# Values: "all", "default"
# Default: "" (disabled)
no-global: all
# Enforce using methods that accept a context.
# Values:
# - "": disabled
# - "all": report all contextless calls
# - "scope": report only if a context exists in the scope of the outermost function
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#context-only
# Default: ""
# Report the use of functions without a context.Context.
# https://github.com/go-simpler/sloglint#context-only
# Values: "all", "scope"
# Default: "" (disabled)
context: scope

staticcheck:
Expand Down
2 changes: 1 addition & 1 deletion dev.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM golang:1.26.2 AS go

# update together with .github/workflows/ci.yml
FROM golangci/golangci-lint:v2.11.4 AS linter
FROM golangci/golangci-lint:v2.12.1 AS linter

FROM go AS dev
ENV INSIDE_DEV_CONTAINER=1
Expand Down
8 changes: 8 additions & 0 deletions pkg/testpackage/testpackage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
)

func TestAnalyzer_Good(t *testing.T) {
t.Parallel()

testdata, err := filepath.Abs("testdata/good")
if err != nil {
t.FailNow()
Expand All @@ -19,6 +21,8 @@ func TestAnalyzer_Good(t *testing.T) {
}

func TestAnalyzer_Bad(t *testing.T) {
t.Parallel()

testdata, err := filepath.Abs("testdata/bad")
if err != nil {
t.FailNow()
Expand All @@ -28,6 +32,8 @@ func TestAnalyzer_Bad(t *testing.T) {
}

func TestAnalyzer_Allowed(t *testing.T) {
t.Parallel()

analyzer := testpackage.NewAnalyzer()
err := analyzer.Flags.Set(testpackage.AllowPackagesFlagName, "allowed")

Expand All @@ -44,6 +50,8 @@ func TestAnalyzer_Allowed(t *testing.T) {
}

func TestAnalyzer_InvalidRegexp(t *testing.T) {
t.Parallel()

invalid := `\Ca`
analyzer := testpackage.NewAnalyzer()
err := analyzer.Flags.Set(testpackage.SkipRegexpFlagName, invalid)
Expand Down
Loading