Skip to content
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

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

ingomueller-net
Copy link
Contributor

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 #7.

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>
@AlexanderMelde
Copy link
Owner

AlexanderMelde commented Nov 26, 2024

Hi Ingo,
thank you for this contribution!
That's a helpful addition.
I will test the functionality today and release a new version of the action if there are no changes necessary.
Best, Alexander

Copy link
Owner

@AlexanderMelde AlexanderMelde left a 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.

entrypoint.sh Outdated Show resolved Hide resolved
ingomueller-net and others added 2 commits November 26, 2024 13:08
Co-authored-by: Alexander Melde <2115644+AlexanderMelde@users.noreply.github.com>
Signed-off-by: Ingo Müller <ingomueller@google.com>
@ingomueller-net
Copy link
Contributor Author

Good catches -- both changes applied. Thanks for the quick review!

@AlexanderMelde AlexanderMelde merged commit 88aa9b9 into AlexanderMelde:master Nov 26, 2024
@AlexanderMelde
Copy link
Owner

Thank you, I added your changes to the v2.0 release!

@ingomueller-net ingomueller-net deleted the working-dir branch November 26, 2024 15:00
@ingomueller-net
Copy link
Contributor Author

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.yapfignore files aren't honored due to working directory
2 participants