From 1ebef30dbe82a332f89a64b116f0aa055cb0cd9c Mon Sep 17 00:00:00 2001 From: Paul Marillonnet Date: Thu, 8 Jul 2021 11:57:26 +0200 Subject: [PATCH] misc: add isort files/notes (#55470) --- .git-blame-ignore-revs | 2 ++ .pre-commit-config.yaml | 5 +++++ README | 9 +++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 0ec87fc1..d2a74d27 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,4 @@ # trivial: apply black 2bf37aaa7e459d429fca284f2de60add5841d063 +# trivial: apply isort (#55470) +0f75316e1b9a70e311d2971e75b32f84b00f487a diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01dbc86a..e321a18a 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 61f1b1c0..e0488b49 100644 --- a/README +++ b/README @@ -15,12 +15,17 @@ Variables Code Style ---------- -black is used to format the Python code, using thoses parameters: +black is used to format the Python code, using these parameters: black --target-version py37 --skip-string-normalization --line-length 110 +Similarly, isort is used for imports, using these parameters: + + isort --profile black --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.) +and isort before commits. (execute `pre-commit install` to install the git +hook.) License