diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a59521..2fd4301 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,6 +45,11 @@ repos: - id: ruff-check args: [--fix, --exit-non-zero-on-fix] - id: ruff-format + - repo: https://github.com/tox-dev/pyproject-fmt + rev: v2.30.1 + hooks: + - id: pyproject-fmt + args: [--table-format, long] - repo: https://github.com/google/yamlfmt rev: v0.21.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index f4661f9..66b712b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,23 +1,19 @@ [build-system] -requires = ["flit_core>=3.12.0", "flit_scm", "wheel"] build-backend = "flit_scm:buildapi" +requires = [ "flit-core>=3.12", "flit-scm", "wheel" ] [project] name = "relint" -authors = [ - { name = "Johannes Maron", email = "johannes@maron.family" }, -] readme = "README.md" +keywords = [ "linter", "regex" ] license = { file = "LICENSE" } -keywords = ["regex", "linter"] -dynamic = ["version", "description"] +requires-python = ">=3.14" classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", - "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3.15", @@ -25,16 +21,21 @@ classifiers = [ "Topic :: Software Development :: Quality Assurance", "Topic :: Software Development :: Testing", ] -requires-python = ">=3.14" +dynamic = [ "description", "version" ] dependencies = [ - "PyYAML", + "pyyaml", "rich", ] - +[[project.authors]] +name = "Johannes Maron" +email = "johannes@maron.family" [project.optional-dependencies] -regex = [ - "regex" -] +regex = [ "regex" ] +[project.urls] +Changelog = "https://github.com/codingjoe/relint/releases" +Project-URL = "https://github.com/codingjoe/relint" +[project.scripts] +relint = "relint.__main__:main" [dependency-groups] dev = [ @@ -46,53 +47,42 @@ test = [ "pytest-mock", ] -[project.scripts] -relint = "relint.__main__:main" - -[project.urls] -Project-URL = "https://github.com/codingjoe/relint" -Changelog = "https://github.com/codingjoe/relint/releases" +[tool.setuptools_scm] +write_to = "relint/_version.py" +[tool.flit] [tool.flit.module] name = "relint" -[tool.setuptools_scm] -write_to = "relint/_version.py" +[tool.ruff] +src = [ "relint", "tests" ] +[tool.ruff.lint] +select = [ + "B", # flake8-bugbear + "C", # flake8-comprehensions + "D", # pydocstyle + "E", # pycodestyle errors + "F", # pyflakes + "I", # isort + "S", # flake8-bandit + "UP", # pyupgrade + "W", # pycodestyle warnings +] +ignore = [ "B904", "D1", "E501", "S101" ] +isort.combine-as-imports = true +isort.force-wrap-aliases = true +isort.section-order = [ "future", "standard-library", "third-party", "first-party", "local-folder" ] +isort.split-on-trailing-comma = true +pydocstyle.convention = "pep257" +[tool.pytest] [tool.pytest.ini_options] minversion = "6.0" +testpaths = [ "tests" ] addopts = "--cov --tb=short -rxs" -testpaths = ["tests"] +[tool.coverage] [tool.coverage.run] -source = ["relint"] - +source = [ "relint" ] [tool.coverage.report] show_missing = true - -[tool.ruff] -src = ["relint", "tests"] - -[tool.ruff.lint] -select = [ - "E", # pycodestyle errors - "W", # pycodestyle warnings - "F", # pyflakes - "I", # isort - "S", # flake8-bandit - "D", # pydocstyle - "UP", # pyupgrade - "B", # flake8-bugbear - "C", # flake8-comprehensions -] - -ignore = ["B904", "D1", "E501", "S101"] - -[tool.ruff.lint.isort] -combine-as-imports = true -split-on-trailing-comma = true -section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"] -force-wrap-aliases = true - -[tool.ruff.lint.pydocstyle] -convention = "pep257"