Skip to content

Commit d49e143

Browse files
committed
fix: scope toml→ini to docs, pin schema-store, add docs CI
- Revert the toml→ini fence change in src/sp_repo_review/checks/*.py; those docstrings render in repo-review itself, so the docs-only highlighter workaround (code_fence cog helper) should not leak into the published package. - Restore validate-pyproject-schema-store pin to 2026.04.03 in the repo_review anywidget deps (was unintentionally downgraded). - Add a PR-time MyST build check (reusable-docs.yml) wired into CI via change detection on docs/helpers/package.json/bun.lock/.readthedocs.yaml. - Clarify in AGENTS.md that the ini-for-toml workaround is docs-only. Assisted-by: ClaudeCode:claude-opus-4.8
1 parent 351f42f commit d49e143

9 files changed

Lines changed: 85 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@ jobs:
2525
if: fromJSON(needs.change-detection.outputs.run-rr)
2626
uses: ./.github/workflows/reusable-rr-tests.yml
2727

28+
docs:
29+
needs: change-detection
30+
if: fromJSON(needs.change-detection.outputs.run-docs)
31+
uses: ./.github/workflows/reusable-docs.yml
32+
2833
pass:
2934
if: always()
3035
needs:
3136
- change-detection
3237
- cookie
3338
- rr-tests
39+
- docs
3440
runs-on: ubuntu-latest
3541

3642
steps:
@@ -50,5 +56,11 @@ jobs:
5056
|| '
5157
rr-tests,
5258
'
59+
}} ${{
60+
fromJSON(needs.change-detection.outputs.run-docs)
61+
&& ''
62+
|| '
63+
docs,
64+
'
5365
}}
5466
jobs: ${{ toJSON(needs) }}

.github/workflows/reusable-change-detection.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
run-rr:
99
description: Whether or not run the repo-review tests
1010
value: ${{ jobs.change-detection.outputs.run-rr || false }}
11+
run-docs:
12+
description: Whether or not to build the docs site
13+
value: ${{ jobs.change-detection.outputs.run-docs || false }}
1114

1215
jobs:
1316
change-detection:
@@ -17,6 +20,7 @@ jobs:
1720
outputs:
1821
run-cookie: ${{ steps.cookie-changes.outputs.run-cookie || false }}
1922
run-rr: ${{ steps.rr-changes.outputs.run-rr || false }}
23+
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
2024
steps:
2125
- uses: actions/checkout@v6
2226

@@ -63,3 +67,24 @@ jobs:
6367
steps.changed-rr-files.outputs.added_modified_renamed != '[]'
6468
id: rr-changes
6569
run: echo "run-rr=true" >> "${GITHUB_OUTPUT}"
70+
71+
- name: Changed docs-related files
72+
if: github.event_name == 'pull_request'
73+
id: changed-docs-files
74+
uses: Ana06/get-changed-files@v2.3.0
75+
with:
76+
format: "json"
77+
filter: |
78+
.github/workflows/ci.yml
79+
.github/workflows/reusable-docs.yml
80+
docs/**
81+
helpers/**
82+
package.json
83+
bun.lock
84+
.readthedocs.yaml
85+
- name: Set a flag for building the docs
86+
if: >-
87+
github.event_name != 'pull_request' ||
88+
steps.changed-docs-files.outputs.added_modified_renamed != '[]'
89+
id: docs-changes
90+
run: echo "run-docs=true" >> "${GITHUB_OUTPUT}"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Docs
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
name: Build MyST site
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 10
11+
steps:
12+
- uses: actions/checkout@v6
13+
14+
- uses: oven-sh/setup-bun@v2
15+
16+
- name: Install dependencies
17+
run: bun install --frozen-lockfile
18+
19+
- name: Build the docs
20+
run: bun run build
21+
22+
- name: Upload built site
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: docs-html
26+
path: docs/_build/html

AGENTS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,8 @@ The noxfile generates temporary projects for **all 9 backends** × **vcs on/off*
8585
- Tab-sets use `:sync: <tab-name>` for cross-page tab synchronization, where the
8686
sync key is the tab label itself (e.g., `sphinx`, `mkdocs`,
8787
`trusted-publishing`, `scikit-build-core`).
88-
- TOML code blocks use "ini" to get syntax highlighting for now.
88+
- TOML code blocks in the docs use "ini" to get syntax highlighting for now.
89+
This is applied only at the docs layer (the `code_fence` cog helper in
90+
`helpers/cog_helpers.py` rewrites `toml``ini`); do **not** change the `toml`
91+
fences in the `src/sp_repo_review/checks/*.py` docstrings, which are rendered
92+
by repo-review itself, not this site.

docs/pages/guides/repo_review.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pipx run 'sp-repo-review[cli]' <path to repo>
2929
"repo-review~=1.1.0",
3030
"sp-repo-review==2026.04.04",
3131
"validate-pyproject[all]~=0.25.0",
32-
"validate-pyproject-schema-store==2026.03.29",
32+
"validate-pyproject-schema-store==2026.04.03",
3333
]
3434
}
3535
:::

src/sp_repo_review/checks/mypy.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def check(pyproject: dict[str, Any]) -> bool:
4545
your settings already, ignore this check or set `strict = false`
4646
explicitly.
4747
48-
```ini
48+
```toml
4949
[tool.mypy]
5050
strict = true
5151
```
@@ -91,7 +91,7 @@ def check(pyproject: dict[str, Any]) -> bool:
9191
static checks), so it's okay to set it to false if you need to. But try
9292
it first - it can catch real bugs too.
9393
94-
```ini
94+
```toml
9595
[tool.mypy]
9696
warn_unreachable = true
9797
```
@@ -117,7 +117,7 @@ def check(pyproject: dict[str, Any]) -> bool:
117117
will force all skips in your project to include the error code, which
118118
makes them more readable, and avoids skipping something unintended.
119119
120-
```ini
120+
```toml
121121
[tool.mypy]
122122
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
123123
```
@@ -142,7 +142,7 @@ def check(pyproject: dict[str, Any]) -> bool:
142142
Must have `"redundant-expr"` in `enable_error_code = [...]`. This helps
143143
catch useless lines of code, like checking the same condition twice.
144144
145-
```ini
145+
```toml
146146
[tool.mypy]
147147
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
148148
```
@@ -167,7 +167,7 @@ def check(pyproject: dict[str, Any]) -> bool:
167167
Must have `"truthy-bool"` in `enable_error_code = []`. This catches
168168
mistakes in using a value as truthy if it cannot be falsy.
169169
170-
```ini
170+
```toml
171171
[tool.mypy]
172172
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
173173
```

src/sp_repo_review/checks/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def check(noxfile: Noxfile | None) -> bool | None:
179179
"""
180180
You should have a script block with nox in it, for example:
181181
182-
```ini
182+
```toml
183183
# /// script
184184
# dependencies = ["nox"]
185185
# ///

src/sp_repo_review/checks/pyproject.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def check(pyproject: dict[str, Any]) -> bool:
170170
These are better than the old `extras` system for tests, docs, and other
171171
dependencies that are not needed for PyPI installs.
172172
173-
```ini
173+
```toml
174174
[dependency-groups]
175175
dev = [ {{ include-group = "test" }} ]
176176
test = [ "pytest" ]
@@ -215,7 +215,7 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
215215
support `pyproject.toml` ini configuration) or 9 (first version to
216216
support native configuration and toml config files).
217217
218-
```ini
218+
```toml
219219
# Old pytest
220220
[tool.pytest.ini_options]
221221
minversion = "6"
@@ -244,7 +244,7 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
244244
"""
245245
The `testpaths` setting should be set to a reasonable default.
246246
247-
```ini
247+
```toml
248248
# Old pytest
249249
[tool.pytest.ini_options]
250250
testpaths = ["tests"]
@@ -270,7 +270,7 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
270270
`log_level` should be set. This will allow logs to be displayed on
271271
failures.
272272
273-
```ini
273+
```toml
274274
# Old pytest
275275
[tool.pytest.ini_options]
276276
log_level = "INFO"
@@ -297,7 +297,7 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
297297
be set. You can manually specify if a check should be strict when
298298
setting each xfail.
299299
300-
```ini
300+
```toml
301301
[tool.pytest.ini_options]
302302
xfail_strict = true
303303
@@ -326,7 +326,7 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
326326
`strict_config` or `strict` should be set. This forces an error if a
327327
config setting is misspelled.
328328
329-
```ini
329+
```toml
330330
# Old pytest
331331
[tool.pytest.ini_options]
332332
addopts = ["-ra", "--strict-config", "--strict-markers"]
@@ -357,7 +357,7 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
357357
`strict_markers` or `strict` should be set. This forces test markers to
358358
be specified in config, avoiding misspellings.
359359
360-
```ini
360+
```toml
361361
# Old pytest
362362
[tool.pytest.ini_options]
363363
addopts = ["-ra", "--strict-config", "--strict-markers"]
@@ -387,7 +387,7 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
387387
An explicit summary flag like `-ra` should be in `addopts = [...]`
388388
(print summary of all fails/errors).
389389
390-
```ini
390+
```toml
391391
# Old pytest
392392
[tool.pytest.ini_options]
393393
addopts = ["-ra", "--strict-config", "--strict-markers"]
@@ -416,7 +416,7 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
416416
`filterwarnings` must be set (probably to at least `["error"]`). Python
417417
will hide important warnings otherwise, like deprecations.
418418
419-
```ini
419+
```toml
420420
# Old pytest
421421
[tool.pytest.ini_options]
422422
filterwarnings = ["error"]

src/sp_repo_review/checks/ruff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def check(cls: type[RF1xxMixin], ruff: dict[str, Any]) -> bool:
139139
"""
140140
Must select the {self.name} `{self.code}` checks. Recommended:
141141
142-
```ini
142+
```toml
143143
[tool.ruff.lint]
144144
extend-select = [
145145
"{self.code}", # {self.name}

0 commit comments

Comments
 (0)