Skip to content

Commit 3eac9ef

Browse files
authored
Merge branch 'aquasecurity:main' into feat/add-altlinux-support
2 parents 7998429 + a8b27ae commit 3eac9ef

File tree

6 files changed

+50
-38
lines changed

6 files changed

+50
-38
lines changed

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
go-version-file: go.mod
1616

1717
- name: Lint
18-
uses: golangci/golangci-lint-action@v6.2.0
18+
uses: golangci/golangci-lint-action@v7.0.0
1919
with:
20-
version: v1.54
20+
version: v2.0
2121
args : --verbose
2222

2323
- name: Test

.golangci.yml

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,52 @@
1+
version: "2"
12
run:
2-
go: 1.21
3-
timeout: 5m
3+
go: "1.21"
44
linters:
55
enable:
6-
- gofmt
76
- bodyclose
8-
- staticcheck
9-
- unused
10-
- gci
117
- gomodguard
12-
- tenv
13-
- gosimple
14-
- govet
8+
- staticcheck
159
disable:
1610
- errcheck
1711
- ineffassign
18-
- structcheck
19-
linters-settings:
20-
gci:
21-
sections:
22-
- standard
23-
- default
24-
- prefix(github.com/aquasecurity/)
25-
- blank
26-
- dot
27-
gomodguard:
28-
blocked:
29-
modules:
30-
- github.com/hashicorp/go-version:
31-
recommendations:
32-
- github.com/aquasecurity/go-version
33-
reason: "`aquasecurity/go-version` is degisned for our use-cases"
34-
- github.com/Masterminds/semver:
35-
recommendations:
36-
- github.com/aquasecurity/go-version
37-
reason: "`aquasecurity/go-version` is degisned for our use-cases"
38-
12+
settings:
13+
gomodguard:
14+
blocked:
15+
modules:
16+
- github.com/hashicorp/go-version:
17+
recommendations:
18+
- github.com/aquasecurity/go-version
19+
reason: '`aquasecurity/go-version` is degisned for our use-cases'
20+
- github.com/Masterminds/semver:
21+
recommendations:
22+
- github.com/aquasecurity/go-version
23+
reason: '`aquasecurity/go-version` is degisned for our use-cases'
24+
exclusions:
25+
generated: lax
26+
presets:
27+
- comments
28+
- common-false-positives
29+
- legacy
30+
- std-error-handling
31+
paths:
32+
- third_party$
33+
- builtin$
34+
- examples$
35+
formatters:
36+
enable:
37+
- gci
38+
- gofmt
39+
settings:
40+
gci:
41+
sections:
42+
- standard
43+
- default
44+
- prefix(github.com/aquasecurity/)
45+
- blank
46+
- dot
47+
exclusions:
48+
generated: lax
49+
paths:
50+
- third_party$
51+
- builtin$
52+
- examples$

arch/archlinux_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package arch_test
22

33
import (
4-
"io"
54
"net/http"
65
"net/http/httptest"
76
"os"
@@ -41,7 +40,7 @@ func TestUpdate(t *testing.T) {
4140
b, err := os.ReadFile(tt.inputJSONFile)
4241
require.NoError(t, err)
4342

44-
_, _ = io.WriteString(w, string(b))
43+
_, _ = w.Write(b)
4544
}))
4645
defer ts.Close()
4746

cwe/cwe_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cwe
22

33
import (
4-
"io"
54
"net/http"
65
"net/http/httptest"
76
"os"
@@ -57,7 +56,7 @@ func TestUpdate(t *testing.T) {
5756
} else {
5857
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
5958
b, _ := os.ReadFile(tc.inputZipFile)
60-
_, _ = io.WriteString(w, string(b))
59+
_, _ = w.Write(b)
6160
}))
6261
cweURL = ts.URL
6362
defer func() {

ghsa/ghsa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (c Config) update(ecosystem SecurityAdvisoryEcosystem) error {
131131

132132
bar := pb.StartNew(len(ghsaJsonMap))
133133
for _, ghsaJson := range ghsaJsonMap {
134-
pkgName := strings.Replace(ghsaJson.Package.Name, ":", "/", -1)
134+
pkgName := strings.ReplaceAll(ghsaJson.Package.Name, ":", "/")
135135
// Part Swift advisories have `https://` prefix or `.git` suffix
136136
// e.g. https://github.com/github/advisory-database/blob/76f65b0d0fdac39c8b0e834ab03562b5f80d5b27/advisories/github-reviewed/2023/06/GHSA-r6ww-5963-7r95/GHSA-r6ww-5963-7r95.json#L21
137137
// https://github.com/github/advisory-database/blob/76f65b0d0fdac39c8b0e834ab03562b5f80d5b27/advisories/github-reviewed/2023/07/GHSA-jq43-q8mx-r7mq/GHSA-jq43-q8mx-r7mq.json#L21

mariner/mariner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (c Config) Update() error {
106106
continue
107107
}
108108

109-
if !(strings.HasPrefix(entry.Name(), marinerPrefix) || strings.HasPrefix(entry.Name(), azurePrefix)) {
109+
if !strings.HasPrefix(entry.Name(), marinerPrefix) && !strings.HasPrefix(entry.Name(), azurePrefix) {
110110
continue
111111
}
112112
if filepath.Ext(entry.Name()) != ".xml" {

0 commit comments

Comments
 (0)