diff --git a/src/pyproject_fmt/formatter/tools.py b/src/pyproject_fmt/formatter/tools.py index 6aa6030..1cc7509 100644 --- a/src/pyproject_fmt/formatter/tools.py +++ b/src/pyproject_fmt/formatter/tools.py @@ -27,18 +27,32 @@ def fmt_tools(parsed: TOMLDocument, conf: Config) -> None: # noqa: ARG001 table = tools[tool] ensure_newline_at_end(cast(Table, table)) order = [ + # Build backends "poetry", "setuptools", + "distutils", "setuptools_scm", "hatch", + "flit", + "scikit-build", + "meson-python", + # Builders + "cibuildwheel", + # Formatters and linters "autopep8", "black", "ruff", "isort", "flake8", + "pylint", + "repo-review", + "codespell", + "docformatter", + # Testing "pytest", "pytest_env", "coverage", + # Type checking "mypy", ] order_keys(tools, to_pin=order) diff --git a/tests/formatter/test_tools.py b/tests/formatter/test_tools.py index 0f769a3..c3d2c13 100644 --- a/tests/formatter/test_tools.py +++ b/tests/formatter/test_tools.py @@ -16,6 +16,8 @@ def test_tools_ordering(fmt: Fmt) -> None: a = 0 [tool.poetry.scripts] version = "1" + [tool.scikit-build] + a = 0 [tool.pytest] a = 0 [tool.black] @@ -29,9 +31,21 @@ def test_tools_ordering(fmt: Fmt) -> None: a = 0 [tool.setuptools] a.b = 0 + [tool.docformatter] + c = 0 [tool.autopep8] a = 0 - + [tool.distutils] + a = 0 + [tool.codespell] + [tool.meson-python] + a = 0 + [tool.cibuildwheel] + a = 0 + [tool.pylint] + [tool.repo-review] + a = 0 + [tool.flit] """ expected = """ [tool.poetry] @@ -41,12 +55,26 @@ def test_tools_ordering(fmt: Fmt) -> None: [tool.setuptools] a.b = 0 + [tool.distutils] + a = 0 + [tool.setuptools_scm] a = 0 [tool.hatch] a = 0 + [tool.flit] + + [tool.scikit-build] + a = 0 + + [tool.meson-python] + a = 0 + + [tool.cibuildwheel] + a = 0 + [tool.autopep8] a = 0 @@ -58,6 +86,16 @@ def test_tools_ordering(fmt: Fmt) -> None: [tool.flake8] + [tool.pylint] + + [tool.repo-review] + a = 0 + + [tool.codespell] + + [tool.docformatter] + c = 0 + [tool.pytest] a = 0