From 4b26e8bf5f6f9837fc1ac458c32fe2015c4ea7c1 Mon Sep 17 00:00:00 2001
From: David Robertson <davidr@element.io>
Date: Fri, 18 Feb 2022 17:04:22 +0000
Subject: [PATCH 1/3] Move isort config to `pyproject.toml`

---
 pyproject.toml | 12 ++++++++++++
 setup.cfg      | 11 -----------
 2 files changed, 12 insertions(+), 11 deletions(-)

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

From e5ae59e5f5c3f508c59efe4374870dc31ac9ad51 Mon Sep 17 00:00:00 2001
From: David Robertson <davidr@element.io>
Date: Mon, 21 Feb 2022 20:56:13 +0000
Subject: [PATCH 2/3] Changelog

---
 changelog.d/12052.misc | 1 +
 1 file changed, 1 insertion(+)
 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`.

From c9366d3500f9f1a5d478af0d7e3cd2315feb12b1 Mon Sep 17 00:00:00 2001
From: David Robertson <davidr@element.io>
Date: Tue, 22 Feb 2022 10:02:23 +0000
Subject: [PATCH 3/3] Let isort find pyproject.toml by itself

---
 tox.ini | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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