diff --git a/src/pyproject_fmt/formatter/tools.py b/src/pyproject_fmt/formatter/tools.py index e99ae29..5aaacc3 100644 --- a/src/pyproject_fmt/formatter/tools.py +++ b/src/pyproject_fmt/formatter/tools.py @@ -16,7 +16,18 @@ def fmt_tools(parsed: TOMLDocument, conf: Config) -> None: # noqa: U100 for tool in tools: table = tools[tool] ensure_newline_at_end(cast(Table, table)) - order_keys(tools, to_pin=["setuptools", "hatch", "black", "isort", "flake8", "pytest", "coverage", "mypy"]) + order = [ + "setuptools", + "setuptools_scm", + "hatch", + "black", + "isort", + "flake8", + "pytest", + "coverage", + "mypy", + ] + order_keys(tools, to_pin=order) __all__ = [ diff --git a/tests/formatter/test_tools.py b/tests/formatter/test_tools.py index 60233ca..3de4cfe 100644 --- a/tests/formatter/test_tools.py +++ b/tests/formatter/test_tools.py @@ -17,6 +17,8 @@ def test_tools_ordering(fmt: Fmt) -> None: [tool.flake8] [tool.hatch] a = 0 + [tool.setuptools_scm] + a = 0 [tool.setuptools] a.b = 0 @@ -25,6 +27,9 @@ def test_tools_ordering(fmt: Fmt) -> None: [tool.setuptools] a.b = 0 + [tool.setuptools_scm] + a = 0 + [tool.hatch] a = 0