-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add Python Code Style Enforcement to GitHub Actions #272
Merged
komish
merged 3 commits into
openshift-helm-charts:main
from
komish:py-codestyle-tooling
Oct 13, 2023
Merged
Add Python Code Style Enforcement to GitHub Actions #272
komish
merged 3 commits into
openshift-helm-charts:main
from
komish:py-codestyle-tooling
Oct 13, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… on src files Signed-off-by: Jose R. Gonzalez <komish@flutes.dev>
Signed-off-by: Jose R. Gonzalez <komish@flutes.dev>
komish
force-pushed
the
py-codestyle-tooling
branch
from
October 12, 2023 20:04
01a0a90
to
1629bd1
Compare
This was referenced Oct 12, 2023
Signed-off-by: Jose R. Gonzalez <komish@flutes.dev>
This was referenced Oct 12, 2023
This was referenced Oct 12, 2023
OchiengEd
approved these changes
Oct 13, 2023
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.
/lgtm
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a:
Style
We've previously applied Black to the code in this repository, and fixed a few pep8 complaints. This just takes that a bit further and starts to enforce it on PRs.
Linting is currently configured to auto-pass because we have a lot of things that are not automatically fixable (namely import positioning and line length). The idea here is that, when so motivated, we can review the CI results against the repository and go about fixing them as we go along (vs. requiring an immediate fix to all the line length complaints today).
ruff
is used as the linter here simply due to its speed promises. If we have issues with it, we can eventually migrate to something else.Makefile
I make heavy use of venvs for python-related things. I'm less familiar with newer tooling thats in the same problem space. To that end, I've added Make targets that simply help facilitate the management and installation of virtualenvs. One target
venv.codestyle
is used for style tooling (black
,ruff
), the othervenv.tools
is used for our scripts themselves.For development, there are additional "subtargets" that let you always reinstall these venvs, for cases where you're making changes to scripts and want to call them using the installed executables. E.g.
venv.tools.always-reinstall
.gitignore
Just adds various paths. This is borrowed from a partial of the GitHub Python default gitignore that's scaffolded for new projects.