mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
ruff server
correctly treats .pyi
files as stub files (#11535)
## Summary
Fixes #11534.
`DocumentQuery::source_type` now returns `PySourceType::Stub` when the
document is a `.pyi` file.
## Test Plan
I confirmed that stub-specific rule violations appeared with a build
from this PR (they were not visible from a `main` build).
<img width="1066" alt="Screenshot 2024-05-24 at 2 15 38 PM"
src="cd519b7e
-21e4-41c8-bc30-43eb6d4d438e">
This commit is contained in:
parent
ab6d9d4658
commit
9567fddf69
1 changed files with 1 additions and 1 deletions
|
@ -465,7 +465,7 @@ impl DocumentQuery {
|
|||
/// Get the source type of the document associated with this query.
|
||||
pub(crate) fn source_type(&self) -> ruff_python_ast::PySourceType {
|
||||
match self {
|
||||
Self::Text { .. } => ruff_python_ast::PySourceType::Python,
|
||||
Self::Text { .. } => ruff_python_ast::PySourceType::from(self.file_path()),
|
||||
Self::Notebook { .. } => ruff_python_ast::PySourceType::Ipynb,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue