ruff/crates/ruff_linter/src/rules
Brent Westbrook 19569bf838
Add `LinterContext::settings` to avoid passing separate settings (#19608)
Summary
--

I noticed while reviewing #19390 that in `check_tokens` we were still
passing
around an extra `LinterSettings`, despite all of the same functions also
receiving a `LintContext` with its own settings.

This PR adds the `LintContext::settings` method and calls that instead
of using
the separate `LinterSettings`.

Test Plan
--

Existing tests
2025-07-29 08:13:22 -04:00
..
airflow [`Airflow`] Make `AIR302` example error out-of-the-box (#18988) 2025-06-30 09:45:15 -04:00
eradicate Add `LinterContext::settings` to avoid passing separate settings (#19608) 2025-07-29 08:13:22 -04:00
fastapi [`FastAPI`] Add fix safety section to `FAST002` (#18940) 2025-06-26 12:38:02 -05:00
flake8_2020 [Internal] Use more `report_diagnostic_if_enabled` (#18924) 2025-06-24 21:43:22 -04:00
flake8_annotations [`flake8-annotations`] Make `ANN401` example error out-of-the-box (#18974) 2025-06-27 07:06:11 +00:00
flake8_async [`flake8-async`] Make `ASYNC220`, `ASYNC221`, and `ASYNC222` examples error out-of-the-box (#18978) 2025-06-30 09:47:29 -04:00
flake8_bandit [`flake8-bandit`] Make example error out-of-the-box (`S412`) (#19241) 2025-07-09 14:25:27 -04:00
flake8_blind_except [`flake8-blind-except`] Change `BLE001` to permit `logging.critical(..., exc_info=True)`. (#19520) 2025-07-25 17:52:58 -04:00
flake8_boolean_trap Add missing rule code comments (#18906) 2025-06-24 21:18:57 -04:00
flake8_bugbear Add t-string fixtures for rules that do not need to be modified (#19146) 2025-07-14 09:46:31 -05:00
flake8_builtins Remove redundant `settings` field from `Checker` (#18845) 2025-06-23 11:06:44 +02:00
flake8_commas Add `LinterContext::settings` to avoid passing separate settings (#19608) 2025-07-29 08:13:22 -04:00
flake8_comprehensions [`flake8-comprehensions`] Fix `C420` to prepend whitespace when needed (#18616) 2025-06-30 12:38:26 -04:00
flake8_copyright Unify `OldDiagnostic` and `Message` (#18391) 2025-06-19 09:37:58 -04:00
flake8_datetimez [`flake8-datetimez`] Make `DTZ901` example error out-of-the-box (#19056) 2025-07-01 09:57:34 -04:00
flake8_debugger Add missing rule code comments (#18906) 2025-06-24 21:18:57 -04:00
flake8_django [`flake8_django`] Fix DJ008 false positive for abstract models with type-annotated `abstract` field (#19221) 2025-07-11 16:50:59 +00:00
flake8_errmsg [`flake8-errmsg`] Extend `EM101` to support byte strings (#18867) 2025-06-25 10:53:56 -04:00
flake8_executable [`flake8-executable`] Allow `uvx` in shebang line (`EXE003`) (#18967) 2025-06-30 09:38:18 -04:00
flake8_fixme Unify `OldDiagnostic` and `Message` (#18391) 2025-06-19 09:37:58 -04:00
flake8_future_annotations [`flake8-type-checking`, `pyupgrade`, `ruff`] Add `from __future__ import annotations` when it would allow new fixes (`TC001`, `TC002`, `TC003`, `UP037`, `RUF013`) (#19100) 2025-07-16 08:50:52 -04:00
flake8_gettext Add t-string fixtures for rules that do not need to be modified (#19146) 2025-07-14 09:46:31 -05:00
flake8_implicit_str_concat Add `LinterContext::settings` to avoid passing separate settings (#19608) 2025-07-29 08:13:22 -04:00
flake8_import_conventions Unify `OldDiagnostic` and `Message` (#18391) 2025-06-19 09:37:58 -04:00
flake8_logging Add missing rule code comments (#18906) 2025-06-24 21:18:57 -04:00
flake8_logging_format Add t-string fixtures for rules that do not need to be modified (#19146) 2025-07-14 09:46:31 -05:00
flake8_no_pep420 Unify `OldDiagnostic` and `Message` (#18391) 2025-06-19 09:37:58 -04:00
flake8_pie Fix F701 to F707 errors in tests (#19125) 2025-07-04 13:43:18 -05:00
flake8_print Unify `OldDiagnostic` and `Message` (#18391) 2025-06-19 09:37:58 -04:00
flake8_pyi [`flake8-pyi`] Skip fix if all `Union` members are `None` (`PYI016`) (#19416) 2025-07-22 17:03:14 +00:00
flake8_pytest_style Add t-string fixtures for rules that do not need to be modified (#19146) 2025-07-14 09:46:31 -05:00
flake8_quotes [`flake8-quotes`] Make example error out-of-the-box (`Q003`) (#19106) 2025-07-03 10:25:46 -04:00
flake8_raise [`flake8-raise`] Make fix unsafe if it deletes comments (`RSE102`) (#18788) 2025-06-21 19:09:40 +02:00
flake8_return [`flake8-return`] Fix false-positive for variables used inside nested functions in `RET504` (#18433) 2025-07-10 16:10:22 -04:00
flake8_self Remove redundant `settings` field from `Checker` (#18845) 2025-06-23 11:06:44 +02:00
flake8_simplify [`flake8-simplify`] Make example error out-of-the-box (`SIM116`) (#19111) 2025-07-07 17:17:55 -04:00
flake8_slots Unify helpers modules (#18835) 2025-06-20 16:03:01 -05:00
flake8_tidy_imports Remove redundant `settings` field from `Checker` (#18845) 2025-06-23 11:06:44 +02:00
flake8_todos Unify `OldDiagnostic` and `Message` (#18391) 2025-06-19 09:37:58 -04:00
flake8_type_checking [`flake8-type-checking`, `pyupgrade`, `ruff`] Add `from __future__ import annotations` when it would allow new fixes (`TC001`, `TC002`, `TC003`, `UP037`, `RUF013`) (#19100) 2025-07-16 08:50:52 -04:00
flake8_unused_arguments Add t-string fixtures for rules that do not need to be modified (#19146) 2025-07-14 09:46:31 -05:00
flake8_use_pathlib [`flake8-use-pathlib`] Add autofix for `PTH101`, `PTH104`, `PTH105`, `PTH121` (#19404) 2025-07-23 12:13:43 -04:00
flynt Normalize some docs sections (#18831) 2025-06-20 21:56:11 +01:00
isort Treat form feed as valid whitespace before a semicolon (#19343) 2025-07-16 16:39:05 -04:00
mccabe Add missing rule code comments (#18906) 2025-06-24 21:18:57 -04:00
numpy Unify `OldDiagnostic` and `Message` (#18391) 2025-06-19 09:37:58 -04:00
pandas_vet [pandas]: Fix issue on `non pandas` dataframe `in-place` usage (PD002) (#18963) 2025-06-27 06:56:13 +00:00
pep8_naming [`pep8-naming`] Fix `N802` false positives for `CGIHTTPRequestHandler` and `SimpleHTTPRequestHandler` (#19432) 2025-07-23 12:04:11 -04:00
perflint [`perflint`] Ignore rule if target is `global` or `nonlocal` (`PERF401`) (#19539) 2025-07-28 17:03:22 -04:00
pycodestyle Add `LinterContext::settings` to avoid passing separate settings (#19608) 2025-07-29 08:13:22 -04:00
pydoclint [`pydoclint`] Make example error out-of-the-box (`DOC501`) (#19218) 2025-07-09 12:59:31 -04:00
pydocstyle [`pydoclint`] Fix `SyntaxError` from fixes with line continuations (`D201`, `D202`) (#19246) 2025-07-14 13:31:36 -04:00
pyflakes Rename `Diagnostic::syntax_error` methods, separate `Ord` implementation (#19179) 2025-07-08 09:54:19 -04:00
pygrep_hooks [`pygrep_hooks`] Add `AsyncMock` methods to `invalid-mock-access` (`PGH005`) (#18547) 2025-06-24 17:27:21 -04:00
pylint [`pylint`] Implement auto-fix for `missing-maxsplit-arg` (`PLC0207`) (#19387) 2025-07-28 10:45:26 -04:00
pyupgrade [`flake8-type-checking`, `pyupgrade`, `ruff`] Add `from __future__ import annotations` when it would allow new fixes (`TC001`, `TC002`, `TC003`, `UP037`, `RUF013`) (#19100) 2025-07-16 08:50:52 -04:00
refurb [`refurb`] Mark `int` and `bool` cases for `Decimal.from_float` as safe fixes in `FURB164` tests (#19468) 2025-07-28 14:21:38 +00:00
ruff Add `LinterContext::settings` to avoid passing separate settings (#19608) 2025-07-29 08:13:22 -04:00
tryceratops Remove redundant `settings` field from `Checker` (#18845) 2025-06-23 11:06:44 +02:00
mod.rs Re-enable clippy `useless-format` (#14095) 2024-11-04 18:25:25 +01:00