-
Notifications
You must be signed in to change notification settings - Fork 44
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 autopep8 git hook #1100
Add autopep8 git hook #1100
Conversation
@KineticTheory Here you go. I tested this with some simple garbled formatting in a python file and it worked for me as a commit hook. I'm worried that at some point |
@@ -13,7 +13,7 @@ | |||
########################################################### | |||
# CONFIGURATION: | |||
# select which pre-commit hooks are going to be installed | |||
HOOKS="pre-commit pre-commit-clang-format pre-commit-flake8 pre-commit-fprettify" | |||
HOOKS="pre-commit pre-commit-clang-format pre-commit-autopep8 pre-commit-flake8 pre-commit-fprettify" |
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.
Do we still need pre-commit-flake8
if we adopt pre-commit-autopep8
?
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.
If we don't mind switching to autopep8
from flake8
, that would solve the above consistency issue I brought up. I do like that autopep8
will automatically apply formatting changes, but I don't know if there are reasons for us to still prefer flake8
at the CI level
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.
The superlinter CI check that we use will run flake8
. I want to keep that CI because it has a very low maintenance cost. It sounds like we need to keep both for now.
Background
flake8
is effective for enforcing python syntax, but it doesn't apply inline updates.autopep8
does provide inline fixes as an optionPurpose of Pull Request
autopep8
git hook to apply inline formatting fixes to modified python code prior to callingflake8
.Description of changes
pre-commit-autopep8
script and updatepre-commit
andinstall-hooks.sh
toDraco/environment/git
.Status