Skip to content

Commit

Permalink
Use python3 stems rather than python (#327)
Browse files Browse the repository at this point in the history
`python3` will resolve correctly on Linux and MacOS.

Also turns off `Latest` trufflehog tests on PRs temporarily. Created
[ticket](https://linear.app/trunk/issue/TRUNK-7679/make-known-bad-versions-work-for-downloads)
  • Loading branch information
TylerJang27 committed Jun 22, 2023
1 parent f633348 commit dba7e36
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ jobs:
with:
linter-version: Latest
sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }}
append-args: ${{needs.detect_changes.outputs.linters-files }}
# TODO(Tyler): We need downloads to work with known_bad_versions
append-args:
${{needs.detect_changes.outputs.linters-files }} -- --testPathIgnorePatterns=trufflehog

- name: Tool Tests
# Run tests using KnownGoodVersion with any modified tools and conditionally all tools. Don't run when cancelled.
Expand Down
2 changes: 1 addition & 1 deletion actions/hello-world/python/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ actions:
description: prints 'Hello World' to the terminal during pre-commit trigger
runtime: python
packages_file: requirements.txt
run: python ${cwd}/hello # {cwd} resolves to current directory containing this plugin.yaml file
run: python3 ${cwd}/hello # {cwd} resolves to current directory containing this plugin.yaml file
triggers:
- git_hooks: [pre-commit]
2 changes: 1 addition & 1 deletion linters/codespell/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ lint:
read_output_from: stdout
parser:
runtime: python
run: python ${plugin}/linters/codespell/codespell_to_sarif.py
run: python3 ${plugin}/linters/codespell/codespell_to_sarif.py
batch: true
cache_results: true
2 changes: 1 addition & 1 deletion linters/nancy/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ lint:
is_security: true
parser:
runtime: python
run: python ${plugin}/linters/nancy/parse.py
run: python3 ${plugin}/linters/nancy/parse.py
version_command:
parse_regex: nancy version ${semver}
run: nancy --version
Expand Down
2 changes: 1 addition & 1 deletion linters/osv-scanner/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ lint:
is_security: true
parser:
runtime: python
run: python ${plugin}/linters/osv-scanner/osv_to_sarif.py
run: python3 ${plugin}/linters/osv-scanner/osv_to_sarif.py
issue_url_format: https://osv.dev/{}
suggest_if: files_present
environment:
Expand Down
2 changes: 1 addition & 1 deletion linters/pyright/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lint:
cache_results: true
parser:
runtime: python
run: python ${plugin}/linters/pyright/pyright_to_sarif.py
run: python3 ${plugin}/linters/pyright/pyright_to_sarif.py
runtime: python
package: pyright
direct_configs:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion linters/remark-lint/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ lint:
read_output_from: stderr
parser:
runtime: python
run: python ${cwd}/parse.py
run: python3 ${cwd}/parse.py
symlinks:
# symlink the tool node_modules into the sandbox. this enables
# the hermetic tool to run correctly with plugins
Expand Down
2 changes: 1 addition & 1 deletion linters/renovate/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lint:
read_output_from: stdout
parser:
runtime: python
run: python ${cwd}/parse.py
run: python3 ${cwd}/parse.py
direct_configs:
- renovate.json
- renovate.json5
Expand Down
4 changes: 2 additions & 2 deletions linters/ruff/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ lint:
output: sarif
parser:
runtime: python
run: python ${cwd}/ruff_to_sarif.py 0
run: python3 ${cwd}/ruff_to_sarif.py 0
batch: true
success_codes: [0, 1]
- name: lint
run: ruff check --cache-dir ${cachedir} --format json ${target}
output: sarif
parser:
runtime: python
run: python ${cwd}/ruff_to_sarif.py 1
run: python3 ${cwd}/ruff_to_sarif.py 1
batch: true
success_codes: [0, 1]
runtime: python
Expand Down
2 changes: 1 addition & 1 deletion linters/sqlfluff/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ lint:
read_output_from: stdout
parser:
runtime: python
run: python ${plugin}/linters/sqlfluff/sqlfluff_to_sarif.py
run: python3 ${plugin}/linters/sqlfluff/sqlfluff_to_sarif.py
- name: fix
run: sqlfluff fix ${target} --disable-progress-bar --force
output: rewrite
Expand Down
4 changes: 2 additions & 2 deletions linters/terrascan/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lint:
success_codes: [0, 3, 4, 5]
parser: # necessary to convert file paths from a strange custom format to a standard format
runtime: python
run: python ${plugin}/linters/terrascan/sarif_to_sarif.py
run: python3 ${plugin}/linters/terrascan/sarif_to_sarif.py
- name: lint-docker
output: sarif
is_security: true
Expand All @@ -39,7 +39,7 @@ lint:
success_codes: [0, 3, 4, 5]
parser:
runtime: python
run: python ${plugin}/linters/terrascan/sarif_to_sarif.py
run: python3 ${plugin}/linters/terrascan/sarif_to_sarif.py
version_command:
parse_regex: "version: v${semver}"
run: terrascan version
Expand Down
4 changes: 2 additions & 2 deletions linters/trivy/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ lint:
is_security: true
parser:
runtime: python
run: python ${plugin}/linters/trivy/trivy_fs_to_sarif.py
run: python3 ${plugin}/linters/trivy/trivy_fs_to_sarif.py
- name: config
output: sarif
run: trivy config ${target} --format json --cache-dir ${shared_cachedir}
Expand All @@ -47,7 +47,7 @@ lint:
is_security: true
parser:
runtime: python
run: python ${plugin}/linters/trivy/trivy_config_to_sarif.py
run: python3 ${plugin}/linters/trivy/trivy_config_to_sarif.py
version_command:
parse_regex: Version ${semver}
run: trivy --version
Expand Down
3 changes: 2 additions & 1 deletion linters/trufflehog/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ lint:
files: [ALL]
download: trufflehog
known_good_version: 3.31.3
known_bad_versions: [3.41.0]
commands:
- name: lint
output: sarif
Expand All @@ -26,7 +27,7 @@ lint:
cache_results: true
parser:
runtime: python
run: python ${plugin}/linters/trufflehog/trufflehog_to_sarif.py
run: python3 ${plugin}/linters/trufflehog/trufflehog_to_sarif.py
suggest_if: files_present
environment:
- name: PATH
Expand Down
2 changes: 1 addition & 1 deletion runtimes/python/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ runtimes:
value: ${linter}
known_good_version: 3.10.8
version_commands:
- run: python --version
- run: python3 --version
parse_regex: Python ${semver}

0 comments on commit dba7e36

Please sign in to comment.