From 1ae492c8c09edef4a6d2af65588895305eaedec3 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 22 Feb 2022 11:30:19 +0000 Subject: [PATCH] Move isort config to `pyproject.toml` (#12052) --- changelog.d/12052.misc | 1 + pyproject.toml | 12 ++++++++++++ setup.cfg | 11 ----------- tox.ini | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 changelog.d/12052.misc diff --git a/changelog.d/12052.misc b/changelog.d/12052.misc new file mode 100644 index 000000000000..fbaff67e959f --- /dev/null +++ b/changelog.d/12052.misc @@ -0,0 +1 @@ +Move `isort` configuration to `pyproject.toml`. diff --git a/pyproject.toml b/pyproject.toml index 963f149c6af6..c9cd0cf6ec10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,3 +54,15 @@ exclude = ''' )/ ) ''' + +[tool.isort] +line_length = 88 +sections = ["FUTURE", "STDLIB", "THIRDPARTY", "TWISTED", "FIRSTPARTY", "TESTS", "LOCALFOLDER"] +default_section = "THIRDPARTY" +known_first_party = ["synapse"] +known_tests = ["tests"] +known_twisted = ["twisted", "OpenSSL"] +multi_line_output = 3 +include_trailing_comma = true +combine_as_imports = true + diff --git a/setup.cfg b/setup.cfg index e5ceb7ed1933..a0506572d96b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,14 +19,3 @@ ignore = # E731: do not assign a lambda expression, use a def # E501: Line too long (black enforces this for us) ignore=W503,W504,E203,E731,E501 - -[isort] -line_length = 88 -sections=FUTURE,STDLIB,THIRDPARTY,TWISTED,FIRSTPARTY,TESTS,LOCALFOLDER -default_section=THIRDPARTY -known_first_party = synapse -known_tests=tests -known_twisted=twisted,OpenSSL -multi_line_output=3 -include_trailing_comma=true -combine_as_imports=true diff --git a/tox.ini b/tox.ini index 41678aa38bee..436ecf7552f7 100644 --- a/tox.ini +++ b/tox.ini @@ -166,7 +166,7 @@ commands = [testenv:check_isort] extras = lint -commands = isort -c --df --sp setup.cfg {[base]lint_targets} +commands = isort -c --df {[base]lint_targets} [testenv:check-newsfragment] skip_install = true