-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use black through pre-commit, and enforce it in CI
* [CI] Add job 'Format' * add dev-requirements.txt * add .pre-commit-config.yaml
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -12,7 +12,23 @@ on: | |
|
||
jobs: | ||
|
||
build: | ||
Format: | ||
name: 🐍 Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: 🧰 Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: 🐍 Setup Python ${{ matrix.pyver }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: 🚦 Run pre-commit Action | ||
uses: pre-commit/[email protected] | ||
|
||
Build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
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,7 @@ | ||
# Configuration for pre-commit (https://pre-commit.com/), a tool to run | ||
# formatters, linters, and other productivity tools before a commit. | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 21.7b0 | ||
hooks: | ||
- id: black |
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,2 @@ | ||
pre-commit>=2.9.0 | ||
tox |