-
Notifications
You must be signed in to change notification settings - Fork 0
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
Workflow fail if black and isort fail #38
Conversation
Seems that when you use the Without this flag, it seems our configuration outlined in |
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.
Great progress! Perhaps once we remove the "Run Black" and "Run Isort" pieces, we can also remove some of the installs? Not sure if they are required for the "check formatting" sections?
.github/workflows/format.yml
Outdated
@@ -33,9 +33,19 @@ jobs: | |||
- name: Run Black | |||
run: black ./ --config pyproject.toml |
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 don't think the "Run Black" section is wanted. The concern is if we format the code before checking it, then the workflow will always pass.
.github/workflows/format.yml
Outdated
options: "--check --verbose" | ||
src: "./" | ||
# use_pyproject: true, should be used but causing issues so commenting for now | ||
|
||
- name: Run Isort | ||
run: isort . |
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.
Same comment as above, I don't think we want to keep the "Run Isort" section any more.
.github/workflows/format.yml
Outdated
with: | ||
options: "--check --verbose" | ||
src: "./" | ||
# use_pyproject: true, should be used but causing issues so commenting for now |
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.
More info in my comment below, but I don't think we actually want to use the use_pyproject
option.
It looks like the It looks like the version of Black the action will use can be read from the As it is now, do we know whether the workflow is using the Black configuration in |
Haha, I think we got lucky as black's default config is set to 88 per line max as per their docs, and as we can see from the workflow summary the max line length being used is 119 characters. Check it out yourself here (expand the 'Check Black formatting' section. Also, I removed the force format using black and isort, so the workflow will fail if the code doesn't meet those standards just like with flake8. The I believe this should now be good to go. |
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.
Looks good✔️
Description:
Ensure that the workflow fails when black and isort style guides are not met.
Related Issues:
#36
Tips for the Reviewer:
Push black and isort breaking changes to observe workflow.
Note: I was unsure if black and isort should still run as they did before, kept them as is for now however, that can be removed as needed.
Checklist:
Please be sure to check all boxes honestly. This is to ensure a smooth development process, and to reduce the
likelihood of needing to make additional changes later on.
or whose authorship we cannot verify, may not be accepted.
I have verified that any updates to the project documentation are complete and look okay.
and isort style configurations.
pyproject.toml
and the Poetry lock filehave been updated to reflect any dependency changes.
contribution.