Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📎 Add testsuites for formatting issues in JUnit reporter #5172

Open
juwCoding opened this issue Feb 21, 2025 · 0 comments
Open

📎 Add testsuites for formatting issues in JUnit reporter #5172

juwCoding opened this issue Feb 21, 2025 · 0 comments
Labels
S-Enhancement Status: Improve an existing feature

Comments

@juwCoding
Copy link

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.
Image

@dyc3 dyc3 added the S-Enhancement Status: Improve an existing feature label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Enhancement Status: Improve an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants