-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* formatting and autoformat * autoformat workflow * Format code with black * Format code with black --------- Co-authored-by: louisblankemeier <[email protected]>
- Loading branch information
1 parent
5f4e282
commit 0d063ee
Showing
7 changed files
with
47 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Format code | ||
|
||
on: | ||
push: | ||
branches: [ 'master' ] | ||
pull_request: | ||
branches: [ 'master' ] | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Format code with black | ||
run: | | ||
pip install black | ||
black . | ||
- name: Sort imports with isort | ||
run: | | ||
pip install isort | ||
isort . | ||
- name: Remove unused imports with autoflake | ||
run: | | ||
pip install autoflake | ||
autoflake --in-place --remove-all-unused-imports --remove-unused-variables --recursive . | ||
- name: Commit changes | ||
uses: EndBug/add-and-commit@v4 | ||
with: | ||
author_name: ${{ github.actor }} | ||
author_email: ${{ github.actor }}@users.noreply.github.com | ||
message: "Format code with black" | ||
add: "." | ||
branch: ${{ github.ref }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ docs/_build | |
# ignore yml file | ||
*.yml | ||
*.yaml | ||
!.github/workflows/format.yml | ||
|
||
# ignore images | ||
*.png | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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