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

feat: Add Ruff support for sarif format #3486

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l

- New linters

- Reporters
- Add ruff sarif support

- Fixes
- Fix clang-format documentation links to point to the correct version. Fixes [#3452](https://github.com/oxsecurity/megalinter/issues/3452)
- Fix conflict between prettier and yamllint about spaces
Expand Down
6 changes: 6 additions & 0 deletions megalinter/descriptors/python.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ linters:
# ruff
- linter_name: ruff
name: PYTHON_RUFF
can_output_sarif: true
linter_text: |
An extremely fast Python linter, written in Rust.
linter_url: https://github.com/astral-sh/ruff
Expand All @@ -360,6 +361,11 @@ linters:
cli_lint_errors_count: regex_number
cli_lint_errors_regex: "Found ([0-9]+) error"
config_file_name: ".ruff.toml"
cli_sarif_args:
- --output-format
- sarif
- --output-file
- "{{SARIF_OUTPUT_FILE}}"
test_folder: python_ruff
examples:
- "ruff check myfile.py"
Expand Down