From 41e2c8eee35cdf24c1ae4ae1d2e761cff2f9bfc8 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Tue, 30 Mar 2021 10:34:19 +0200 Subject: [PATCH] add isort configuration (#52457) --- .git-blame-ignore-revs | 2 ++ .pre-commit-config.yaml | 5 +++++ README | 4 ++++ tox.ini | 1 + 4 files changed, 12 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 348e62dfb..22a8aca93 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,4 @@ # misc: apply black 4bb33d3d3c62516cfdb1ff5bba9216936a07d368 +# misc: apply isort +86d946adcdc784693d733131c2aecafc6caa8cbb diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a14705c76..c6a0c5762 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,3 +6,8 @@ repos: hooks: - id: black args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110'] +- repo: https://github.com/PyCQA/isort + rev: 5.7.0 + hooks: + - id: isort + args: ['--profile', 'black', '--line-length', '110'] diff --git a/README b/README index 1a8203b4a..5642d7c7d 100644 --- a/README +++ b/README @@ -78,6 +78,10 @@ black is used to format the code, using thoses parameters: 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.) +isort is used to format the imports, using those parameter: + + isort --force-single-line-imports --line-length 110 + Support ======= diff --git a/tox.ini b/tox.ini index 334c02576..77d24b9b6 100644 --- a/tox.ini +++ b/tox.ini @@ -113,6 +113,7 @@ deps = pre-commit commands = pre-commit run black --all-files --show-diff-on-failure + pre-commit run isort --all-files --show-diff-on-failure [pytest] filterwarnings =