From b4922de4054aa4e5c3a4044d6a084da8eaa1a7d8 Mon Sep 17 00:00:00 2001 From: Eli Schleifer <1265982+EliSchleifer@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:56:08 -0800 Subject: [PATCH] Toolbox defintion and version number updates (#912) 1. Toolbox supports caching so better to take advantage of that 2. Revs to latest release version of toolbox --- linters/trunk-toolbox/plugin.yaml | 19 ++++- ...runk_toolbox_v0.5.3_do_not_land.check.shot | 85 +++++++++++++++++++ 2 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 linters/trunk-toolbox/test_data/trunk_toolbox_v0.5.3_do_not_land.check.shot diff --git a/linters/trunk-toolbox/plugin.yaml b/linters/trunk-toolbox/plugin.yaml index a2ff5097b..219e4a5c1 100644 --- a/linters/trunk-toolbox/plugin.yaml +++ b/linters/trunk-toolbox/plugin.yaml @@ -2,7 +2,7 @@ version: 0.1 downloads: - name: trunk-toolbox - version: 0.5.0 + version: 0.5.3 downloads: - os: linux: unknown-linux-gnu @@ -17,7 +17,7 @@ tools: - name: trunk-toolbox download: trunk-toolbox shims: [trunk-toolbox] - known_good_version: 0.5.0 + known_good_version: 0.5.3 lint: definitions: - name: trunk-toolbox @@ -27,15 +27,28 @@ lint: affects_cache: [toolbox.toml, log4rs.yaml] commands: - name: lint - version: ">=0.4.1" + version: ">=0.5.3" run: trunk-toolbox --upstream=${upstream-ref} --cache-dir=${cachedir} --results=${tmpfile} ${target} output: sarif batch: true success_codes: [0] + read_output_from: tmp_file + cache_results: true disable_upstream: false + direct_configs: [toolbox.toml] + max_concurrency: 1 + - name: lint + version: ">=0.4.1" + run: + trunk-toolbox --upstream=${upstream-ref} --cache-dir=${cachedir} --results=${tmpfile} + ${target} + output: sarif + batch: true + success_codes: [0] read_output_from: tmp_file + disable_upstream: true direct_configs: [toolbox.toml] max_concurrency: 1 - name: lint diff --git a/linters/trunk-toolbox/test_data/trunk_toolbox_v0.5.3_do_not_land.check.shot b/linters/trunk-toolbox/test_data/trunk_toolbox_v0.5.3_do_not_land.check.shot new file mode 100644 index 000000000..293b5fc21 --- /dev/null +++ b/linters/trunk-toolbox/test_data/trunk_toolbox_v0.5.3_do_not_land.check.shot @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Testing linter trunk-toolbox test do_not_land 1`] = ` +{ + "issues": [ + { + "code": "do-not-land", + "column": "3", + "file": "test_data/do_not_land.in.txt", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "trunk-toolbox", + "message": "Found 'DONOTLAND'", + "ranges": [ + { + "filePath": "test_data/do_not_land.in.txt", + "length": "9", + "offset": "2", + }, + ], + "targetType": "ALL", + }, + { + "code": "do-not-land", + "column": "3", + "file": "test_data/do_not_land.in.txt", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "2", + "linter": "trunk-toolbox", + "message": "Found 'do-not-land'", + "ranges": [ + { + "filePath": "test_data/do_not_land.in.txt", + "length": "11", + "offset": "14", + }, + ], + "targetType": "ALL", + }, + { + "code": "do-not-land", + "column": "3", + "file": "test_data/do_not_land.in.txt", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "3", + "linter": "trunk-toolbox", + "message": "Found 'do_not_land'", + "ranges": [ + { + "filePath": "test_data/do_not_land.in.txt", + "length": "11", + "offset": "28", + }, + ], + "targetType": "ALL", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trunk-toolbox", + "paths": [ + "test_data/do_not_land.in.txt", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trunk-toolbox", + "paths": [ + "test_data/do_not_land.in.txt", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`;