Skip to content

Conversation

coliff
Copy link
Member

@coliff coliff commented Jun 17, 2025

The SARIF formatter is now successfully including Markdown help content for the rules.

The SARIF formatter wasn't properly outputting Markdown help for HTMLHint rules. The issues were:

  • Path Resolution Problem: The code wasn't able to find the rule documentation MDX files because it was only looking in one specific location relative to the current working directory.
  • Error Handling: The code silently failed when it couldn't find or process the documentation files, which made it difficult to debug.
  • Markdown Processing: The code wasn't properly handling certain Markdown elements, particularly code blocks, which might have led to invalid output.

Solutions Implemented:

  • Multiple Path Resolution: We now try multiple possible paths where the rule documentation might be located, which makes the code more robust across different execution environments.
  • Improved Error Handling: Added logging for various error conditions to make it easier to identify problems. The code now logs when it can't find a rule's documentation and when there are errors processing the Markdown.
  • Better Markdown Processing: Enhanced the Markdown processing to better handle code blocks and ensure they're correctly formatted in the SARIF output.
  • Debugging Output: Added console logging to help troubleshoot where the code is looking for documentation files.

@coliff coliff requested a review from thedaviddias as a code owner June 17, 2025 08:29
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jun 17, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request improves the SARIF formatter by adding multiple path resolution, improved error handling, and better Markdown processing. It also adds console logging for debugging and outputs the SARIF content to stdout for CLI usage. The changes include updating the package version, modifying the SARIF formatter, and updating the changelog and index files.

Copy link

codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (95e6a13) to head (1d49369).
Report is 86 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #1665      +/-   ##
===========================================
+ Coverage   96.99%   100.00%   +3.00%     
===========================================
  Files           2         1       -1     
  Lines        1628         1    -1627     
  Branches      335         0     -335     
===========================================
- Hits         1579         1    -1578     
+ Misses         49         0      -49     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f3a048...1d49369. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coliff coliff merged commit 0812502 into main Jun 17, 2025
19 checks passed
@coliff coliff deleted the dev/coliff/improve-sarif-formatter branch June 17, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant