Projet

Général

Profil

0001-misc-add-isort-52797.patch

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

Télécharger (1,8 ko)

Voir les différences:

Subject: [PATCH 1/3] misc: add isort (#52797)

 .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
96 96

  
97 97
    black --target-version py37 --skip-string-normalization --line-length 110
98 98

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

  
101
    isort --profile black --line-length 110
102

  
103
There is .pre-commit-config.yaml to use pre-commit to automatically run black and isort
100 104
before commits. (execute `pre-commit install` to install the git hook.)
101 105

  
102 106

  
tox.ini
39 39
  python manage.py compilemessages
40 40
  py.test {env:COVERAGE:} {posargs: --junitxml=junit-{envname}.xml tests/}
41 41
  pylint: ./pylint.sh combo/
42
  black: pre-commit run black --all-files --show-diff-on-failure
42
  codestyle: pre-commit run --all-files --show-diff-on-failure
43
-