From ca5a23b211ce20de00d6066de834b7f726e485b3 Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Fri, 7 Aug 2026 09:38:19 +0200 Subject: [PATCH 1/2] 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 2d1c58083e35d5493ffb0f136d0ca64af8b6addd Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Mon, 10 Aug 2026 11:13:43 +0200 Subject: [PATCH 2/2] update readme --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 7032d5a..09daa23 100644 --- a/README.md +++ b/README.md @@ -192,3 +192,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`.