From 69bd6d3d2cbf53249bff4c9d5d1223533bdc558c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 4 Feb 2021 10:40:55 +0100 Subject: [PATCH] misc: add black files/notes --- .git-blame-ignore-revs | 2 ++ .pre-commit-config.yaml | 8 ++++++++ README | 12 ++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 .git-blame-ignore-revs create mode 100644 .pre-commit-config.yaml diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..0c0936d74 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# trivial: apply black +4ebe82ef21fed8353ac38f8257c69a1a31322634 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..a14705c76 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/psf/black + rev: 20.8b1 + hooks: + - id: black + args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110'] diff --git a/README b/README index 6e3b19268..edce305cd 100644 --- a/README +++ b/README @@ -31,6 +31,18 @@ Then you need to run the tests It is possible to pass a --without-postgresql-tests parameter to skip the PostgreSQL tests. + +Code Style +---------- + +black is used to format the code, using thoses parameters: + + black --target-version py37 --skip-string-normalization --line-length 110 + +There is .pre-commit-config.yaml to use pre-commit to automatically run black +before commits. (execute `pre-commit install` to install the git hook.) + + Copyright ---------