mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
![]() ## Summary
This PR adds a higher-level enum (`SourceType`) around `PySourceType` to
allow us to use the same detection path to handle TOML files. Right now,
we have ad hoc `is_pyproject_toml` checks littered around, and some
codepaths are omitting that logic altogether (like `add_noqa`). Instead,
we should always be required to check the source type and handle TOML
files as appropriate.
This PR will also help with our pre-commit capabilities. If we add
`toml` to pre-commit (to support `pyproject.toml`), pre-commit will
start to pass _other_ files to Ruff (along with `poetry.lock` and
`Pipfile` -- see
[identify](
|
||
---|---|---|
.. | ||
visitor | ||
all.rs | ||
call_path.rs | ||
comparable.rs | ||
docstrings.rs | ||
expression.rs | ||
hashable.rs | ||
helpers.rs | ||
identifier.rs | ||
imports.rs | ||
lib.rs | ||
node.rs | ||
nodes.rs | ||
parenthesize.rs | ||
relocate.rs | ||
statement_visitor.rs | ||
stmt_if.rs | ||
str.rs | ||
traversal.rs | ||
types.rs | ||
visitor.rs | ||
whitespace.rs |