-
Notifications
You must be signed in to change notification settings - Fork 913
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect .ipynb and .pyi sources when linting from stdin (#6628)
## Summary When running Ruff from stdin, we were always falling back to the default source type, even if the user specified a path (as is the case when running from the LSP). This PR wires up the source type inference, which means we now get the expected result when checking `.pyi` and `.ipynb` files. Closes #6627. ## Test Plan Verified that `cat crates/ruff/resources/test/fixtures/jupyter/valid.ipynb | cargo run -p ruff_cli -- --force-exclude --no-cache --no-fix --isolated --select ALL --stdin-filename foo.ipynb -` yielded the expected results (and differs from the errors you get if you omit the filename). Verified that `cat foo.pyi | cargo run -p ruff_cli -- --force-exclude --no-cache --no-fix --format json --isolated --select TCH --stdin-filename path/to/foo.pyi -` yielded no errors.
- Loading branch information
1 parent
6253d8e
commit 98b9f2e
Showing
4 changed files
with
155 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters