-
Notifications
You must be signed in to change notification settings - Fork 933
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
ruff format
not formatting the files recursively but ruff format folder/folder1/folder2/folder3
works
#12146
Comments
ruff format
command not formatting the files recursively but ruff format folder/folder1/folder2/folder3
worksruff format
not formatting the files recursively but ruff format folder/folder1/folder2/folder3
works
Hmm that sounds strange. Any chance that you have a |
there are None of the |
thanks for the hint, i think i might have found out what the issue is. In one |
Yes, I think that's correct and should also match Git's behavior, as far as I understand, unless you added the files explicitly (or they were tracked before adding the ignore). We use the |
is there a way to see if ruff formatter s ignoring a file due to |
You can try |
ok, i have a reproducible example now Folder structure
contents of .gitignore
Gitforce add the RuffNow run
So the |
Ruff doesn't check whether a file is added to your git repository. It only interprets your gitignore and determines whether a file should be excluded. I recommend you update your git ignore to only ignore files that are not part of your repository. This also makes it less likely that someone forgets to commit a python file that's later added to |
Yup, this is what i did now. Just posting it here so that it's documented on why this is happening. Someone else might be wondering the same as me in future :) |
This is a weird issue that i have encountered. I cannot also reproduce it in a similar folder structure outside the current project. I'll try to describe what happens.
I have a python project setup using
pyproject.toml
and the ruff configuration is as followsIssue
The files inside
testSuite
are not fomatted when runningruff format
from the top level folder.If i run
ruff format testSuite/path/to/folder/inside/
then it works but only if the path supplied is the last level in the tree. See output below. Note how the last command formats the files but the first 2 don't.System info
Any pointers here on what exactly i am doing wrong would be helpful.
Thanks!
The text was updated successfully, but these errors were encountered: