Skip to content

Commit 82d474d

Browse files
committed
chore: move to rumdl instead of prettier
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
1 parent f4d8811 commit 82d474d

37 files changed

Lines changed: 463 additions & 445 deletions

.pre-commit-config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ repos:
3232
rev: "v0.15.14"
3333
hooks:
3434
- id: ruff-check
35-
args: ["--fix", "--show-fixes"]
35+
args: ["--fix"]
3636
- id: ruff-format
3737

3838
- repo: https://github.com/pre-commit/pygrep-hooks
@@ -63,8 +63,13 @@ repos:
6363
rev: "v3.8.3"
6464
hooks:
6565
- id: prettier
66-
types_or: [yaml, markdown, html, css, scss, javascript, json]
67-
args: [--prose-wrap=always]
66+
types_or: [yaml, html, css, scss, javascript, json]
67+
68+
- repo: https://github.com/rvben/rumdl-pre-commit
69+
rev: v0.2.0
70+
hooks:
71+
- id: rumdl
72+
args: [--no-exclude] # Disable all exclude patterns
6873

6974
- repo: https://github.com/crate-ci/typos
7075
rev: "v1.46.3"

AGENTS.md

Lines changed: 46 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Agent Guide for scientific-python/cookie
22

3-
This repo has three distinct concerns: a **cookiecutter/copier template** for new Python projects (`{{cookiecutter.project_name}}/`), a **repo-review plugin** (`src/sp_repo_review/`), and a **Jekyll-based developer guide** (`docs/`).
3+
This repo has three distinct concerns: a **cookiecutter/copier template** for
4+
new Python projects (`{{cookiecutter.project_name}}/`), a **repo-review plugin**
5+
(`src/sp_repo_review/`), and a **Jekyll-based developer guide** (`docs/`).
46

57
## Key commands
68

@@ -17,46 +19,69 @@ Important: tests run with `PYTHONWARNDEFAULTENCODING=1`.
1719

1820
### Cookie template validation
1921

20-
The noxfile generates temporary projects for **all 9 backends** × **vcs on/off** × **3 docs engines** (sphinx/mkdocs/zensical). These are slow.
22+
The noxfile generates temporary projects for **all 9 backends** × **vcs on/off**
23+
× **3 docs engines** (sphinx/mkdocs/zensical). These are slow.
2124

2225
- `nox -s "tests(hatch)"` — run generated project tests for a single backend
2326
- `nox -s "lint(hatch)"` — run pre-commit (`prek`) on generated project
2427
- `nox -s "dist(hatch)"` — verify build output includes LICENSE
2528
- `nox -s "native(hatch)"` — test hatch/pdm/poetry native test runners
26-
- `nox -s compare_copier` — verify cookiecutter and copier produce identical files
29+
- `nox -s compare_copier` — verify cookiecutter and copier produce identical
30+
files
2731
- `nox -s compare_cruft` — verify cookiecutter and cruft produce identical files
2832
- `nox -s gha_bump` — bump GitHub Actions versions across docs and templates
2933
- `nox -s pc_bump` — bump pre-commit hook versions across docs and templates
3034

3135
## Architecture notes
3236

33-
- **Template directory**: `{{cookiecutter.project_name}}/` contains the cookiecuttter template. Copier reads `copier.yml`; cookiecutter reads `cookiecutter.json`. Keep them in sync; `compare_copier` checks this.
34-
- **Entry points**: `sp_repo_review` registers `repo-review` checks/families/fixtures via `[project.entry-points]` in `pyproject.toml`.
35-
- **Generated docs**: The README check list (line ~300+) is a cog block. Do not edit it by hand; run `nox -s readme` or cog will fail in CI.
36-
- **Cookie template `.pre-commit-config.yaml`** uses `prek` (a Rust-based pre-commit alternative), not `pre-commit`.
37-
- **Ruff hook ID**: `.pre-commit-config.yaml` uses `ruff-check` as the hook id (not `ruff`), for pre-commit 4.x compatibility.
37+
- **Template directory**: `{{cookiecutter.project_name}}/` contains the
38+
cookiecuttter template. Copier reads `copier.yml`; cookiecutter reads
39+
`cookiecutter.json`. Keep them in sync; `compare_copier` checks this.
40+
- **Entry points**: `sp_repo_review` registers `repo-review`
41+
checks/families/fixtures via `[project.entry-points]` in `pyproject.toml`.
42+
- **Generated docs**: The README check list (line ~300+) is a cog block. Do not
43+
edit it by hand; run `nox -s readme` or cog will fail in CI.
44+
- **Cookie template `.pre-commit-config.yaml`** uses `prek` (a Rust-based
45+
pre-commit alternative), not `pre-commit`.
46+
- **Ruff hook ID**: `.pre-commit-config.yaml` uses `ruff-check` as the hook id
47+
(not `ruff`), for pre-commit 4.x compatibility.
3848

