Repository: asottile/setup-cfg-fmt

Issue:
author and maintainer should be kept beside each other
found via https://github.com/pfmoore/editables/pull/2

Discussion:
asottile: this test could be extended: https://github.com/asottile/setup-cfg-fmt/blob/d6dc55e3b6e5b77c93f9641b6c7cbead7e6cfa8f/tests/setup_cfg_fmt_test.py#L139
JoshKarpel: D'oh, I was looking for tests that explicitly used `author`. Test extended.

Patch:
diff --git a/setup_cfg_fmt.py b/setup_cfg_fmt.py
index f7c674e..1dee7b6 100644
--- a/setup_cfg_fmt.py
+++ b/setup_cfg_fmt.py
@@ -20,8 +20,10 @@ KEYS_ORDER: Tuple[Tuple[str, Tuple[str, ...]], ...] = (
         'metadata', (
             'name', 'version', 'description',
             'long_description', 'long_description_content_type',
-            'url', 'author', 'author_email', 'license', 'license_file',
-            'license_files', 'platforms', 'classifiers',
+            'url',
+            'author', 'author_email', 'maintainer', 'maintainer_email',
+            'license', 'license_file', 'license_files',
+            'platforms', 'classifiers',
         ),
     ),
     (


Test patch:
diff --git a/tests/setup_cfg_fmt_test.py b/tests/setup_cfg_fmt_test.py
index 50062d9..36762f3 100644
--- a/tests/setup_cfg_fmt_test.py
+++ b/tests/setup_cfg_fmt_test.py
@@ -168,6 +168,25 @@ def test_rewrite_requires(which, input_tpl, expected_tpl, tmpdir):
 
             id='sorts classifiers',
         ),
+        pytest.param(
+            '[metadata]\n'
+            'maintainer_email = jane@example.com\n'
+            'maintainer = jane\n'
+            'license = foo\n'
+            'name = pkg\n'
+            'author_email = john@example.com\n'
+            'author = john\n',
+
+            '[metadata]\n'
+            'name = pkg\n'
+            'author = john\n'
+            'author_email = john@example.com\n'
+            'maintainer = jane\n'
+            'maintainer_email = jane@example.com\n'
+            'license = foo\n',
+
+            id='orders authors and maintainers',
+        ),
     ),
 )
 def test_rewrite(input_s, expected, tmpdir):