Skip to content

Add SARIFFormatter#689

Open
nobodywasishere wants to merge 20 commits into
crystal-ameba:masterfrom
nobodywasishere:nobody/sarif-format
Open

Add SARIFFormatter#689
nobodywasishere wants to merge 20 commits into
crystal-ameba:masterfrom
nobodywasishere:nobody/sarif-format

Conversation

@nobodywasishere
Copy link
Copy Markdown
Contributor

@nobodywasishere nobodywasishere commented Nov 12, 2025

Closes #236

Next steps:

  • What's missing from the current minimum format?
  • Is there some real-world tool we can use to test it's output with?
  • Should we support multiple SARIF versions, or only the latest?
    • Could have --format=sarif default to latest, while supporting --format=sarif-2.1.0 / --format=sarif-2.0.0
  • Add specs

@nobodywasishere nobodywasishere changed the title Add a SARIF output formatter Add SARIFFormatter Nov 12, 2025
@nobodywasishere
Copy link
Copy Markdown
Contributor Author

Huh okay, so one major benefit of this would be being able to store ameba results alongside a commit as part of the history (including just to show that everything passed)

https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning

@github-advanced-security
Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Comment thread src/ameba.cr Fixed
Comment thread src/contrib/read_type_doc.cr Fixed
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
@Sija
Copy link
Copy Markdown
Member

Sija commented Nov 21, 2025

I think it might be useful, depending on the workflow, I guess.

Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr
Comment thread Makefile Outdated
Comment thread .gitignore Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr
Comment thread .github/workflows/sarif.yml Outdated
@@ -0,0 +1,297 @@
require "uri"

Check warning

Code scanning / ameba

Reports not formatted sources

Use built-in formatter to format this source
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
private module AsSARIF
struct Result
include JSON::Serializable

Check notice

Code scanning / ameba

Disallows trailing whitespace

Trailing whitespace detected
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/config.cr Outdated
@nobodywasishere nobodywasishere marked this pull request as ready for review January 22, 2026 21:25
@nobodywasishere nobodywasishere requested a review from Sija January 23, 2026 04:38
Comment thread spec/ameba/formatter/sarif_formatter_spec.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
@Sija Sija self-requested a review January 24, 2026 12:12
@nobodywasishere nobodywasishere requested review from Sija and removed request for Sija March 24, 2026 16:54
@Sija Sija added the AI AI-assisted/generated label Mar 31, 2026
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
Comment thread src/ameba/formatter/sarif_formatter.cr Outdated
nobodywasishere and others added 16 commits May 19, 2026 02:07
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
@nobodywasishere nobodywasishere requested a review from Sija May 22, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI-assisted/generated feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support SARIF output

3 participants