summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2021-07-13 09:39:59 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2021-07-13 09:42:39 (GMT)
commitaec0edb0c84758bc1c9ea7cd965d7b8311cbf9f2 (patch)
tree5410339856f02d12e687ab9476a2cf1ef6a62231
parent250ef2e74ae674f7039318787ba85b63f2825c7d (diff)
downloadwelco-wip/isort-pyupgrade.zip
welco-wip/isort-pyupgrade.tar.gz
welco-wip/isort-pyupgrade.tar.bz2
build: document and use isort and pyupgradev0.82wip/isort-pyupgrade
-rw-r--r--.git-blame-ignore-revs2
-rw-r--r--.pre-commit-config.yaml10
-rw-r--r--README13
3 files changed, 23 insertions, 2 deletions
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
index 505921d..ed2552d 100644
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -1,2 +1,4 @@
# trivial: apply black
ce7f2dd5000cf1eb462ae18aeeb5ab66913b452f
+# trivial: apply isort & pyupgrade
+250ef2e74ae674f7039318787ba85b63f2825c7d
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a14705c..ce247d6 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -6,3 +6,13 @@ 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']
+- repo: https://github.com/asottile/pyupgrade
+ rev: v2.20.0
+ hooks:
+ - id: pyupgrade
+ args: ['--keep-percent-format', '--py37-plus']
diff --git a/README b/README
index 405e4b2..9fc80ce 100644
--- a/README
+++ b/README
@@ -44,8 +44,17 @@ black is used to format the code, using thoses parameters:
black --target-version py37 --skip-string-normalization --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.)
+isort is used to format the imports, using those parameters:
+
+ isort --profile black --line-length 110
+
+pyupgrade is used to automatically upgrade syntax, using those parameters:
+
+ pyupgrade --keep-percent-format --py37-plus
+
+There is .pre-commit-config.yaml to use pre-commit to automatically run black,
+isort and pyupgrade before commits. (execute `pre-commit install` to install
+the git hook.)
License