From abbf40441d979a65f3d528de7c4f013431ae43f2 Mon Sep 17 00:00:00 2001 From: aradermacher Date: Fri, 24 Mar 2023 07:52:51 +0100 Subject: [PATCH] Update CONTRIBUTING.md (#65) * Update CONTRIBUTING.md add specification for isort and black * Update CONTRIBUTING.md Co-authored-by: srosenbu <69848361+srosenbu@users.noreply.github.com> --------- Co-authored-by: eriktamsen <86715087+eriktamsen@users.noreply.github.com> Co-authored-by: srosenbu <69848361+srosenbu@users.noreply.github.com> --- CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a4dd25e..16d99b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -96,6 +96,8 @@ Therefore, please don't use type annotations for class attributes, instead write ### Formatting -We use `black` and `isort` as automated formatters. On pull requests, this is automatically checked and you can only merge if your code passes the check. You can include both in a [pre-commit](https://pre-commit.com/) locally. +We use `black` (with line-length 119) and `isort` (black profile) as automated formatters. On pull requests, this is automatically checked and you can only merge if your code passes the check. You can include both in a +[pre-commit](https://pre-commit.com/) locally by executing `mamba install pre-commit` and `pre-commit install`, which creates a hook in your local git repository that is called when a commit is executed. +This will work assuming you have `black` and `isort` installed in your environment. `pre-commit` takes information from the `.pre-commit-config.yaml` to know which actions to perform. The formatting rules for both tools are defined in `pyproject.toml`. -**Note:** We may decide on slight variations in the code formatting, like the allowed line length. This will be mentioned here in the future. +**Note:** We may decide on slight variations in the code formatting. This will be mentioned here in the future.