oxc/apps
Alexander S. 4ae568e8c9
feat(linter): add DiagnosticResult to the Reporters for receiving a sub part result (#8666)
We are currently outputting only for the default-outputter some extra
information:


3be03926e8/apps/oxlint/src/result.rs (L61-L87)

My goal is that all information will be passed to our new
DiagnosticReporter / OutputFormatter.
This will break the output format in the next PR. **Merging this PR is
the OK for me to make this change** ⚠️
The only breaking point:
`"Found {number_of_warnings} warning{} and {number_of_errors} error{}."`
will still be outputted when `max_warnings_exceeded` is true.

Because this is something the `DiagnosticReporter` should do and not the
`OutputFormatter`.

The end goal is:
- no `println!`, our `OutputFormatter` and his `DiagnosticReporter` will
return `Option<String>` and we output it the our `stdout`
- `LintResult` will only handle `ExitCode` result and nothing more
- `stdout` can be changed from outside (for the next part)
- add snapshots with a custom `stdout`

I do not know if all goals can be done easily. Last two parts should be
a bit tricky for me, never did test setups in rust.
But we do never stop to learn ;)
2025-01-23 10:09:51 +08:00
..
oxlint feat(linter): add DiagnosticResult to the Reporters for receiving a sub part result (#8666) 2025-01-23 10:09:51 +08:00