tox-dev / pyproject-fmt

MIT License
167 stars 27 forks source link

Unstable formatting for `[tool.ruff.lint]` and `[tool.ruff.lint.isort]` #205

Closed hugovk closed 4 months ago

hugovk commented 4 months ago

Running pyproject-fmt 2.0.3 on the TOML below for the first time reformats it. That's fine, it was last formatted with 1.x.

But if I run it again it will either:

We can see in https://github.com/hugovk/norwegianblue/pull/212 that pre-commit.ci ran once to reformat, but then failed on its own changes.

Details ```toml [build-system] build-backend = "hatchling.build" requires = [ "hatch-vcs", "hatchling", ] [project] name = "norwegianblue" description = "CLI to show end-of-life dates for a number of products" readme = "README.md" keywords = [ "cli", "end-of-life", "endoflife", "eol", ] license = {text = "MIT"} authors = [{name = "Hugo van Kemenade"}] requires-python = ">=3.8" classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] dynamic = [ "version", ] dependencies = [ "httpx>=0.19", "platformdirs", "prettytable>=2.4", "pytablewriter[html]>=0.63", "python-dateutil", "python-slugify", "termcolor>=2.1", ] [project.optional-dependencies] tests = [ "freezegun", "pytest", "pytest-cov", "respx>=0.11", ] [project.urls] Changelog = "https://github.com/hugovk/norwegianblue/releases" Homepage = "https://github.com/hugovk/norwegianblue" Source = "https://github.com/hugovk/norwegianblue" [project.scripts] eol = "norwegianblue.cli:main" norwegianblue = "norwegianblue.cli:main" [tool.hatch] version.source = "vcs" [tool.hatch.version.raw-options] local_scheme = "no-local-version" [tool.ruff] fix = true [tool.ruff.lint] select = [ "C4", # flake8-comprehensions "E", # pycodestyle errors "EM", # flake8-errmsg "F", # pyflakes errors "I", # isort "ISC", # flake8-implicit-str-concat "LOG", # flake8-logging "PGH", # pygrep-hooks "RUF100", # unused noqa (yesqa) "UP", # pyupgrade "W", # pycodestyle warnings "YTT", # flake8-2020 ] extend-ignore = [ "E203", # Whitespace before ':' "E221", # Multiple spaces before operator "E226", # Missing whitespace around arithmetic operator "E241", # Multiple spaces after ',' ] [tool.ruff.lint.isort] known-first-party = ["norwegianblue"] required-imports = ["from __future__ import annotations"] [tool.pyproject-fmt] max_supported_python = "3.13" [tool.pytest.ini_options] addopts = "--color=yes" ```