-
Notifications
You must be signed in to change notification settings - Fork 125
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 black lint #483
Add black lint #483
Conversation
.github/workflows/ci.yml
Outdated
reformat: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 |
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.
what does this action do ?
will it fail if the code is not formatted correctly ?
if it checks for changes after applying black then it's actually a linter ?
and if it just apply changes (e.g. reforamt) maybe we don't need it as ci ?
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.
this action will fail on bad formating, so it's actually a linter action,
can we rename it "blake" , because we already do a basic linting using flake8
.github/workflows/ci.yml
Outdated
reformat: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: psf/black@stable |
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.
Please note that the --check flag is required so that the workflow fails if Black finds files that need to be formatted.
options: "--check --verbose"
If we want to fail code contributions that do not follow code standard we need to add
Ref: https://black.readthedocs.io/en/stable/integrations/github_actions.html
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.
i see that the --check is default, no need to add it ... 👍
nitpick II: we should add black to the requirements file: not sure if use this files: |
…dd it to the dev deps
Use better formatting of necessary changes to comply with Black codestyle Co-authored-by: Yaacov Zamir <kobi.zamir@gmail.com>
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
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.
Blint is too creative but we can improve it later.
@sleviim can you ack the changes in the course python code?
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.
WOW!
I definitely like this one!
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.
Some suggestions, please share your thoughts.
It looks really good without my suggestions as well, so I can merge it anyway if you like.
lint failed: |
This means the code needs reformatting with black. @kiblik1 can you do reformat and post a version that pass CI? |
@nirs W503 is very strange rule, W503 should be disabled by default ? Ref:
p.s. |
@yaacov right, disable W503. |
Hi, not sure who should disable it. |
yes, I am for squashing 🦑 |
* Fix RedHat-Israel#482 * apply black codestyle * modify flake8 settings to be compatible with Black * change job name to be less ambiguous * integrate black into ci as a step reather than a standalone job and add it to the dev deps * Update .flake8 Use better formatting of necessary changes to comply with Black codestyle Co-authored-by: Yaacov Zamir <kobi.zamir@gmail.com> * add W508 to ignored rules * fix typo * fix yet another typo... --------- Co-authored-by: Yaacov Zamir <kobi.zamir@gmail.com>
* Fix RedHat-Israel#482 * apply black codestyle * modify flake8 settings to be compatible with Black * change job name to be less ambiguous * integrate black into ci as a step reather than a standalone job and add it to the dev deps * Update .flake8 Use better formatting of necessary changes to comply with Black codestyle Co-authored-by: Yaacov Zamir <kobi.zamir@gmail.com> * add W508 to ignored rules * fix typo * fix yet another typo... --------- Co-authored-by: Yaacov Zamir <kobi.zamir@gmail.com>
* Fix RedHat-Israel#482 * apply black codestyle * modify flake8 settings to be compatible with Black * change job name to be less ambiguous * integrate black into ci as a step reather than a standalone job and add it to the dev deps * Update .flake8 Use better formatting of necessary changes to comply with Black codestyle Co-authored-by: Yaacov Zamir <kobi.zamir@gmail.com> * add W508 to ignored rules * fix typo * fix yet another typo... --------- Co-authored-by: Yaacov Zamir <kobi.zamir@gmail.com>
fixes #482
The apply black codestyle is huge I know :( but I don´t know any way to disable the job for old files and it would have to be run eventually.