File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,24 @@ on: [push, pull_request]
4
4
5
5
jobs :
6
6
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
+
7
25
run-tests :
8
26
runs-on : ubuntu-latest
9
27
Original file line number Diff line number Diff line change @@ -307,6 +307,18 @@ $ pipenv shell
307
307
$ pip install -e .
308
308
```
309
309
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
+
310
322
### Tests
311
323
312
324
There are two types of tests:
@@ -324,7 +336,7 @@ Adding a standard test case is easy.
324
336
325
337
It will be picked up automatically when you run the tests.
326
338
327
- - See also: [ Standard Tests Development Guide] ( betterproto/tests/README.md )
339
+ - See also: [ Standard Tests Development Guide] ( betterproto/tests/README.md )
328
340
329
341
#### Custom tests
330
342
You can’t perform that action at this time.
0 commit comments