Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hugovk opened this issue May 11, 2024 · 0 comments
Closed

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

hugovk opened this issue May 11, 2024 · 0 comments

Comments

@hugovk
Copy link
Contributor

hugovk commented May 11, 2024

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:

  • do nothing
  • Move [tool.ruff.lint.isort] below [tool.ruff.lint]
  • Move [tool.ruff.lint.isort] back above [tool.ruff.lint]

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

Details
[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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants