Open
Conversation
* Use docker-compose service to check code with Black
Add 'How to contribute' section and isort workflow badge.
KonstantinWilleke
requested changes
Feb 25, 2022
| with: | ||
| version: "22.1.0" | ||
| - name: Check code with black | ||
| run: touch .env && docker-compose run black |
Collaborator
There was a problem hiding this comment.
I don't understand this change with respect to the previous behavior. Could you explain what that is doing?
Collaborator
There was a problem hiding this comment.
Is this because you are setting the black version in the requirements-dev, so it's no longer needed here?
Member
Author
There was a problem hiding this comment.
Yes, this will build the Docker image with the black version specified in dev-requirements.txt and then create a container from that image that then checks the code with black.
Member
Author
There was a problem hiding this comment.
The benefit is that most of the logic is moved from the workflow to Docker which you can also run locally.
This file contains hidden or 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
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 pull request adds a isort workflow and makes various improvements to the
linting workflows.
It also adds a new Dockerfile specifically for linting with black and isort
that uses a plain python image as a base. This speeds up the linting workflows
because they no longer need to download the big sinzlab/pytorch image.
Lastly it also sorts all the imports.