Skip to content

Commit b0c3b63

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix-doc
2 parents caa3b8c + 1d46cc7 commit b0c3b63

4 files changed

Lines changed: 25 additions & 25 deletions

File tree

.github/workflows/analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
run: make generate-mock
2323

2424
- name: Static Code Analysis
25-
uses: golangci/golangci-lint-action@v6
25+
uses: golangci/golangci-lint-action@v9
2626
with:
27-
version: latest
27+
version: latest

.golangci.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# Options for analysis running
22
# More info could be found at https://golangci-lint.run/usage/configuration/
3+
version: "2"
4+
35
run:
4-
# timeout for analysis, e.g. 30s, 5m, default is 1m
56
timeout: 5m
67
modules-download-mode: readonly
78

8-
# List of useful linters could be found at https://github.com/golangci/awesome-go-linters
99
linters:
10-
disable-all: true
10+
default: none
1111
enable:
1212
- errcheck
1313
- copyloopvar
14-
- gofumpt
15-
- goimports
16-
- gosimple
1714
- govet
1815
- ineffassign
1916
- makezero
@@ -27,21 +24,20 @@ linters:
2724
- unused
2825
- wastedassign
2926
- gosec
27+
settings:
28+
staticcheck:
29+
checks: [ "all", "-SA1019", "-SA1029", "-ST1000", "-ST1003" ]
30+
gosec:
31+
excludes: [ "G204", "G301", "G302", "G304", "G306", "G601", "G101" ]
32+
config:
33+
global:
34+
nosec: true
3035

31-
linters-settings:
32-
staticcheck:
33-
# https://staticcheck.io/docs/options#checks
34-
checks: [ "all","-SA1019","-SA1029" ]
35-
gosec:
36-
excludes: [ "G204", "G301", "G302", "G304", "G306", "G601", "G101" ]
37-
exclude-generated: true
38-
config:
39-
global:
40-
nosec: true
36+
formatters:
37+
enable:
38+
- gofumpt
39+
- goimports
4140

4241
issues:
43-
exclude-use-default: false
44-
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
4542
max-issues-per-linter: 0
46-
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
4743
max-same-issues: 0

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ GOIMPORTS:
3434
########## ANALYSE ##########
3535

3636
GOLANGCI_LINT = ${TOOLS_DIR}/golangci-lint
37-
GOLANGCI_LINT_VERSION = 1.63.4
37+
GOLANGCI_LINT_VERSION = 2.12.2
3838

3939
verify: GOLANGCI_LINT
4040
echo $(GO_SOURCES)
41-
$(GOLANGCI_LINT) run --out-format tab --config "${WORKSPACE_ROOT}/.golangci.yml"
41+
$(GOLANGCI_LINT) run --config "${WORKSPACE_ROOT}/.golangci.yml"
4242

4343
GOLANGCI_LINT:
4444
${GOLANGCI_LINT} --version 2>/dev/null | grep ${GOLANGCI_LINT_VERSION} || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${TOOLS_DIR} v${GOLANGCI_LINT_VERSION}

apptrust/common/output.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ func PrintTable(data []byte, w io.Writer, orderedKeys []string) error {
3838
return fmt.Errorf("failed to parse response: %w", err)
3939
}
4040
tw := tabwriter.NewWriter(w, 0, 0, 2, ' ', 0)
41-
fmt.Fprintln(tw, "FIELD\tVALUE")
41+
if _, err := fmt.Fprintln(tw, "FIELD\tVALUE"); err != nil {
42+
return err
43+
}
4244
for _, key := range orderedKeys {
4345
val, ok := fields[key]
4446
if !ok || val == nil {
@@ -60,7 +62,9 @@ func PrintTable(data []byte, w io.Writer, orderedKeys []string) error {
6062
if strVal == "" {
6163
continue
6264
}
63-
fmt.Fprintf(tw, "%s\t%s\n", key, strVal)
65+
if _, err := fmt.Fprintf(tw, "%s\t%s\n", key, strVal); err != nil {
66+
return err
67+
}
6468
}
6569
return tw.Flush()
6670
}

0 commit comments

Comments
 (0)