Include configured extensions in file discovery#23400
Conversation
|
ntBre
left a comment
There was a problem hiding this comment.
This looks reasonable to me, but could we add a test or two? I'm kind of surprised we didn't do this already, but I guess it could be a more common scenario after #23384.
Should we add *.md to INCLUDE_PREVIEW while we're here?
efc6fd5 to
81ecde0
Compare
|
Added an integration test, but I want to hold off on including
|
81ecde0 to
1b2424e
Compare
|
#23434 has a draft PR to add |
1b2424e to
292310c
Compare
|
Moved the test case, and also added a short blurb to the configuration documentation. |
|
Does this require any changes to Ruff's VS Code extension/LSP? Seems tricky, so maybe not something we need to solve now but it might be worth opening an issue. |
|
I did update the LSP to declare that it supports the Markdown file format, which means if the editor determines the file contents is Markdown, then it should automatically be able to ask Ruff to format it, and same thing for the Python file formats, and as long as Ruff is configured correctly, it should be willing to format that file accordingly. That said, I just tested this in vscode by creating a Markdown file with a random extension, and then setting it's file type in the editor as Markdown — that gives me the option to |
When running ruff with
--preview, this includes any configured fileextension mappings in the default file discovery globs.
Eg,
ruff check --preview --extension foo:py, ruff will default toincluding
*.fooin the file discovery, preventing the need to setboth an extension map and add a new glob to the
includesetting.Issue #23204