build: add pre-commit configuration to run black (#49784)

This commit is contained in:
Frédéric Péters 2020-12-30 14:13:07 +01:00
parent 10631cb30e
commit 3447c30738
2 changed files with 14 additions and 1 deletions

8
.pre-commit-config.yaml Normal file
View File

@ -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', 'py35', '--skip-string-normalization', '--line-length', '110']

7
README
View File

@ -32,7 +32,12 @@ in the CHRONO_SETTINGS_FILE environment variable.
Code Style
----------
black --target-version py35 --skip-string-normalization --line-length 110
black is used to format the code, using thoses parameters:
black --target-version py35 --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.)
Tests