3949
## Style and conventions
4050

41-
- `tool.pytest.ini_options.norecursedirs` excludes `{{cookiecutter.project_name}}` so pytest does not descend into the template directory.
42-
- `tool.ruff.extend-exclude` also excludes `\{\{cookiecutter.project_name\}\}` (double-escaped in TOML).
43-
- `tool.mypy.python_version = "3.10"`; the `sp_repo_review.*` override enforces `disallow_untyped_defs=True`.
44-
- `tool.pylint.master.ignore-paths` ignores `src/sp_repo_review/_version.py` (auto-generated by hatch-vcs).
45-
- Ruff selects `ALL` with many ignores; notable: `S101` (assert) and `D` (docstrings) are globally disabled.
51+
- `tool.pytest.ini_options.norecursedirs` excludes
52+
`{{cookiecutter.project_name}}` so pytest does not descend into the template
53+
directory.
54+
- `tool.ruff.extend-exclude` also excludes `\{\{cookiecutter.project_name\}\}`
55+
(double-escaped in TOML).
56+
- `tool.mypy.python_version = "3.10"`; the `sp_repo_review.*` override enforces
57+
`disallow_untyped_defs=True`.
58+
- `tool.pylint.master.ignore-paths` ignores `src/sp_repo_review/_version.py`
59+
(auto-generated by hatch-vcs).
60+
- Ruff selects `ALL` with many ignores; notable: `S101` (assert) and `D`
61+
(docstrings) are globally disabled.
4662

4763
## CI quirks
4864

49-
- CI uses change detection to decide whether to run cookie tests or rr-tests. Both are required to pass for the `pass` job.
65+
- CI uses change detection to decide whether to run cookie tests or rr-tests.
66+
Both are required to pass for the `pass` job.
5067
- rr-tests matrix runs on Python 3.10, 3.12, 3.14 across ubuntu/macos/windows.
5168
- Cookie tests reuse the same `reusable-cookie.yml` workflow.
5269

5370
## Docs site (MyST)
5471

