Feature: Add SARIF Support for URL Checker#91
Feature: Add SARIF Support for URL Checker#91dwertent wants to merge 2 commits intourlstechie:masterfrom
Conversation
|
This looks pretty neat, I like the the idea too. @vsoch what do you think? |
|
My quick read is that SARIF is for static analysis tools relevant for security (e.g., code scanning) and I'm not sure a broken link detected falls under that scope. The RFC linked is for this page https://www.rfc-editor.org/rfc/rfc3986 which has nothing to do with an invalid URL, it's just that it is down. There are arguably many ways you could convert this data, and I'd argue if you wanted this specific format, it would be better to be an external script or step run after extraction. @dwertent it would be helpful to walk me through the use cases for adding this. Superficially I don't think I am convinced yet. |
|
Hi @vsoch, Thank you for your feedback. I understand your concerns regarding the use of SARIF for reporting broken links and the relevance of the RFC link I provided. Here are some points to clarify my intention and the use case for adding SARIF:
I hope this clarifies the motivation and potential benefits of integrating SARIF for broken link reporting. I'd be happy to provide further details or discuss any other concerns you might have. |
Motivation
This PR introduces SARIF support to the
urlchecker-pythontool. SARIF is a standardized format for static analysis results, which improves integration with various tools and workflows, enabling better reporting and issue tracking in CI/CD pipelines.How to Use
The new feature allows users to save URL-checking results in SARIF format by specifying the output format during the command execution:
$ urlchecker check --save results.sarif --format sarif .The default behavior remains unaffected, with CSV being the default output format. Users can still generate CSV reports without any changes to their current workflow.
Under the Hood
save_results_as_sarifto theUrlCheckerclass, generating SARIF logs.save_results_formatparameter to specify the desired output format (csvorsarif).Unit Tests
Included unit tests to verify the SARIF output functionality, ensuring the new format is correctly generated and validated.