-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[ruff] Add rule-codes-in-selectors (RUF201)
#26772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
164eb31
6a2d6a5
ac8b93c
86dbdfb
2dc6636
5352329
046b94a
0388bfc
c5dea35
efa9ab6
56cb707
4c9f3ca
0392bec
bd94dd9
26640e5
f1155ee
820c663
815ce38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -554,7 +554,10 @@ fn format_dir_entry( | |
| ) -> anyhow::Result<(Result<Statistics, CheckFileError>, PathBuf), Error> { | ||
| let resolved_file = resolved_file.context("Iterating the files in the repository failed")?; | ||
| // For some reason it does not filter in the beginning | ||
| if resolved_file.file_name() == "pyproject.toml" { | ||
| if ["pyproject.toml", "ruff.toml", ".ruff.toml"] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about ruff format? Codex reports
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, none of my Codex reviews ever caught this. Possibly because this reproduces on main with pyproject.toml: $ touch pyproject.toml
$ touch try.py
$ uvx ruff@latest format --range 1:1-1:9 .
ruff failed
Cause: The `--range` option is only supported when formatting a single file but the specified paths resolve to 2 files.Is passing a directory to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not really... I should have noticed this |
||
| .iter() | ||
| .any(|&path| resolved_file.file_name() == path) | ||
| { | ||
| return Ok((Ok(Statistics::default()), resolved_file.into_path())); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could reuse more with the python code path below. The structure here now feels very similar. I don't think we should push it very hard, but if you see an opportunity to do so