Skip to content

Commit f3b7d4c

Browse files
authored
Bump cli version (#438)
Some other fixes: - Bump renovate tool timeout (Windows debugging) - Add logs to debug Windows eslint JSON errors - Fix `run_from_root_file`/`run_from_root_target` discrepancies
1 parent a86f500 commit f3b7d4c

11 files changed

Lines changed: 26 additions & 58 deletions

File tree

.github/actions/linter_tests/action.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ runs:
7171
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
7272
PLUGINS_TEST_CLI_PATH: ${{ inputs.cli-path }}
7373
SOURCERY_TOKEN: ${{ inputs.sourcery-token }}
74+
# Debug recurrent eslint circular JSON errors
75+
DEBUG: Driver:eslint:*
7476

7577
- name: Run plugin tests
7678
if: runner.os != 'Windows'

.trunk/trunk.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 0.1
22

33
# version used for local trunk runs and testing
44
cli:
5-
version: 1.13.1-beta.25
5+
version: 1.13.1-beta.36
66

77
api:
88
address: api.trunk-staging.io:8443

linters/buf/plugin.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ lint:
6666
run: buf lint --path ${target} --error-format json
6767
success_codes: [0, 100]
6868
run_linter_from: root_file
69-
run_from_root_file: buf.yaml
69+
run_from_root_target: buf.yaml
7070
direct_configs: [buf.yaml]
7171
suggest_if: config_present
7272
environment:
@@ -101,7 +101,7 @@ lint:
101101
# buf is configured to not follow symlinks, and relies on git state, so don't cache results
102102
sandbox_type: copy_targets
103103
cache_results: false
104-
run_from_root_file: buf.work.yaml
104+
run_from_root_target: buf.work.yaml
105105
direct_configs: [buf.yaml, buf.work.yaml]
106106
environment:
107107
- name: PATH

linters/gokart/gokart.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
import { customLinterCheckTest } from "tests";
1+
import path from "path";
2+
import { customLinterCheckTest, TestCallback } from "tests";
3+
import { TEST_DATA } from "tests/utils";
24

3-
customLinterCheckTest({ linterName: "gokart", args: "-a -y" });
5+
const preCheck: TestCallback = (driver) => {
6+
driver.moveFile(path.join(TEST_DATA, "go.mod"), "go.mod");
7+
};
8+
9+
customLinterCheckTest({ linterName: "gokart", args: "-a -y", preCheck });

linters/gokart/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ lint:
1515
environment:
1616
- name: PATH
1717
list: ["${linter}"]
18-
run_from_root_file: go.mod
1918
commands:
2019
- name: lint
2120
output: sarif
@@ -26,6 +25,7 @@ lint:
2625
# gokart runs on directory targets but requires these directories to not be symlinks
2726
sandbox_type: expanded
2827
run_linter_from: root_file
28+
run_from_root_target: go.mod
2929
is_security: true
3030
direct_configs:
3131
- analyzers.yml

linters/golangci-lint/golangci_lint.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,11 @@ import { customLinterCheckTest } from "tests";
33
import { TrunkLintDriver } from "tests/driver";
44
import { TEST_DATA } from "tests/utils";
55

6-
const preCheck = (driver: TrunkLintDriver) => {
7-
["go.mod", ".golangci.yml"].forEach((file) => {
8-
// trunk-ignore(semgrep): paths used here are safe
9-
driver.moveFile(path.join(TEST_DATA, file), file);
10-
});
11-
};
12-
13-
customLinterCheckTest({ linterName: "golangci-lint", args: "-a -y", preCheck });
6+
customLinterCheckTest({ linterName: "golangci-lint", args: "-a -y" });
147

158
// Adding an empty file will cause some other issues to be suppressed.
169
const addEmpty = (driver: TrunkLintDriver) => {
17-
driver.writeFile("empty.go", "");
10+
driver.writeFile(path.join(TEST_DATA, "empty.go"), "");
1811
};
1912

2013
customLinterCheckTest({

linters/golangci-lint/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ lint:
1717
optional: true
1818
runtime: go
1919
package: github.com/golangci/golangci-lint/cmd/golangci-lint
20-
run_from_root_file: go.mod
2120
commands:
2221
- name: lint
2322
# Custom parser type defined in the trunk cli to handle golangci-lint's JSON output.
@@ -38,6 +37,7 @@ lint:
3837
# 7 - error logged
3938
success_codes: [0, 2, 7]
4039
run_linter_from: root_file
40+
run_from_root_target: go.mod
4141
disable_upstream: true # TODO(Sam): re-enable the upstream for golang (needs test coverage)
4242
suggest_if: files_present
4343
direct_configs:

linters/golangci-lint/test_data/golangci_lint_v1.46.2_empty.check.shot

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,14 @@ exports[`Testing linter golangci-lint test empty 1`] = `
66
{
77
"code": "typecheck",
88
"column": "1",
9-
"file": "empty.go",
9+
"file": "test_data/empty.go",
1010
"issueUrl": "https://golangci-lint.run/usage/linters/",
1111
"level": "LEVEL_HIGH",
1212
"line": "1",
1313
"linter": "golangci-lint",
1414
"message": "expected 'package', found 'EOF'",
1515
"targetType": "go",
1616
},
17-
{
18-
"code": "deadcode",
19-
"column": "6",
20-
"file": "test_data/unused_func.go",
21-
"issueUrl": "https://golangci-lint.run/usage/linters/",
22-
"level": "LEVEL_HIGH",
23-
"line": "5",
24-
"linter": "golangci-lint",
25-
"message": "\`helper\` is unused",
26-
"targetType": "go",
27-
},
2817
{
2918
"code": "typecheck",
3019
"column": "23",
@@ -38,15 +27,6 @@ exports[`Testing linter golangci-lint test empty 1`] = `
3827
},
3928
],
4029
"lintActions": [
41-
{
42-
"command": "lint",
43-
"fileGroupName": "go",
44-
"linter": "golangci-lint",
45-
"paths": [
46-
".",
47-
],
48-
"verb": "TRUNK_VERB_CHECK",
49-
},
5030
{
5131
"command": "lint",
5232
"fileGroupName": "go",

linters/golangci-lint/test_data/golangci_lint_v1.49.0_empty.check.shot

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,14 @@ exports[`Testing linter golangci-lint test empty 1`] = `
66
{
77
"code": "typecheck",
88
"column": "1",
9-
"file": "empty.go",
9+
"file": "test_data/empty.go",
1010
"issueUrl": "https://golangci-lint.run/usage/linters/",
1111
"level": "LEVEL_HIGH",
1212
"line": "1",
1313
"linter": "golangci-lint",
1414
"message": "expected 'package', found 'EOF'",
1515
"targetType": "go",
1616
},
17-
{
18-
"code": "unused",
19-
"column": "6",
20-
"file": "test_data/unused_func.go",
21-
"issueUrl": "https://golangci-lint.run/usage/linters/",
22-
"level": "LEVEL_HIGH",
23-
"line": "5",
24-
"linter": "golangci-lint",
25-
"message": "func \`helper\` is unused",
26-
"targetType": "go",
27-
},
2817
{
2918
"code": "typecheck",
3019
"column": "23",
@@ -38,15 +27,6 @@ exports[`Testing linter golangci-lint test empty 1`] = `
3827
},
3928
],
4029
"lintActions": [
41-
{
42-
"command": "lint",
43-
"fileGroupName": "go",
44-
"linter": "golangci-lint",
45-
"paths": [
46-
".",
47-
],
48-
"verb": "TRUNK_VERB_CHECK",
49-
},
5030
{
5131
"command": "lint",
5232
"fileGroupName": "go",

tools/renovate/renovate.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import { makeToolTestConfig, toolTest } from "tests";
2+
import { osTimeoutMultiplier } from "tests/utils";
3+
4+
jest.setTimeout(600000 * osTimeoutMultiplier); // 300s or 900s
5+
26
toolTest({
37
toolName: "renovate",
48
toolVersion: "34.122.0",

0 commit comments

Comments
 (0)