Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update definition for trunk-toolbox to include latest support for neveredit rule #859

Merged
merged 13 commits into from
Sep 3, 2024
1 change: 1 addition & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ lint:
# enabled linters inherited from github.com/trunk-io/configs plugin
- definition-checker
- eslint@9.9.0
- trunk-toolbox@0.4.1
disabled:
- pylint # pylint diagnostics are too strict
- semgrep
Expand Down
17 changes: 13 additions & 4 deletions linters/trunk-toolbox/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 0.1

downloads:
- name: trunk-toolbox
version: 0.3.1
version: 0.4.1
downloads:
- os:
linux: unknown-linux-gnu
Expand All @@ -17,21 +17,30 @@ tools:
- name: trunk-toolbox
download: trunk-toolbox
shims: [trunk-toolbox]
known_good_version: 0.3.1
known_good_version: 0.4.1
lint:
definitions:
- name: trunk-toolbox
description: Repository level linting tools
main_tool: trunk-toolbox
files: [ALL]
description: Collection of universal linting tools
commands:
- name: lint
run: trunk-toolbox --upstream=${upstream-ref} --results=${tmpfile} ${target}
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
- name: lint
run: trunk-toolbox --upstream=${upstream-ref} --results=${tmpfile} ${target}
output: sarif
batch: true
success_codes: [0]
disable_upstream: true
read_output_from: tmp_file
suggest_if: never
version_command:
parse_regex: ${semver}
Expand Down
Original file line number Diff line number Diff line change
@@ -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_NEW",
"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_NEW",
"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_NEW",
"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": [],
}
`;
Loading