Skip to content

Commit fc956db

Browse files
Eli/fix golang (#1007)
Co-authored-by: Tyler Jang <tyler@trunk.io>
1 parent 69212bf commit fc956db

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

linters/golangci-lint/golangci_lint.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@ const testGenerator = ({
1616
skipTestIf?: (version?: string) => boolean;
1717
}) => {
1818
const skipTest = (v1: boolean) => (version?: string) => {
19-
if (v1 && semver.gte(version ?? "", "2.0.0")) {
19+
if (v1 && version === "Latest") {
2020
return true;
21-
} else if (!v1 && semver.lt(version ?? "", "2.0.0")) {
21+
}
22+
23+
const parsedVersion = semver.parse(version);
24+
if (!parsedVersion) {
25+
return false;
26+
}
27+
if (v1 && parsedVersion.major >= 2) {
28+
return true;
29+
} else if (!v1 && parsedVersion.major < 2) {
2230
return true;
2331
}
2432

linters/golangci-lint/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ lint:
119119
- go.mod
120120
- go.sum
121121
issue_url_format: https://golangci-lint.run/usage/linters/
122-
known_good_version: 1.49.0
122+
known_good_version: 2.0.0
123123
version_command:
124124
parse_regex: ${semver}
125125
run: golangci-lint --version

linters/osv-scanner/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ lint:
4242
files: [lockfile]
4343
tools: [osv-scanner]
4444
known_good_version: 2.0.1
45-
description: Checks for known vulnerabilities in your dependencies.
45+
description: Checks for known vulnerabilities in your dependencies
4646
commands:
4747
- name: scan
4848
output: sarif

0 commit comments

Comments
 (0)