Skip to content

Commit 5981347

Browse files
authored
Lint: we are ready to use Black now (#187)
* Lint: we are ready to use Black now We already ran black on all the codebase, so we should be ready to run black instead of darker. * Run `isort` after `black` * pre-commit: update all dependencies (#188)
1 parent e598102 commit 5981347

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

isort.cfg

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
# TODO: Use `profile = "black"` once we are fully migrated to Black.
2-
# Otherwise, isort and black will interfer together.
3-
# Also, make sure to run isort from pre-commit when removing darker.
4-
1+
# NOTE: we are not using `profile=black` because our configuration differs a little from Black
2+
# and we don't want to re-style all the imports again.
53
[settings]
64
line_length=88
75
indent=4
8-
9-
# TODO: I think we want ``4 (Hanging Grid)`` but given the problems we
10-
# are having with yapf and add-trailing-comma; we are force to use 3.
116
multi_line_output=3
12-
137
lines_after_imports=-1
148
combine_as_imports=False
159
force_adds=False

pre-commit-config.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ repos:
3838
args: ['--fix=lf']
3939

4040
- repo: https://github.com/PyCQA/autoflake
41-
rev: v2.1.1
41+
rev: v2.2.0
4242
hooks:
4343
- id: autoflake
4444
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
@@ -51,28 +51,34 @@ repos:
5151
# args: ['--in-place', '--wrap-summaries=80', '--wrap-descriptions=80', '--pre-summary-newline']
5252

5353
- repo: https://github.com/adamchainz/django-upgrade
54-
rev: "1.14.0"
54+
rev: "1.14.1"
5555
hooks:
5656
- id: django-upgrade
5757
args: [--target-version, "4.2"]
5858

59-
- repo: https://github.com/akaihola/darker
60-
rev: 1.7.1
59+
- repo: https://github.com/psf/black
60+
rev: 23.7.0
6161
hooks:
62-
- id: darker
63-
# TODO: find a way to pass `--check` only when running via `tox -e
64-
# pre-commit`
65-
args: ['--isort']
66-
additional_dependencies:
67-
- isort==5.12.0
68-
- black==23.7.0
62+
- id: black
63+
# It is recommended to specify the latest version of Python
64+
# supported by your project here, or alternatively use
65+
# pre-commit's default_language_version, see
66+
# https://pre-commit.com/#top_level-default_language_version
67+
language_version: python3.10
6968
exclude: |
7069
(?x)^(
7170
readthedocs/rtd_tests/files/conf.py|
7271
)$
7372
73+
# NOTE: run `isort` after `black` to keep the format of isort finally
74+
- repo: https://github.com/pycqa/isort
75+
rev: 5.12.0
76+
hooks:
77+
- id: isort
78+
name: isort (python)
79+
7480
- repo: https://github.com/asottile/blacken-docs
75-
rev: 1.13.0
81+
rev: 1.16.0
7682
hooks:
7783
- id: blacken-docs
7884
additional_dependencies: [black==23.7.0]

0 commit comments

Comments
 (0)