Projet

Général

Profil

0002-misc-add-isort-52856.patch

Lauréline Guérin, 08 avril 2021 11:28

Télécharger (1,77 ko)

Voir les différences:

Subject: [PATCH 2/4] misc: add isort (#52856)

 .pre-commit-config.yaml | 5 +++++
 README                  | 6 +++++-
 tox.ini                 | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)
.pre-commit-config.yaml
6 6
    hooks:
7 7
    - id: black
8 8
      args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110']
9
-   repo: https://github.com/PyCQA/isort
10
    rev: 5.7.0
11
    hooks:
12
    - id: isort
13
      args: ['--profile', 'black', '--line-length', '110']
README
36 36

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

  
39
There is .pre-commit-config.yaml to use pre-commit to automatically run black
39
isort is used to format the imports, using those parameters:
40

  
41
    isort --profile black --line-length 110
42

  
43
There is .pre-commit-config.yaml to use pre-commit to automatically run black and isort
40 44
before commits. (execute `pre-commit install` to install the git hook.)
41 45

  
42 46

  
tox.ini
38 38
  python3 setup.py compile_translations
39 39
  py.test {env:COVERAGE:} {posargs:tests/}
40 40
  pylint: ./pylint.sh chrono/
41
  black: pre-commit run black --all-files --show-diff-on-failure
41
  codestyle: pre-commit run --all-files --show-diff-on-failure
42
-