mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
![]() This is a surgical change that adds new `report()` and `lint()` APIs to `InferContext`. These are intended to replace the existing `report_*` APIs. The comments should explain what these reporters are meant to do. For the most part, this is "just" shuffling some code around. The actual logic for determining whether a lint *should* be reported or not remains unchanged and we don't make any changes to how a `Diagnostic` is actually constructed (yet). I initially tried to just use `LintReporter` and `DiagnosticReporter` without the builder types, since I perceive the builder types to be an annoying additional layer. But I found it also exceedingly annoying to have to construct and provide the diagnostic message before you even know if you are going to build the diagnostic. I also felt like this could result in potentially unnecessary and costly querying in some cases, although this is somewhat hand wavy. So I overall felt like the builder route was the way to go. If the builders end up being super annoying, we can probably add convenience APIs for common patterns to paper over them. |
||
---|---|---|
.. | ||
resources | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
mdtest.py | ||
mdtest.py.lock |