8000 Add task to run black --check in ci & update README · arpitjain799/python-betterproto@3860c0a · GitHub
[go: up one dir, main page]

Skip to content

Commit 3860c0a

Browse files
committed
Add task to run black --check in ci & update README
1 parent cd1c2dc commit 3860c0a

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ on: [push, pull_request]
44

55
jobs:
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

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff 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

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

325337
It 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

0 commit comments

Comments
 (0)
0