Skip to content

Commit dcb4e5a

Browse files
[pre-commit] Add a hook for pyproject-fmt (#758)
This normalize the pyproject.toml making it easier to contribute to it.
1 parent 78d0843 commit dcb4e5a

File tree

6 files changed

+88
-66
lines changed

6 files changed

+88
-66
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ repos:
2323
(?x)^(
2424
|tests/.*
2525
)$
26+
- repo: https://github.com/tox-dev/pyproject-fmt
27+
rev: "v2.5.1"
28+
hooks:
29+
- id: pyproject-fmt
2630
- repo: https://github.com/codespell-project/codespell
2731
rev: v2.4.1
2832
hooks:

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 72 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,57 @@
1+
[build-system]
2+
build-backend = "poetry.core.masonry.api"
3+
4+
requires = [ "poetry-core>=1" ]
5+
16
[project]
27
name = "prospector"
38
version = "1.16.1"
49
description = "Prospector is a tool to analyse Python code by aggregating the result of other tools."
10+
readme = "README.rst"
11+
keywords = [ "prospector", "pylint", "static code analysis" ]
12+
license = "GPLv2+"
13+
maintainers = [
14+
{ name = "Carl Crowder", email = "[email protected]" },
15+
{ name = "Carlos Coelho", email = "[email protected]" },
16+
{ name = "Pierre Sassoulas", email = "[email protected]" },
17+
{ name = "Stéphane Brunner", email = "[email protected]" },
18+
]
519
authors = [
6-
{name = "Carl Crowder", email = "[email protected]"}
20+
{ name = "Carl Crowder", email = "[email protected]" },
721
]
8-
maintainers = [
9-
{name = "Carl Crowder", email = "[email protected]"},
10-
{name = "Carlos Coelho", email = "[email protected]"},
11-
{name = "Pierre Sassoulas", email = "[email protected]"},
12-
{name = "Stéphane Brunner", email = "[email protected]"}
22+
requires-python = ">=3.9"
23+
classifiers = [
24+
"Development Status :: 5 - Production/Stable",
25+
"Environment :: Console",
26+
"Intended Audience :: Developers",
27+
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
28+
"Operating System :: Unix",
29+
"Programming Language :: Python :: 3 :: Only",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
"Programming Language :: Python :: 3.13",
35+
"Topic :: Software Development :: Quality Assurance",
1336
]
14-
readme = "README.rst"
37+
dynamic = [ "dependencies" ]
38+
39+
optional-dependencies.with_bandit = [ "bandit" ]
40+
optional-dependencies.with_everything = [ "bandit", "mypy", "pyright", "pyroma", "ruff", "vulture" ]
41+
optional-dependencies.with_mypy = [ "mypy" ]
42+
optional-dependencies.with_pyright = [ "pyright" ]
43+
optional-dependencies.with_pyroma = [ "pyroma" ]
44+
optional-dependencies.with_ruff = [ "ruff" ]
45+
optional-dependencies.with_vulture = [ "vulture" ]
1546
urls."Bug Tracker" = "https://github.com/prospector-dev/prospector/issues"
1647
urls."homepage" = "http://prospector.readthedocs.io"
1748
urls."repository" = "https://github.com/prospector-dev/prospector"
18-
keywords = ["pylint", "prospector", "static code analysis"]
19-
license = "GPLv2+"
20-
classifiers = [
21-
"Development Status :: 5 - Production/Stable",
22-
"Environment :: Console",
23-
"Intended Audience :: Developers",
24-
"Operating System :: Unix",
25-
"Topic :: Software Development :: Quality Assurance",
26-
"Programming Language :: Python :: 3.9",
27-
"Programming Language :: Python :: 3.10",
28-
"Programming Language :: Python :: 3.11",
29-
"Programming Language :: Python :: 3.12",
30-
"Programming Language :: Python :: 3.13",
31-
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
32-
]
33-
requires-python = ">=3.9"
34-
dynamic = ["dependencies"]
35-
36-
[project.optional-dependencies]
37-
with_bandit = ["bandit"]
38-
with_mypy = ["mypy"]
39-
with_pyright = ["pyright"]
40-
with_pyroma = ["pyroma"]
41-
with_vulture = ["vulture"]
42-
with_ruff = ["ruff"]
43-
with_everything = ["bandit", "mypy", "pyright", "pyroma", "vulture", "ruff"]
44-
45-
[project.scripts]
46-
prospector = "prospector.run:main"
49+
scripts.prospector = "prospector.run:main"
4750

4851
[tool.poetry]
4952
# The format is a workaround aganst https://github.com/python-poetry/poetry/issues/9961
5053
packages = [
51-
{ include = "prospector/", format = ["sdist"] }
54+
{ include = "prospector/", format = [ "sdist" ] },
5255
]
5356
include = [
5457
"prospector/blender_combinations.yaml",
@@ -72,12 +75,12 @@ toml = "^0.10.2"
7275
setoptconf-tmp = "^0.3.1"
7376
GitPython = "^3.1.27"
7477
packaging = "*"
75-
bandit = {version = ">=1.5.1", optional = true}
76-
vulture = {version = ">=1.5", optional = true}
77-
mypy = {version = ">=0.600", optional = true}
78-
pyright = {version = ">=1.1.3", optional = true}
79-
pyroma = {version = ">=2.4", optional = true}
80-
ruff = {version = "*", optional = true}
78+
bandit = { version = ">=1.5.1", optional = true }
79+
vulture = { version = ">=1.5", optional = true }
80+
mypy = { version = ">=0.600", optional = true }
81+
pyright = { version = ">=1.1.3", optional = true }
82+
pyroma = { version = ">=2.4", optional = true }
83+
ruff = { version = "*", optional = true }
8184

8285
[tool.poetry.group.dev.dependencies]
8386
coveralls = "^3.3.1"
@@ -91,29 +94,37 @@ tox = "^3.27.1"
9194
twine = "^5.1.1"
9295
types-PyYAML = "^6.0.4"
9396

94-
[build-system]
95-
requires = ["poetry-core>=1.0.0"]
96-
build-backend = "poetry.core.masonry.api"
97-
9897
[tool.ruff]
99-
line-length = 120
10098
target-version = "py39"
10199

102-
[tool.ruff.lint]
103-
fixable = ["ALL"]
104-
extend-select = [
105-
"UP", # pyupgrade
106-
"F", # Pyflakes
107-
"E", "W", # Pycodestyle
108-
"I", # isort
109-
"S", # flake8-bandit
110-
"SIM", # flake8-simplify
100+
line-length = 120
101+
lint.extend-select = [
111102
"B", # flake8-bugbear
112-
"PT", # flake8-pytest-style
113103
# pydocstyle
114-
"D213", "D214", "D215", "D405", "D406", "D407", "D408", "D409", "D410", "D411", "D413", "D416", "D417",
104+
"D213",
105+
"D214",
106+
"D215",
107+
"D405",
108+
"D406",
109+
"D407",
110+
"D408",
111+
"D409",
112+
"D410",
113+
"D411",
114+
"D413",
115+
"D416",
116+
"D417",
117+
"E",
118+
"F", # Pyflakes
119+
"I", # isort
120+
"PT", # flake8-pytest-style
121+
"S", # flake8-bandit
122+
"SIM", # flake8-simplify
123+
"UP", # pyupgrade
124+
"W", # Pycodestyle
115125
]
116-
ignore= [
117-
"S101", # Use of assert detected
126+
lint.ignore = [
127+
"S101", # Use of assert detected
118128
"SIM105", # suppressible-exception (slow code)
119129
]
130+
lint.fixable = [ "ALL" ]
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
[project]
22
name = "prospector-profile-test"
3-
description = "A package used to test the prospector external profile"
43
version = "0.0.0"
54

5+
description = "A package used to test the prospector external profile"
6+
classifiers = [
7+
"Programming Language :: Python :: 3 :: Only",
8+
"Programming Language :: Python :: 3.9",
9+
"Programming Language :: Python :: 3.10",
10+
"Programming Language :: Python :: 3.11",
11+
"Programming Language :: Python :: 3.12",
12+
"Programming Language :: Python :: 3.13",
13+
]
14+
615
[tool.setuptools.package-data]
7-
prospector_profile_test = ["*.yaml"]
16+
prospector_profile_test = [ "*.yaml" ]
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
21
[tool.pylint.'FORMAT']
32
max-line-length = 40
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
21
[tool.pylint.'FORMAT']
32
max-line-length = 40

0 commit comments

Comments
 (0)