realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.46k stars 2.2k forks source link

Add SARIF JSON Reporter #5516

Closed waitbutY closed 2 months ago

waitbutY commented 3 months ago

Some tools (i.e. DataDog) require SARIF JSON format for code quality report ingestion.

This change adds a SARIF reporter to enable integration with these tools.

SARIF format documentation:

SwiftLintBot commented 3 months ago
17 Messages
:book: Linting Aerial with this PR took 1.23s vs 1.23s on main (0% slower)
:book: Linting Alamofire with this PR took 1.78s vs 1.79s on main (0% faster)
:book: Linting Brave with this PR took 10.41s vs 10.37s on main (0% slower)
:book: Linting DuckDuckGo with this PR took 5.64s vs 5.68s on main (0% faster)
:book: Linting Firefox with this PR took 13.06s vs 13.05s on main (0% slower)
:book: Linting Kickstarter with this PR took 12.6s vs 12.6s on main (0% slower)
:book: Linting Moya with this PR took 0.68s vs 0.68s on main (0% slower)
:book: Linting NetNewsWire with this PR took 3.86s vs 3.88s on main (0% faster)
:book: Linting Nimble with this PR took 1.01s vs 1.02s on main (0% faster)
:book: Linting PocketCasts with this PR took 10.19s vs 10.25s on main (0% faster)
:book: Linting Quick with this PR took 0.45s vs 0.45s on main (0% slower)
:book: Linting Realm with this PR took 6.34s vs 6.33s on main (0% slower)
:book: Linting Sourcery with this PR took 3.12s vs 3.15s on main (0% faster)
:book: Linting Swift with this PR took 6.3s vs 6.33s on main (0% faster)
:book: Linting VLC with this PR took 1.67s vs 1.67s on main (0% slower)
:book: Linting Wire with this PR took 23.58s vs 23.58s on main (0% slower)
:book: Linting WordPress with this PR took 15.36s vs 15.32s on main (0% slower)

Generated by :no_entry_sign: Danger

waitbutY commented 3 months ago

Im seeing testing failures for RedundantSelfInClosureRuleExamples and UnusedImportRuleExamples, but not sure how the SARIF changes could have effected those tests, investigating

waitbutY commented 3 months ago

Im seeing testing failures for RedundantSelfInClosureRuleExamples and UnusedImportRuleExamples, but not sure how the SARIF changes could have effected those tests, investigating

Resolved, didnt realize i needed to run make sourcery

waitbutY commented 2 months ago

@SimplyDanny i think all comments are addressed, I tested the resulting json against the SARIF validator and all looks well, let me know what you think!