55-
- Migrated from Jekyll to [MyST](https://mystmd.org) (JupyterBook 2.0) using the `scientific-python-myst-theme`.
56-
- Node/Bun-based; from `docs/`, run `bun install` then `bun run build` to build the site.
57-
- Config: `docs/myst.yml` (TOC, project settings), `docs/config/scientific-python.yml` (theme options).
58-
- Custom plugin: `docs/rr-role.mjs` — provides `{rr}` inline role for repo-review badge spans.
72+
- Migrated from Jekyll to [MyST](https://mystmd.org) (JupyterBook 2.0) using the
73+
`scientific-python-myst-theme`.
74+
- Node/Bun-based; from `docs/`, run `bun install` then `bun run build` to build
75+
the site.
76+
- Config: `docs/myst.yml` (TOC, project settings),
77+
`docs/config/scientific-python.yml` (theme options).
78+
- Custom plugin: `docs/rr-role.mjs` — provides `{rr}` inline role for
79+
repo-review badge spans.
5980
- Custom CSS: `docs/assets/css/site.css` — only `.rr-btn` badge styling remains.
60-
- Docs pages in `docs/pages/` contain cog blocks that auto-generate config examples from the template.
61-
- The repo-review interactive page uses an `{iframe}` pointing to the WASM app at `https://scientific-python.github.io/repo-review/`.
62-
- Tab-sets use `:sync: <tab-name>` for cross-page tab synchronization, where the sync key is the tab label itself (e.g., `sphinx`, `mkdocs`, `trusted-publishing`, `scikit-build-core`).
81+
- Docs pages in `docs/pages/` contain cog blocks that auto-generate config
82+
examples from the template.
83+
- The repo-review interactive page uses an `{iframe}` pointing to the WASM app
84+
at `https://scientific-python.github.io/repo-review/`.
85+
- Tab-sets use `:sync: <tab-name>` for cross-page tab synchronization, where the
86+
sync key is the tab label itself (e.g., `sphinx`, `mkdocs`,
87+
`trusted-publishing`, `scikit-build-core`).

README.md

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -42,38 +42,38 @@ hand, from `{{cookiecutter.project_name}}/`).
4242

4343
During generation you can select from the following backends for your package:
4444

45-
1. [hatch][]: This uses hatchling, a modern builder with nice file inclusion,
46-
extendable via plugins, and good error messages. **(Recommended for pure
47-
Python projects)**
48-
2. [uv][]: The `uv_build` backend is written in Rust and is integrated into'
49-
`uv`, meaning it can build without downloading anything extra and can even
50-
avoid running Python at all when building, making it the fastest backend for
51-
simple packages. No dynamic metadata support.
52-
3. [flit][]: A modern, lightweight [PEP 621][] build system for pure Python
53-
projects. Replaces setuptools, no MANIFEST.in, setup.py, or setup.cfg. Low
54-
learning curve. Easy to bootstrap into new distributions. Difficult to get
55-
the right files included, little dynamic metadata support.
56-
4. [pdm][]: A modern, less opinionated all-in-one solution to pure Python
57-
projects supporting standards. Replaces setuptools, venv/pipenv, pip, wheel,
58-
and twine. Supports [PEP 621][].
59-
5. [poetry][]: An all-in-one solution to pure Python projects. Replaces
60-
setuptools, venv/pipenv, pip, wheel, and twine. Higher learning curve, but
61-
is all-in-one. Makes some bad default assumptions for libraries.
62-
6. [setuptools][]: The classic build system, but with the new standardized
63-
configuration.
64-
7. [pybind11][]: This is setuptools but with an C++ extension written in
65-
[pybind11][] and wheels generated by [cibuildwheel][].
66-
8. [scikit-build][]: A scikit-build (CMake) project also using pybind11, using
67-
scikit-build-core. **(Recommended for C++ projects)**
68-
9. [meson-python][]: A Meson project also using pybind11. (No VCS versioning)
45+
1. [hatch][]: This uses hatchling, a modern builder with nice file inclusion,
46+
extendable via plugins, and good error messages. **(Recommended for pure
47+
Python projects)**
48+
2. [uv][]: The `uv_build` backend is written in Rust and is integrated into'
49+
`uv`, meaning it can build without downloading anything extra and can even
50+
avoid running Python at all when building, making it the fastest backend for
51+
simple packages. No dynamic metadata support.
52+
3. [flit][]: A modern, lightweight [PEP 621][] build system for pure Python
53+
projects. Replaces setuptools, no MANIFEST.in, setup.py, or setup.cfg. Low
54+
learning curve. Easy to bootstrap into new distributions. Difficult to get
55+
the right files included, little dynamic metadata support.
56+
4. [pdm][]: A modern, less opinionated all-in-one solution to pure Python
57+
projects supporting standards. Replaces setuptools, venv/pipenv, pip, wheel,
58+
and twine. Supports [PEP 621][].
59+
5. [poetry][]: An all-in-one solution to pure Python projects. Replaces
60+
setuptools, venv/pipenv, pip, wheel, and twine. Higher learning curve, but
61+
is all-in-one. Makes some bad default assumptions for libraries.
62+
6. [setuptools][]: The classic build system, but with the new standardized
63+
configuration.
64+
7. [pybind11][]: This is setuptools but with an C++ extension written in
65+
[pybind11][] and wheels generated by [cibuildwheel][].
66+
8. [scikit-build][]: A scikit-build (CMake) project also using pybind11, using
67+
scikit-build-core. **(Recommended for C++ projects)**
68+
9. [meson-python][]: A Meson project also using pybind11. (No VCS versioning)
6969
10. [maturin][]: A [PEP 621][] builder for Rust binary extensions. (No VCS
7070
versioning) **(Recommended for Rust projects)**
7171

7272
Currently, the best choice is probably hatch for pure Python projects, and
7373
scikit-build (such as the scikit-build-core + pybind11 choice) for binary
7474
projects.
7575

76-
#### To use (copier version)
76+
### To use (copier version)
7777

7878
Install `copier` and `copier-templates-extensions`. Using [uv][], that's:
7979

@@ -132,7 +132,7 @@ There are a few example dependencies and a minimum Python version of 3.10, feel
132132
free to change it to whatever you actually need/want. There is also a basic
133133
backports structure with a small typing example.
134134

135-
#### Contained components:
135+
#### Contained components
136136

137137
- GitHub Actions runs testing for the generation itself
138138
- Uses nox so cookie development can be checked locally
@@ -160,7 +160,7 @@ backports structure with a small typing example.
160160
- A README
161161
- Code coverage reporting with automatic uploads to Codecov after tests run
162162

163-
#### For developers:
163+
#### For developers
164164

165165
You can test locally with [nox][]:
166166

@@ -196,8 +196,6 @@ A lot of the guide, cookiecutter, and repo-review started out as part of
196196
[Scikit-HEP][]. These projects were merged, generalized, and combined with the
197197
[NSLS-II][] guide during the 2023 Scientific-Python Developers Summit.
198198

199-
<!-- prettier-ignore-start -->
200-
201199
[actions-badge]: https://github.com/scientific-python/cookie/actions/workflows/ci.yml/badge.svg
202200
[actions-link]: https://github.com/scientific-python/cookie/actions
203201
[cibuildwheel]: https://cibuildwheel.readthedocs.io
@@ -227,8 +225,6 @@ A lot of the guide, cookiecutter, and repo-review started out as part of
227225
[setuptools]: https://setuptools.readthedocs.io
228226
[uv]: https://docs.astral.sh/uv
229227

230-
<!-- prettier-ignore-end -->
231-
232228
---
233229

234230
## sp-repo-review
@@ -302,7 +298,7 @@ CLI requirements are included.
302298

303299
## List of checks
304300

305-
<!-- prettier-ignore-start -->
301+
<!-- rumdl-disable MD013 -->
306302

307303
<!-- [[[cog
308304
import itertools
@@ -440,4 +436,4 @@ Will not show up if no `setup.cfg` file is present.
440436
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/sp-repo-review
441437
[conda-link]: https://github.com/conda-forge/sp-repo-review-feedstock
442438

443-
<!-- prettier-ignore-end -->
439+
<!-- rumdl-enable MD013 -->

action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ runs:
2626
python-version: "3.13"
2727
update-environment: false
2828

29-
# prettier-ignore
3029
- name: Run repo-review
3130
shell: bash
3231
run: >

docs/_partials/pyproject.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## pyproject.toml: project table
1+
# pyproject.toml: project table
22

33
<!-- [[[cog
44
from cog_helpers import code_fence, render_cookie, TOMLMatcher
@@ -13,7 +13,7 @@ The metadata is specified in a [standards-based][metadata] format:
1313
with code_fence("toml"):
1414
print(pyproject.get_source("project"))
1515
]]] -->
16-
<!-- prettier-ignore-start -->
16+
<!-- rumdl-disable MD013 -->
1717
```toml
1818
[project]
1919
name = "package"
@@ -50,7 +50,7 @@ Homepage = "https://github.com/org/package"
5050
Discussions = "https://github.com/org/package/discussions"
5151
Changelog = "https://github.com/org/package/releases"
5252
```
53-
<!-- prettier-ignore-end -->
53+
<!-- rumdl-enable MD013 -->
5454
<!-- [[[end]]] -->
5555

5656
In this example, `"package"` is the name of the thing you are working on. You
@@ -64,7 +64,7 @@ special, and replaces the old url setting.
6464
If you use the above configuration, you need `README.md` and `LICENSE` files,
6565
since they are explicitly specified.
6666

67-
### License
67+
## License
6868

6969
The license can be done one of two ways.
7070

@@ -145,7 +145,7 @@ example:
145145
with code_fence("toml"):
146146
print(pyproject.get_source("dependency-groups"))
147147
]]] -->
148-
<!-- prettier-ignore-start -->
148+
<!-- rumdl-disable MD013 -->
149149
```toml
150150
[dependency-groups]
151151
test = [
@@ -163,7 +163,7 @@ docs = [
163163
"furo>=2023.08.17",
164164
]
165165
```
166-
<!-- prettier-ignore-end -->
166+
<!-- rumdl-enable MD013 -->
167167
<!-- [[[end]]] -->
168168

169169
You can include one dependency group in another. Most tools allow you to install

0 commit comments

Comments
 (0)