Add task to run black --check in ci & update README
This commit is contained in:
parent
cd1c2dc3b5
commit
3860c0ab11
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@ -4,6 +4,24 @@ on: [push, pull_request]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
check-formatting:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
name: Consult black on python formatting
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
|
- uses: dschep/install-pipenv-action@v1
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pipenv install --dev --python ${pythonLocation}/python
|
||||||
|
- name: Run black
|
||||||
|
run: |
|
||||||
|
pipenv run black . --check --diff --exclude tests/output_
|
||||||
|
|
||||||
run-tests:
|
run-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
12
README.md
12
README.md
@ -307,6 +307,18 @@ $ pipenv shell
|
|||||||
$ pip install -e .
|
$ pip install -e .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Code style
|
||||||
|
|
||||||
|
This project enforces [black](https://github.com/psf/black) python code formatting.
|
||||||
|
|
||||||
|
Before commiting changes run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pipenv run black .
|
||||||
|
```
|
||||||
|
|
||||||
|
To avoid merge conflicts later, non-black formatted python code will fail in CI.
|
||||||
|
|
||||||
### Tests
|
### Tests
|
||||||
|
|
||||||
There are two types of tests:
|
There are two types of tests:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user