From 451f139c794c551897aeae44564826955c451d45 Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Fri, 7 Aug 2026 09:38:19 +0200 Subject: [PATCH 1/3] Define local pre-commit checks --- .pre-commit-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..b47fa80 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +# Black version is kept in sync with .github/workflows/code_style.yml +repos: + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.1.0 + hooks: + - id: black + args: ["--line-length=120"] From 68580b39f18f964076c53067b6ae68453c8b0138 Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Mon, 10 Aug 2026 11:13:43 +0200 Subject: [PATCH 2/3] update readme --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 9cc9210..d2cafcf 100644 --- a/README.md +++ b/README.md @@ -191,3 +191,15 @@ For running test do: pip install pytest pytest-cov coveralls pytest --cov-report html --cov=mergin mergin/test/ ``` + +### Code style + +Code is formatted with [black](https://github.com/psf/black) (line length 120), enforced in CI. +To run the same check automatically before each commit, install the [pre-commit](https://pre-commit.com/) hooks once: + +```bash + pip install pre-commit + pre-commit install +``` + +The hook then runs on every `git commit`. From 65d01912a8eb7d3ade2e72a77ccff9b9bfd74517 Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Wed, 16 Sep 2026 14:16:45 +0200 Subject: [PATCH 3/3] cosmetics --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index d2cafcf..9918beb 100644 --- a/README.md +++ b/README.md @@ -201,5 +201,3 @@ To run the same check automatically before each commit, install the [pre-commit] pip install pre-commit pre-commit install ``` - -The hook then runs on every `git commit`.