-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
📎 Implement biome lint --summary
#57
Comments
How would someone understand which diagnostics are errors and which ones are warnings? |
The severity is set at the rule level? It could infer which one is an error using the rule name? We could also use a distinct color in the summary? For instance coloring the number f diagnostics in red for errors and orange for warnings. |
The severity of the rules is set at configuration level. I was trying to figure out if we can come up with a different output, because the proposed one doesn't distinguish between errors and warnings. So, we should first be on the same page. Diagnostic is a generic term, while error/warning is a specific term. Colours is a good suggestion, but it won't work in terminals that don't support colors, and in cases where users might need to scrap the output of the CLI. |
@Conaclos question: Should |
I don't see any issue to keep it. I added it in the example. |
By the way, I wonder if we should propose a common feature for both the summary and the structured output proposals. Instead of providing a For example: $ biome lint --format=summary src
nursery/useNamingConvention 2509
style/useSingleCaseStatement 2000
... |
What do you think about In the future, I can see something like this: biome check --report=summary,json And Biome will emit:
And even biome check --report=summary,json,junit --report-to-file And Biome will:
|
I think it is a better name. Have you some use case for allowing several reporters at the same time? I am not fond of the mix of behavior (reporting on stderr / stdout / file). I think we should choose between For a first version, I think we can skip emitting a file. We could later add an option such as |
We can remove the file for now, it was just a future idea and not related to this issue. Although, reporting on both stream is actually a thing. |
You are right. |
Saving the report would be a very cool feature! We could organize annotations in our repository, like we do now with the eslint report and this action https://github.com/ataylorme/eslint-annotate-action - it's very convenient |
Is there a plan to eventually have HTML reporter? (like https://eslint.org/docs/latest/use/formatters/#html) or supporting things like https://www.npmjs.com/package/eslint-formatter-gitlab (to be used on GitLab) |
@hverlin Please use this github discussion instead, or create a new one. We usually use issues for technical discussions around the task at hand. |
What do you think of this UI @Conaclos ?
|
The word "Diagnostics" is dimmed, a bug in my code. I plan to rendering as "Rule Name" |
Pretty nice :) Actually I was thinking of a general summary. However, I can see the interest for a file-based summary. Maybe we could add a general summary at the end? Also:
|
Can you be more specific?
Yes? There are errors. The rules that were triggered are recommended, and the documents aren't formatted. The screenshot shows that I run
Yes, because it was requested in some other discussion. Also, this should work for other commands that aren't necessary just linting. |
I am the author of When eslint reports many errors, there are usually errors in many files. Therefore, if we summarize the errors by file, the output could be huge. It is not a good idea to summarize errors by file. Also, users often want to turn off rules that produce many errors. I think it would be nice to be able to display a summary for each rule to assist with this. eslint-interactive also outputs the number of fixable problems. It would help users to identify rules that can be easily fixed with |
▶ ./packages/@biomejs/js-api/main.ts
The file isn't formatted.
Triggered lint rule Diagnostics
lint/suspicious/noImplicitAnyLet 3
▶ ./packages/@biomejs/js-api/main2.ts
The file isn't formatted.
Triggered lint rule Diagnostics
lint/suspicious/noImplicitAnyLet 2
lint/suspicious/noDoubleEquals 3
▶ General summary
Some files arn't formatted.
Triggered lint rule Diagnostics
lint/suspicious/noImplicitAnyLet 5
lint/suspicious/noDoubleEquals 3
Yes this was my first intention for the summary reporter: displaying how much a rule is triggered to assist the dev in enabling/disabling rules. However, Biome is not currently able to output a summary for every file, this is what ESlint is doing by default. Maybe we should provide two reporters? |
I think something is missing here. The idea is to have I think there's too much focus on the "lint rule", but the focus should be on diagnostics. |
OK, I believe I landed something nice to see and informative, and that makes sense. Formatter and Organize imports report the files that require changes, while linting groups everything by diagnostic category. We also break down errors, warnings, and information (this is for the near future). The reason why we break down errors/warnings/infos is because a rule can be downgraded in different files using overrides, so we need to take that into account. |
Description
See rome#4747 for some context.
biome lint --summary
should print a summary which allows figuring out which rule raised diagnostics and how many.The summary should avoid unnecessary works (no need to call
diagnostic
andaction
on the rules).We could suggest using
--summary
when the number of diagnostics exceedsmax-diagnostics
:The text was updated successfully, but these errors were encountered: