Skip to content

Commit 6efac18

Browse files
authored
upd golangci-lint to v2.12.2 (#721)
1 parent da73856 commit 6efac18

13 files changed

Lines changed: 37 additions & 25 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ permissions:
2424
env:
2525
PRE_RELEASE: ${{ github.ref == 'refs/heads/main' && 'main' || '' }}
2626
GO_RELEASER_VER: "v2.14.1"
27-
GO_LANGCI_LINT_VER: "v2.11.4"
27+
GO_LANGCI_LINT_VER: "v2.12.2"
2828
GO_TESTSUM_VER: "1.13.0"
2929
SYFT_VER: "v1.13.0"
3030

.golangci.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ linters:
1919
- exhaustive
2020
- forbidigo
2121
- gochecknoglobals # no configuration options
22+
- gomodguard # deprecated, replaced by gomodguard_v2
2223
- nilnil
2324
- nlreturn # redundant with wsl
2425
- noinlineerr
@@ -29,7 +30,7 @@ linters:
2930
- varnamelen
3031
- wrapcheck
3132
- wsl
32-
33+
3334
settings:
3435
cyclop:
3536
max-complexity: 12
@@ -52,10 +53,6 @@ linters:
5253
enabled-checks:
5354
- commentedOutCode
5455

55-
gomoddirectives:
56-
replace-allow-list:
57-
- github.com/slok/go-http-metrics
58-
5956
gosec:
6057
excludes:
6158
- G104 # Errors unhandled
@@ -125,6 +122,10 @@ linters:
125122
- path: internal/eds/tests/
126123
linters:
127124
- dupl
125+
- goconst
126+
- path: topazd/tests
127+
linters:
128+
- goconst
128129

129130
formatters:
130131
enable:

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/aserto-dev/topaz
22

33
go 1.25.0
44

5-
toolchain go1.26.2
5+
toolchain go1.26.3
66

77
require (
88
github.com/Masterminds/semver/v3 v3.4.0

internal/eds/pkg/datasync/watermark.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ func (s *Sync) setWatermark(ts *timestamppb.Timestamp) error {
110110
return err
111111
}
112112

113-
wm.ObjectCount = uint(objStats.KeyN) //nolint:gosec // G115: integer overflow conversion int -> uint
114-
wm.RelationCount = uint(relStats.KeyN) //nolint:gosec // G115: integer overflow conversion int -> uint
113+
wm.ObjectCount = uint(objStats.KeyN)
114+
wm.RelationCount = uint(relStats.KeyN)
115115

116116
wm.TotalCount = wm.ObjectCount + wm.RelationCount
117117

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ EXT_TMP_DIR := ${EXT_DIR}/tmp
2525
GO_VER := 1.26
2626
SVU_VER := 3.3.0
2727
GOTESTSUM_VER := 1.13.0
28-
GOLANGCI-LINT_VER := 2.11.4
28+
GOLANGCI-LINT_VER := 2.12.2
2929
GORELEASER_VER := 2.14.1
3030
SYFT_VER := 1.13.0
3131

topaz/certs/generator.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ func GenerateCerts(force bool, dnsNames []string, certPaths ...*CertPaths) error
5959
return generate(dnsNames, certPaths...)
6060
}
6161

62+
const generated string = "generated"
63+
6264
func generate(dnsNames []string, certPaths ...*CertPaths) error {
6365
logger := zerolog.Nop()
6466
ctx := logger.WithContext(context.Background())
@@ -82,9 +84,9 @@ func generate(dnsNames []string, certPaths ...*CertPaths) error {
8284
return errors.Wrap(err, "failed to create dev certs")
8385
}
8486

85-
data = append(data, []any{filepath.Base(certPaths.CA), "generated"})
86-
data = append(data, []any{filepath.Base(certPaths.Cert), "generated"})
87-
data = append(data, []any{filepath.Base(certPaths.Key), "generated"})
87+
data = append(data, []any{filepath.Base(certPaths.CA), generated})
88+
data = append(data, []any{filepath.Base(certPaths.Cert), generated})
89+
data = append(data, []any{filepath.Base(certPaths.Key), generated})
8890
}
8991

9092
tab.Bulk(data)

topaz/cmd/authorizer/authorizer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package authorizer
22

3+
const (
4+
allowed string = "allowed"
5+
)
6+
37
type AuthorizerCmd struct {
48
CheckDecision EvalCmd `cmd:"" name:"eval" help:"evaluate policy decision"`
59
ExecQuery QueryCmd `cmd:"" name:"query" help:"execute query"`

topaz/cmd/authorizer/decisiontree.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (cmd *DecisionTreeCmd) template() proto.Message {
4242
return &authorizer.DecisionTreeRequest{
4343
PolicyContext: &api.PolicyContext{
4444
Path: "",
45-
Decisions: []string{"allowed"},
45+
Decisions: []string{allowed},
4646
},
4747
IdentityContext: &api.IdentityContext{
4848
Identity: "",

topaz/cmd/authorizer/eval.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (cmd *EvalCmd) template() proto.Message {
4141
return &authorizer.IsRequest{
4242
PolicyContext: &api.PolicyContext{
4343
Path: "",
44-
Decisions: []string{"allowed"},
44+
Decisions: []string{allowed},
4545
},
4646
IdentityContext: &api.IdentityContext{
4747
Identity: "",

topaz/cmd/authorizer/query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (cmd *QueryCmd) template() proto.Message {
4949
},
5050
PolicyContext: &api.PolicyContext{
5151
Path: "",
52-
Decisions: []string{"allowed"},
52+
Decisions: []string{allowed},
5353
},
5454
IdentityContext: &api.IdentityContext{
5555
Identity: "",

0 commit comments

Comments
 (0)