📎 Add testsuites for formatting issues in JUnit reporter #5172
Labels
A-CLI
Area: CLI
S-Enhancement
Status: Improve an existing feature
S-Help-wanted
Status: you're familiar with the code base and want to help the project
Description
Description
Formatting and linting should be integrated into a CI/CD pipeline. A machine readable format is required for reporting errors over time and display them in a deployment server (e.g. in Jenkins). JUnit is a standard file format which could accomplish this. Sadly formatting issues are not properly written to the JUnit output and therefore can't be evaluated.
As is
Currently
biome check --reporter=junit --linter-enabled=false
will emit one testsuites and errors will show how many formatting issues were found. But testsuites is always empty.<?xml version="1.0" encoding="UTF-8"?> <testsuites name="Biome" tests="0" failures="0" errors="1" time="0.049"> </testsuites>
When looking at the github reporter, file, line and column information are shown for each error, so this information is available for reporters.
biome check --reporter=github --linter-enabled=false
::error title=format,file=/Path/To/File/.ts,line=1,endLine=1,col=2,endColumn=2::Formatter would have printed the following content:
To be
For each file with formatting issues, a testsuite should be inserted in testsuites. In each respective testsuite all formatting issues of the file should be added as testcase with line and column. Inside the testcase a failure will be created with a message attribute and content. Please refer to the JUnit format and the linter JUnit reporter can be used as reference (but ideally issues within the same file should be within the same testsuite).
An additional feature would be to show the actual diff inside the failure similar to the terminal output.

The text was updated successfully, but these errors were encountered: