-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Format Python script using Black formatter #1202
Conversation
So the style is consistent Refer to issue: OWASP#1200
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.
Hi @za ,
Can you please take a look on how we can have the formatting done automatically using precommit? Thanks!
Hi @commjoen ok, I'll have a look. |
Something seems to fail when using the new pre-commit hook, can you please fix the black integration :) ? Then I am very happy to continue :) . [26/01 4:42:29] ➜ sort_contibutors git:(python-black-formatted) ✗ pre-commit install
pre-commit installed at .git/hooks/pre-commit
[26/01 4:42:34] ➜ sort_contibutors git:(python-black-formatted) ✗ git commit
[INFO] Initializing environment for https://github.com/psf/black.
An unexpected error has occurred: CalledProcessError: command: ('/usr/local/opt/git/libexec/git-core/git', 'checkout', '22.6b0')
return code: 1
expected return code: 0
stdout: (none)
stderr:
error: pathspec '22.6b0' did not match any file(s) known to git
Check the log at /Users/razr/.cache/pre-commit/pre-commit.log
[26/01 4:42:38] ➜ sort_contibutors git:(python-black-formatted) ✗ git status
On branch python-black-formatted
Your branch is up to date with 'origin/python-black-formatted'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: main.py
|
as the previous version is not working
Updated in the next commit |
as we implemented black in git pre-commit hook
…nto python-black-formatted
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.
Thank you!
What kind of changes does this PR include?
Description
Format Python script using Black formatter so that the style is consistent. Hopefully this will make the code more readable and attract more contributors.
Relations
Closes #1200
References
https://github.com/psf/black
Checklist: