From 7425778bd85e6a84181ce90d8efed9eb7a6ce4ae Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 21 Nov 2025 20:46:14 -0500 Subject: [PATCH 1/3] refactor: rename docs -> rtd for check family Signed-off-by: Henry Schreiner --- README.md | 14 +++++++------- src/sp_repo_review/checks/readthedocs.py | 2 +- src/sp_repo_review/families.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9657bd62..772a8c18 100644 --- a/README.md +++ b/README.md @@ -338,13 +338,6 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 - [`PP308`](https://learn.scientific-python.org/development/guides/pytest#PP308): Specifies useful pytest summary - [`PP309`](https://learn.scientific-python.org/development/guides/pytest#PP309): Filter warnings specified -### Documentation -- [`RTD100`](https://learn.scientific-python.org/development/guides/docs#RTD100): Uses ReadTheDocs (pyproject config) -- [`RTD101`](https://learn.scientific-python.org/development/guides/docs#RTD101): You have to set the RTD version number to 2 -- [`RTD102`](https://learn.scientific-python.org/development/guides/docs#RTD102): You have to set the RTD build image -- [`RTD103`](https://learn.scientific-python.org/development/guides/docs#RTD103): You have to set the RTD python version -- [`RTD104`](https://learn.scientific-python.org/development/guides/docs#RTD104): You have to specify a build configuration now for readthedocs. - ### GitHub Actions - [`GH100`](https://learn.scientific-python.org/development/guides/gha-basic#GH100): Has GitHub Actions config - [`GH101`](https://learn.scientific-python.org/development/guides/gha-basic#GH101): Has nice names @@ -388,6 +381,13 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 - [`PC902`](https://learn.scientific-python.org/development/guides/style#PC902): Custom pre-commit CI autofix message - [`PC903`](https://learn.scientific-python.org/development/guides/style#PC903): Specified pre-commit CI schedule +### ReadTheDocs +- [`RTD100`](https://learn.scientific-python.org/development/guides/docs#RTD100): Uses ReadTheDocs (pyproject config) +- [`RTD101`](https://learn.scientific-python.org/development/guides/docs#RTD101): You have to set the RTD version number to 2 +- [`RTD102`](https://learn.scientific-python.org/development/guides/docs#RTD102): You have to set the RTD build image +- [`RTD103`](https://learn.scientific-python.org/development/guides/docs#RTD103): You have to set the RTD python version +- [`RTD104`](https://learn.scientific-python.org/development/guides/docs#RTD104): You have to specify a build configuration now for readthedocs. + ### Ruff - [`RF001`](https://learn.scientific-python.org/development/guides/style#RF001): Has Ruff config - [`RF002`](https://learn.scientific-python.org/development/guides/style#RF002): Target version must be set diff --git a/src/sp_repo_review/checks/readthedocs.py b/src/sp_repo_review/checks/readthedocs.py index fc9931e9..5187c2b6 100644 --- a/src/sp_repo_review/checks/readthedocs.py +++ b/src/sp_repo_review/checks/readthedocs.py @@ -11,7 +11,7 @@ class ReadTheDocs: - family = "docs" + family = "rtd" url = mk_url("docs") diff --git a/src/sp_repo_review/families.py b/src/sp_repo_review/families.py index dfe897ec..b685dadf 100644 --- a/src/sp_repo_review/families.py +++ b/src/sp_repo_review/families.py @@ -121,8 +121,8 @@ def get_families( name="Ruff", description=ruff_description(ruff), ), - "docs": Family( - name="Documentation", + "rtd": Family( + name="ReadTheDocs", ), "setupcfg": Family( name="Setuptools Config", From 99a44a0fc1fde8e93b5fdb039316aa06682e409f Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 21 Nov 2025 21:11:14 -0500 Subject: [PATCH 2/3] fix: note when checks might be hidden Signed-off-by: Henry Schreiner --- README.md | 21 ++++++++++++++++++++- src/sp_repo_review/families.py | 5 +++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 772a8c18..89554c33 100644 --- a/README.md +++ b/README.md @@ -305,7 +305,9 @@ from repo_review.families import get_family_name collected = collect_all() print() for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1].family): - print(f'### {get_family_name(collected.families, family)}') + print(f'### {get_family_name(collected.families, family)}\n') + if note := collected.families.get(family, {}).get("readme_note"): + print(note, end="\n\n") for code, check in grp: url = get_check_url(code, check) link = f"[`{code}`]({url})" if url else f"`{code}`" @@ -314,6 +316,7 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 ]]] --> ### General + - [`PY001`](https://learn.scientific-python.org/development/guides/packaging-simple#PY001): Has a pyproject.toml - [`PY002`](https://learn.scientific-python.org/development/guides/packaging-simple#PY002): Has a README.(md|rst) file - [`PY003`](https://learn.scientific-python.org/development/guides/packaging-simple#PY003): Has a LICENSE* file @@ -323,6 +326,7 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 - [`PY007`](https://learn.scientific-python.org/development/guides/tasks#PY007): Supports an easy task runner (nox, tox, pixi, etc.) ### PyProject + - [`PP002`](https://learn.scientific-python.org/development/guides/packaging-simple#PP002): Has a proper build-system table - [`PP003`](https://learn.scientific-python.org/development/guides/packaging-classic#PP003): Does not list wheel as a build-dep - [`PP004`](https://learn.scientific-python.org/development/guides/packaging-simple#PP004): Does not upper cap Python requires @@ -339,6 +343,7 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 - [`PP309`](https://learn.scientific-python.org/development/guides/pytest#PP309): Filter warnings specified ### GitHub Actions + - [`GH100`](https://learn.scientific-python.org/development/guides/gha-basic#GH100): Has GitHub Actions config - [`GH101`](https://learn.scientific-python.org/development/guides/gha-basic#GH101): Has nice names - [`GH102`](https://learn.scientific-python.org/development/guides/gha-basic#GH102): Auto-cancel on repeated PRs @@ -350,6 +355,7 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 - [`GH212`](https://learn.scientific-python.org/development/guides/gha-basic#GH212): Require GHA update grouping ### MyPy + - [`MY100`](https://learn.scientific-python.org/development/guides/style#MY100): Uses MyPy (pyproject config) - [`MY101`](https://learn.scientific-python.org/development/guides/style#MY101): MyPy strict mode - `MY102`: MyPy show_error_codes deprecated @@ -359,6 +365,9 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 - [`MY106`](https://learn.scientific-python.org/development/guides/style#MY106): MyPy enables truthy-bool ### Nox + +Will not show up if no `noxfile.py` file is present. + - [`NOX101`](https://learn.scientific-python.org/development/guides/tasks#NOX101): Sets minimum nox version - [`NOX102`](https://learn.scientific-python.org/development/guides/tasks#NOX102): Sets venv backend - [`NOX103`](https://learn.scientific-python.org/development/guides/tasks#NOX103): Set default per session instead of session list @@ -367,6 +376,9 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 - [`NOX203`](https://learn.scientific-python.org/development/guides/tasks#NOX203): Provide a main block to run nox ### Pre-commit + +Will not show up if using lefthook instead of pre-commit/prek. + - [`PC100`](https://learn.scientific-python.org/development/guides/style#PC100): Has pre-commit-hooks - [`PC110`](https://learn.scientific-python.org/development/guides/style#PC110): Uses black or ruff-format - [`PC111`](https://learn.scientific-python.org/development/guides/style#PC111): Uses blacken-docs @@ -382,6 +394,9 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 - [`PC903`](https://learn.scientific-python.org/development/guides/style#PC903): Specified pre-commit CI schedule ### ReadTheDocs + +Will not show up if no `.readthedocs.yml` file is present. + - [`RTD100`](https://learn.scientific-python.org/development/guides/docs#RTD100): Uses ReadTheDocs (pyproject config) - [`RTD101`](https://learn.scientific-python.org/development/guides/docs#RTD101): You have to set the RTD version number to 2 - [`RTD102`](https://learn.scientific-python.org/development/guides/docs#RTD102): You have to set the RTD build image @@ -389,6 +404,7 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 - [`RTD104`](https://learn.scientific-python.org/development/guides/docs#RTD104): You have to specify a build configuration now for readthedocs. ### Ruff + - [`RF001`](https://learn.scientific-python.org/development/guides/style#RF001): Has Ruff config - [`RF002`](https://learn.scientific-python.org/development/guides/style#RF002): Target version must be set - [`RF003`](https://learn.scientific-python.org/development/guides/style#RF003): src directory doesn't need to be specified anymore (0.6+) @@ -399,6 +415,9 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1 - `RF202`: Use (new) lint config section ### Setuptools Config + +Will not show up if no `setup.cfg` file is present. + - [`SCFG001`](https://learn.scientific-python.org/development/guides/packaging-classic#SCFG001): Avoid deprecated setup.cfg names diff --git a/src/sp_repo_review/families.py b/src/sp_repo_review/families.py index b685dadf..42ba295a 100644 --- a/src/sp_repo_review/families.py +++ b/src/sp_repo_review/families.py @@ -21,6 +21,7 @@ class Family(typing.TypedDict, total=False): name: str # defaults to key order: int # defaults to 0 description: str # Defaults to empty + readme_note: str # Not used repo-review def general_description( @@ -113,6 +114,7 @@ def get_families( ), "pre-commit": Family( name="Pre-commit", + readme_note="Will not show up if using lefthook instead of pre-commit/prek.", ), "mypy": Family( name="MyPy", @@ -123,11 +125,14 @@ def get_families( ), "rtd": Family( name="ReadTheDocs", + readme_note="Will not show up if no `.readthedocs.yml` file is present.", ), "setupcfg": Family( name="Setuptools Config", + readme_note="Will not show up if no `setup.cfg` file is present.", ), "noxfile": Family( name="Nox", + readme_note="Will not show up if no `noxfile.py` file is present.", ), } From e716e695bd505fecc6359bbada05f7d372a9d65d Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 21 Nov 2025 21:18:54 -0500 Subject: [PATCH 3/3] Apply suggestions from code review --- README.md | 2 +- src/sp_repo_review/families.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 89554c33..9b55f2e0 100644 --- a/README.md +++ b/README.md @@ -395,7 +395,7 @@ Will not show up if using lefthook instead of pre-commit/prek. ### ReadTheDocs -Will not show up if no `.readthedocs.yml` file is present. +Will not show up if no `.readthedocs.yml`/`.readthedocs.yaml` file is present. - [`RTD100`](https://learn.scientific-python.org/development/guides/docs#RTD100): Uses ReadTheDocs (pyproject config) - [`RTD101`](https://learn.scientific-python.org/development/guides/docs#RTD101): You have to set the RTD version number to 2 diff --git a/src/sp_repo_review/families.py b/src/sp_repo_review/families.py index 42ba295a..e64898f3 100644 --- a/src/sp_repo_review/families.py +++ b/src/sp_repo_review/families.py @@ -125,7 +125,7 @@ def get_families( ), "rtd": Family( name="ReadTheDocs", - readme_note="Will not show up if no `.readthedocs.yml` file is present.", + readme_note="Will not show up if no `.readthedocs.yml`/`.readthedocs.yaml` file is present.", ), "setupcfg": Family( name="Setuptools Config",