Skip to content

Commit 36b94c1

Browse files
authored
Merge pull request #314 from MerginMaps/precommit_yaml
Define local pre-commit checks
2 parents dc6b7aa + 2d1c580 commit 36b94c1

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Black version is kept in sync with .github/workflows/code_style.yml
2+
repos:
3+
- repo: https://github.com/psf/black-pre-commit-mirror
4+
rev: 26.1.0
5+
hooks:
6+
- id: black
7+
args: ["--line-length=120"]

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,15 @@ For running test do:
192192
pip install pytest pytest-cov coveralls
193193
pytest --cov-report html --cov=mergin mergin/test/
194194
```
195+
196+
### Code style
197+
198+
Code is formatted with [black](https://github.com/psf/black) (line length 120), enforced in CI.
199+
To run the same check automatically before each commit, install the [pre-commit](https://pre-commit.com/) hooks once:
200+
201+
```bash
202+
pip install pre-commit
203+
pre-commit install
204+
```
205+
206+
The hook then runs on every `git commit`.

0 commit comments

Comments
 (0)