Skip to content

Commit 17617ed

Browse files
author
David Apirian
authored
Update bandit to read output from a tmp file (#329)
Occasionally bandit prints a mix of json and progress update text to stdout, which screws up our ability to parse the json, for example: ``` Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:01 { "errors": [], "generated_at": "2023-06-23T12:48:22Z", "metrics": { "_totals": { ... ``` Using `--output` gets around this problem
1 parent 6cb4c4d commit 17617ed

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

linters/bandit/plugin.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ lint:
1111
- name: lint
1212
# Custom parser type defined in the trunk cli to handle bandit's JSON output.
1313
output: bandit
14-
run: bandit --exit-zero --format json ${target}
14+
run: bandit --exit-zero --format json --output ${tmpfile} ${target}
1515
success_codes: [0]
16+
read_output_from: tmp_file
1617
batch: true
1718
cache_results: true
1819
is_security: true

0 commit comments

Comments
 (0)