Skip to content

Commit 23722cd

Browse files
Add a formatter for the pyproject.toml (#435)
1 parent c091feb commit 23722cd

File tree

2 files changed

+61
-53
lines changed

2 files changed

+61
-53
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ repos:
2323
# see https://stackoverflow.com/a/61046953
2424
exclude: ^pylint_django/tests/input.*$
2525
args: [--safe, --line-length=120]
26+
- repo: https://github.com/tox-dev/pyproject-fmt
27+
rev: "2.2.4"
28+
hooks:
29+
- id: pyproject-fmt
30+
# https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version
31+
additional_dependencies: ["tox>=4.9"]
2632
- repo: local
2733
hooks:
2834
- id: pylint

pyproject.toml

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,45 @@
1+
[build-system]
2+
build-backend = "poetry.core.masonry.api"
3+
4+
requires = [ "poetry-core>=1" ]
5+
16
[tool.poetry]
27
name = "pylint-django"
38
version = "2.7.0"
49
readme = "README.rst"
510
description = "A Pylint plugin to help Pylint understand the Django web framework"
611
repository = "https://github.com/PyCQA/pylint-django"
7-
authors = ["Carl Crowder <git@carlcrowder.com>"]
12+
authors = [ "Carl Crowder <git@carlcrowder.com>" ]
813
classifiers = [
9-
"Development Status :: 5 - Production/Stable",
10-
"Environment :: Console",
11-
"Intended Audience :: Developers",
12-
"Operating System :: Unix",
13-
"Topic :: Software Development :: Quality Assurance",
14-
"Programming Language :: Python :: 3",
15-
"Programming Language :: Python :: 3.8",
16-
"Programming Language :: Python :: 3.9",
17-
"Programming Language :: Python :: 3.10",
18-
"Programming Language :: Python :: 3.11",
19-
"Programming Language :: Python :: 3.12",
20-
"Framework :: Django :: 2.2",
21-
"Framework :: Django :: 3",
22-
"Framework :: Django :: 3.0",
23-
"Framework :: Django :: 3.1",
24-
"Framework :: Django :: 3.2",
25-
"Framework :: Django :: 4",
26-
"Framework :: Django :: 4.0",
27-
"Framework :: Django :: 4.1",
28-
"Framework :: Django :: 4.2",
29-
"Framework :: Django :: 5.0",
30-
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
14+
"Development Status :: 5 - Production/Stable",
15+
"Environment :: Console",
16+
"Intended Audience :: Developers",
17+
"Operating System :: Unix",
18+
"Topic :: Software Development :: Quality Assurance",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.8",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
"Programming Language :: Python :: 3.12",
25+
"Framework :: Django :: 2.2",
26+
"Framework :: Django :: 3",
27+
"Framework :: Django :: 3.0",
28+
"Framework :: Django :: 3.1",
29+
"Framework :: Django :: 3.2",
30+
"Framework :: Django :: 4",
31+
"Framework :: Django :: 4.0",
32+
"Framework :: Django :: 4.1",
33+
"Framework :: Django :: 4.2",
34+
"Framework :: Django :: 5.0",
35+
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
3136
]
32-
keywords = ["pylint", "django", "plugin"]
37+
keywords = [ "pylint", "django", "plugin" ]
3338
packages = [
34-
{ include = "pylint_django/" }
39+
{ include = "pylint_django/" },
3540
]
36-
include = ["pylint_django/LICENSE"]
37-
exclude = ["**/tests/**", "**/testutils.py", "**/tests.py"]
38-
41+
include = [ "pylint_django/LICENSE" ]
42+
exclude = [ "**/tests/**", "**/testutils.py", "**/tests.py" ]
3943

4044
[tool.poetry.dependencies]
4145
python = ">=3.8,<4.0"
@@ -44,7 +48,7 @@ pylint = ">=2.0,<4"
4448
Django = { version = ">=2.2", optional = true }
4549

4650
[tool.poetry.group.dev.dependencies]
47-
tox = "^4"
51+
tox = ">=4.9"
4852
pytest = "^7.3.1"
4953
ruff = ">=0.1.1"
5054
wheel = "^0.40"
@@ -54,15 +58,26 @@ factory-boy = "^3.3"
5458
django-tastypie = "^0.14"
5559

5660
[tool.poetry.extras]
57-
with_django = ["Django"]
58-
59-
[build-system]
60-
requires = ["poetry-core>=1.0.0"]
61-
build-backend = "poetry.core.masonry.api"
61+
with_django = [ "Django" ]
6262

6363
[tool.black]
6464
line-length = 120
6565

66+
[tool.ruff]
67+
line-length = 120
68+
select = [
69+
"E", # pycodestyle
70+
"F", # pyflakes
71+
"W", # pycodestyle
72+
"B", # bugbear
73+
"I", # isort
74+
"RUF", # ruff
75+
"UP", # pyupgrade
76+
]
77+
ignore = [
78+
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
79+
]
80+
6681
[tool.isort]
6782
multi_line_output = 3
6883
include_trailing_comma = true
@@ -72,25 +87,12 @@ line_length = 120
7287

7388
[tool.pylint.main]
7489
disable = [
75-
"missing-docstring",
76-
"too-many-branches", "too-many-return-statements", "too-many-ancestors",
77-
"too-few-public-methods",
78-
"fixme",
90+
"missing-docstring",
91+
"too-many-branches",
92+
"too-many-return-statements",
93+
"too-many-ancestors",
94+
"too-few-public-methods",
95+
"fixme",
7996
]
8097
ignore = "tests"
8198
max-line-length = 120
82-
83-
[tool.ruff]
84-
line-length = 120
85-
select = [
86-
"E", # pycodestyle
87-
"F", # pyflakes
88-
"W", # pycodestyle
89-
"B", # bugbear
90-
"I", # isort
91-
"RUF", # ruff
92-
"UP", # pyupgrade
93-
]
94-
ignore = [
95-
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
96-
]

0 commit comments

Comments
 (0)