File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,24 @@ on: [push, pull_request]
44
55jobs :
66
7+ check-formatting :
8+ runs-on : ubuntu-latest
9+
10+ name : Consult black on python formatting
11+
12+ steps :
13+ - uses : actions/checkout@v1
14+ - uses : actions/setup-python@v1
15+ with :
16+ python-version : 3.7
17+ - uses : dschep/install-pipenv-action@v1
18+ - name : Install dependencies
19+ run : |
20+ pipenv install --dev --python ${pythonLocation}/python
21+ - name : Run black
22+ run : |
23+ pipenv run black . --check --diff --exclude tests/output_
24+
725 run-tests :
826 runs-on : ubuntu-latest
927
Original file line number Diff line number Diff line change @@ -307,6 +307,18 @@ $ pipenv shell
307307$ pip install -e .
308308```
309309
310+ ### Code style
311+
312+ This project enforces [ black] ( https://github.com/psf/black ) python code formatting.
313+
314+ Before commiting changes run:
315+
316+ ``` bash
317+ pipenv run black .
318+ ```
319+
320+ To avoid merge conflicts later, non-black formatted python code will fail in CI.
321+
310322### Tests
311323
312324There are two types of tests:
@@ -324,7 +336,7 @@ Adding a standard test case is easy.
324336
325337It will be picked up automatically when you run the tests.
326338
327- - See also: [ Standard Tests Development Guide] ( betterproto/tests/README.md )
339+ - See also: [ Standard Tests Development Guide] ( betterproto/tests/README.md )
328340
329341#### Custom tests
330342
You can’t perform that action at this time.
0 commit comments