summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.hgrc3
-rw-r--r--README.rst11
2 files changed, 14 insertions, 0 deletions
diff --git a/.hgrc b/.hgrc
new file mode 100644
index 0000000..ee91209
--- /dev/null
+++ b/.hgrc
@@ -0,0 +1,3 @@
+[hooks]
+precommit.black = tox -e black-run
+pre-amend.black = tox -e black-run
diff --git a/README.rst b/README.rst
index 643579f..7c2963f 100644
--- a/README.rst
+++ b/README.rst
@@ -64,6 +64,17 @@ Then build the doc ::
It's now available under `doc/_build/html/`
+Code style
+----------
+
+The python code is verified against *flake8* and formatted with *black*.
+
+* You can run `tox -e black` to check that the files are well formatted.
+* You can run `tox -e black-run` to format them if needed.
+* You can include the `.hgrc` to your own `.hgrc` to automatically run black
+ before each commit/amend. This can be done by writing `%include ../.hgrc` at
+ the end of your `.hgrc`.
+
Comments, support, bug reports
------------------------------