Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/sp_repo_review/checks/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,5 +429,29 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
return "filterwarnings" in options


class PP310(PyProject):
"Project uses pyproject-fmt"

url = mk_url("packaging-simple")

@staticmethod
def check(pyproject: dict[str, Any]) -> bool:
"""
For consistency across multiple Python projects' supporting setup,
a project should organize entries in file `pyproject.toml` with
`pyproject-fmt`. A minimal working example is

```toml
[tool.pyproject-fmt]
max_supported_python = "3.14"
```
"""
match pyproject:
case {"tool": {"pyproject-fmt": {}}}:
return True
case _:
return False


def repo_review_checks() -> dict[str, PyProject]:
return {p.__name__: p() for p in PyProject.__subclasses__()}
Loading