ruff
8cff77c8 - Avoid generating diagnostics with per-file ignores (#18801)

Commit
174 days ago
Avoid generating diagnostics with per-file ignores (#18801) ## Summary This PR avoids one of the three calls to `NoqaCode::rule` from https://github.com/astral-sh/ruff/pull/18391 by applying per-file ignores in the `LintContext`. To help with this, it also replaces all direct uses of `LinterSettings.rules.enabled` with a `LintContext::enabled` (or `Checker::enabled`, which defers to its context) method. There are still some direct accesses to `settings.rules`, but as far as I can tell these are not in a part of the code where we can really access a `LintContext`. I believe all of the code reachable from `check_path`, where the replaced per-file ignore code was, should be converted to the new methods. ## Test Plan Existing tests, with a single snapshot updated for RUF100, which I think actually shows a more accurate diagnostic message now.
Author
Parents
Loading