-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: cd to workspace folder before executing yapf #8
feat: cd to workspace folder before executing yapf #8
Conversation
This is necessary to have yapf honor `.yapfignore` or `pyproject.toml` files, which it reads from the directory that it is executed in. With the change, the call to `yapf` also passes `.` as the target for formatting; otherwise, relative paths specified in the ignore patterns do not match against the absolute target path. This resolves AlexanderMelde#7. Signed-off-by: Ingo Müller <ingomueller@google.com>
Hi Ingo, |
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.
Setting the workspace works as intended and helps remove a workaround we had earlier.
I would propose just two minor changes before merging.
Co-authored-by: Alexander Melde <2115644+AlexanderMelde@users.noreply.github.com>
Signed-off-by: Ingo Müller <ingomueller@google.com>
Good catches -- both changes applied. Thanks for the quick review! |
Thank you, I added your changes to the v2.0 release! |
Awesome, thanks! |
This is necessary to have yapf honor
.yapfignore
orpyproject.toml
files, which it reads from the directory that it is executed in. With the change, the call toyapf
also passes.
as the target for formatting; otherwise, relative paths specified in the ignore patterns do not match against the absolute target path.This resolves #7.