Projet

Général

Profil

0001-build-add-pre-commit-configuration-to-run-black-4978.patch

Frédéric Péters, 30 décembre 2020 14:19

Télécharger (1,64 ko)

Voir les différences:

Subject: [PATCH] build: add pre-commit configuration to run black (#49784)

 .pre-commit-config.yaml | 7 +++++++
 README                  | 7 ++++++-
 pyproject.toml          | 4 ++++
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 .pre-commit-config.yaml
 create mode 100644 pyproject.toml
.pre-commit-config.yaml
1
# See https://pre-commit.com for more information
2
# See https://pre-commit.com/hooks.html for more hooks
3
repos:
4
-   repo: https://github.com/psf/black
5
    rev: 20.8b1
6
    hooks:
7
    - id: black
README
32 32
Code Style
33 33
----------
34 34

  
35
black --target-version py35 --skip-string-normalization --line-length 110
35
black is used to format the code, using thoses parameters:
36

  
37
    black --target-version py35 --skip-string-normalization --line-length 110
38

  
39
There is .pre-commit-config.yaml to use pre-commit to automatically run black
40
before commits. (execute `pre-commit install` to install the git hook.)
36 41

  
37 42

  
38 43
Tests
pyproject.toml
1
[tool.black]
2
line-length = 110
3
target-version = ['py35']
4
skip-string-normalization = true
0
-