Skip to content

Commit 905b06d

Browse files
chore(deps): update golang-ci lint version and migrate config
Signed-off-by: Swapnanil Gupta <swpnlg@amazon.com>
1 parent bf4dee5 commit 905b06d

File tree

2 files changed

+56
-54
lines changed

2 files changed

+56
-54
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
workflow_dispatch:
1414
env:
1515
GO_VERSION: '1.24.11'
16-
GOLANGCI_LINT_VERSION: '1.64.8'
16+
GOLANGCI_LINT_VERSION: '2.7.2'
1717
jobs:
1818
git-secrets:
1919
runs-on: ubuntu-latest

.golangci.yaml

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,75 @@
1-
# The sections in this file are ordered in the order presented in
2-
# https://golangci-lint.run/usage/configuration/.
3-
# The nested fields are ordered alphabetically.
1+
# This file is generated by migrating the older v1 config
2+
# file to v2 using `golangci-lint migrate` command.
3+
# Details about the migration: https://golangci-lint.run/docs/product/migration-guide/
4+
# The configuration `run.timeout` is ignored. By default, in v2, the timeout is disabled.
45

5-
linters-settings:
6-
goheader:
7-
template-path: copyright_header
8-
goimports:
9-
local-prefixes: github.com/runfinch/finch-daemon
10-
gosec:
11-
config:
12-
G306: "0o644"
13-
excludes:
14-
- G304
15-
- G101
16-
- G104
17-
- G115 # added to prevent false uint conversion errors
18-
lll:
19-
line-length: 250
20-
tab-width: 4
21-
makezero:
22-
always: true
23-
nolintlint:
24-
require-explanation: true
25-
require-specific: true
26-
stylecheck:
27-
checks: ["all", "-ST1003", "-ST1000", "-ST1001", "-ST1021"]
6+
version: "2"
287
linters:
298
enable:
30-
# - errname
31-
# - errorlint
329
- copyloopvar
33-
# - forcetypeassert
34-
# - gocritic
3510
- godot
36-
# - gofumpt
3711
- goheader
38-
# - goimports
3912
- gosec
4013
- lll
41-
# - makezero
4214
- misspell
43-
# - nilerr
44-
# - nilnil
4515
- nolintlint
4616
- nosprintfhostport
47-
# - paralleltest
4817
- predeclared
4918
- reassign
50-
# - revive
19+
- staticcheck
5120
- testableexamples
5221
- unconvert
53-
# - unparam
5422
- usestdlibvars
5523
- wastedassign
5624
- whitespace
57-
- stylecheck
5825
disable:
5926
- errcheck
60-
issues:
61-
exclude-rules:
62-
- linters:
63-
- lll
64-
# A go:generate statement has to be in the same line:
65-
# https://github.com/golang/go/issues/46050.
66-
source: "^//go:generate "
67-
# Some checks enabled in the stylecheck setting are disabled by default
68-
# (e.g., https://golangci-lint.run/usage/false-positives/#exc0013),
69-
# so we need to enable them explicitly here.
70-
exclude-use-default: false
71-
# fix: true
72-
run:
73-
timeout: 5m
27+
settings:
28+
goheader:
29+
template-path: copyright_header
30+
gosec:
31+
excludes:
32+
- G304
33+
- G101
34+
- G104
35+
- G115 # added to prevent false uint conversion errors
36+
config:
37+
G306: "0o644"
38+
lll:
39+
line-length: 250
40+
tab-width: 4
41+
makezero:
42+
always: true
43+
nolintlint:
44+
require-explanation: true
45+
require-specific: true
46+
staticcheck:
47+
checks:
48+
- all
49+
- -ST1000
50+
- -ST1001
51+
- -ST1003
52+
- -ST1021
53+
exclusions:
54+
generated: lax
55+
rules:
56+
- linters:
57+
- lll
58+
# A go:generate statement has to be in the same line:
59+
# https://github.com/golang/go/issues/46050.
60+
source: '^//go:generate '
61+
paths:
62+
- third_party$
63+
- builtin$
64+
- examples$
65+
formatters:
66+
settings:
67+
goimports:
68+
local-prefixes:
69+
- github.com/runfinch/finch-daemon
70+
exclusions:
71+
generated: lax
72+
paths:
73+
- third_party$
74+
- builtin$
75+
- examples$

0 commit comments

Comments
 (0)