summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Peuch <cortex@worlddomination.be>2020-04-01 16:11:04 +0200
committerLaurent Peuch <cortex@worlddomination.be>2020-04-01 16:11:04 +0200
commit32cd73810056594f55eff0ffafebbdeb50c7a860 (patch)
tree0289a794bb9398b5ee858b98a202496fbc84ac40
parent8a910e9cb137ae04e9ad570adc46fa7104a5d9ab (diff)
downloadlogilab-common-32cd73810056594f55eff0ffafebbdeb50c7a860.tar.gz
[README] add instruction on how to use and integrate black
Taken from yams taken from nemo
-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
------------------------------