Skip to content

Commit 99a44a0

Browse files
committed
fix: note when checks might be hidden
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 7425778 commit 99a44a0

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ from repo_review.families import get_family_name
305305
collected = collect_all()
306306
print()
307307
for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1].family):
308-
print(f'### {get_family_name(collected.families, family)}')
308+
print(f'### {get_family_name(collected.families, family)}\n')
309+
if note := collected.families.get(family, {}).get("readme_note"):
310+
print(note, end="\n\n")
309311
for code, check in grp:
310312
url = get_check_url(code, check)
311313
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
314316
]]] -->
315317

316318
### General
319+
317320
- [`PY001`](https://learn.scientific-python.org/development/guides/packaging-simple#PY001): Has a pyproject.toml
318321
- [`PY002`](https://learn.scientific-python.org/development/guides/packaging-simple#PY002): Has a README.(md|rst) file
319322
- [`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
323326
- [`PY007`](https://learn.scientific-python.org/development/guides/tasks#PY007): Supports an easy task runner (nox, tox, pixi, etc.)
324327

325328
### PyProject
329+
326330
- [`PP002`](https://learn.scientific-python.org/development/guides/packaging-simple#PP002): Has a proper build-system table
327331
- [`PP003`](https://learn.scientific-python.org/development/guides/packaging-classic#PP003): Does not list wheel as a build-dep
328332
- [`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
339343
- [`PP309`](https://learn.scientific-python.org/development/guides/pytest#PP309): Filter warnings specified
340344

341345
### GitHub Actions
346+
342347
- [`GH100`](https://learn.scientific-python.org/development/guides/gha-basic#GH100): Has GitHub Actions config
343348
- [`GH101`](https://learn.scientific-python.org/development/guides/gha-basic#GH101): Has nice names
344349
- [`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
350355
- [`GH212`](https://learn.scientific-python.org/development/guides/gha-basic#GH212): Require GHA update grouping
351356

352357
### MyPy
358+
353359
- [`MY100`](https://learn.scientific-python.org/development/guides/style#MY100): Uses MyPy (pyproject config)
354360
- [`MY101`](https://learn.scientific-python.org/development/guides/style#MY101): MyPy strict mode
355361
- `MY102`: MyPy show_error_codes deprecated
@@ -359,6 +365,9 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1
359365
- [`MY106`](https://learn.scientific-python.org/development/guides/style#MY106): MyPy enables truthy-bool
360366

361367
### Nox
368+
369+
Will not show up if no `noxfile.py` file is present.
370+
362371
- [`NOX101`](https://learn.scientific-python.org/development/guides/tasks#NOX101): Sets minimum nox version
363372
- [`NOX102`](https://learn.scientific-python.org/development/guides/tasks#NOX102): Sets venv backend
364373
- [`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
367376
- [`NOX203`](https://learn.scientific-python.org/development/guides/tasks#NOX203): Provide a main block to run nox
368377

369378
### Pre-commit
379+
380+
Will not show up if using lefthook instead of pre-commit/prek.
381+
370382
- [`PC100`](https://learn.scientific-python.org/development/guides/style#PC100): Has pre-commit-hooks
371383
- [`PC110`](https://learn.scientific-python.org/development/guides/style#PC110): Uses black or ruff-format
372384
- [`PC111`](https://learn.scientific-python.org/development/guides/style#PC111): Uses blacken-docs
@@ -382,13 +394,17 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1
382394
- [`PC903`](https://learn.scientific-python.org/development/guides/style#PC903): Specified pre-commit CI schedule
383395

384396
### ReadTheDocs
397+
398+
Will not show up if no `.readthedocs.yml` file is present.
399+
385400
- [`RTD100`](https://learn.scientific-python.org/development/guides/docs#RTD100): Uses ReadTheDocs (pyproject config)
386401
- [`RTD101`](https://learn.scientific-python.org/development/guides/docs#RTD101): You have to set the RTD version number to 2
387402
- [`RTD102`](https://learn.scientific-python.org/development/guides/docs#RTD102): You have to set the RTD build image
388403
- [`RTD103`](https://learn.scientific-python.org/development/guides/docs#RTD103): You have to set the RTD python version
389404
- [`RTD104`](https://learn.scientific-python.org/development/guides/docs#RTD104): You have to specify a build configuration now for readthedocs.
390405

391406
### Ruff
407+
392408
- [`RF001`](https://learn.scientific-python.org/development/guides/style#RF001): Has Ruff config
393409
- [`RF002`](https://learn.scientific-python.org/development/guides/style#RF002): Target version must be set
394410
- [`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
399415
- `RF202`: Use (new) lint config section
400416

401417
### Setuptools Config
418+
419+
Will not show up if no `setup.cfg` file is present.
420+
402421
- [`SCFG001`](https://learn.scientific-python.org/development/guides/packaging-classic#SCFG001): Avoid deprecated setup.cfg names
403422

404423
<!-- [[[end]]] -->

src/sp_repo_review/families.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class Family(typing.TypedDict, total=False):
2121
name: str # defaults to key
2222
order: int # defaults to 0
2323
description: str # Defaults to empty
24+
readme_note: str # Not used repo-review
2425

2526

2627
def general_description(
@@ -113,6 +114,7 @@ def get_families(
113114
),
114115
"pre-commit": Family(
115116
name="Pre-commit",
117+
readme_note="Will not show up if using lefthook instead of pre-commit/prek.",
116118
),
117119
"mypy": Family(
118120
name="MyPy",
@@ -123,11 +125,14 @@ def get_families(
123125
),
124126
"rtd": Family(
125127
name="ReadTheDocs",
128+
readme_note="Will not show up if no `.readthedocs.yml` file is present.",
126129
),
127130
"setupcfg": Family(
128131
name="Setuptools Config",
132+
readme_note="Will not show up if no `setup.cfg` file is present.",
129133
),
130134
"noxfile": Family(
131135
name="Nox",
136+
readme_note="Will not show up if no `noxfile.py` file is present.",
132137
),
133138
}

0 commit comments

Comments
 (0)