Skip to content

Commit

Permalink
Add task to run black --check in ci & update README
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-n committed May 27, 2020
1 parent cd1c2dc commit 3860c0a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ on: [push, pull_request]

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:
runs-on: ubuntu-latest

Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,18 @@ $ pipenv shell
$ 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

There are two types of tests:
Expand All @@ -324,7 +336,7 @@ Adding a standard test case is easy.

It will be picked up automatically when you run the tests.

- See also: [Standard Tests Development Guide](betterproto/tests/README.md)
- See also: [Standard Tests Development Guide](betterproto/tests/README.md)

#### Custom tests

Expand Down

0 comments on commit 3860c0a

Please sign in to comment.