Skip to content

Commit b2183af

Browse files
committed
Document fork requirement and fold in spell check section
- Adds "Push from a fork, not to upstream" as PR rule aio-libs#3, with the commands and a note on the `GH013` error you get for trying to push a feature branch to `aio-libs/multidict`. - Folds in the docs spell check section from aio-libs#1344 as PR rule aio-libs#7, so `make doc-spelling` is documented as the pre-push gate; adds `codecov` to `docs/spelling_wordlist.txt` for the new fragment. - Renumbers PR rules 3-6 to 4-8, and extends the news fragments to cover all three additions.
1 parent ddbd2f5 commit b2183af

4 files changed

Lines changed: 66 additions & 6 deletions

File tree

AGENTS.md

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,29 @@ Pick the number for the fragment filename as follows:
177177
ln -s 1284.bugfix.rst CHANGES/1340.bugfix.rst
178178
```
179179

180-
### 3. Open the PR as a draft, and leave it that way
180+
### 3. Push from a fork, not to upstream
181+
182+
Branch creation on `aio-libs/multidict` is restricted; you
183+
**cannot** push a feature branch directly to upstream, and
184+
trying gets you a `GH013: Cannot create ref due to creations
185+
being restricted` error from the remote. All PRs must come
186+
from a fork. The standard setup is:
187+
188+
```bash
189+
# one-time: add your fork as a remote alongside `origin`
190+
git remote add <your-handle> https://github.com/<your-handle>/multidict
191+
192+
# per-PR: push the branch to your fork, then open the PR
193+
git push -u <your-handle> <branch-name>
194+
gh pr create --draft --repo aio-libs/multidict
195+
```
196+
197+
`gh pr create` against `aio-libs/multidict` from a fork branch
198+
will pick up the right base and head automatically. Do not try
199+
to work around the restriction with `--force` or by retargeting
200+
`origin`; the rule is intentional.
201+
202+
### 4. Open the PR as a draft, and leave it that way
181203

182204
Use `gh pr create --draft`. **Every LLM-authored submission
183205
must be fully reviewed by a human before it is marked ready
@@ -192,7 +214,7 @@ not request reviewers from the agent session; the human who
192214
reviewed the change and flipped it out of draft is the one who
193215
routes it.
194216

195-
### 4. Disclose the agent, do not advertise it
217+
### 5. Disclose the agent, do not advertise it
196218

197219
Disclosure is required, advertising is not welcome. Put one
198220
plain line at the bottom of the PR body naming the agent that
@@ -244,14 +266,37 @@ That single line is enough. Beyond that:
244266
takeaways") on top of the template. The template already has
245267
the right sections.
246268

247-
### 5. Keep the PR body short
269+
### 6. Keep the PR body short
248270

249271
A couple of sentences per template section is plenty. If the change
250272
is non-obvious, a short reproducer or a paragraph on root cause is
251273
welcome. Long, multi-section essays with bolded sub-headings are not
252274
the style here.
253275

254-
### 6. Commit hygiene
276+
### 7. Run the docs spell check before pushing
277+
278+
CI builds the docs with `sphinxcontrib.spelling` and treats any
279+
unknown word as a hard failure. The spell checker reads every
280+
`CHANGES/*.rst` fragment as part of the build, so a technical word
281+
in your news fragment (`unparseable`, `parametrization`, `repr`,
282+
and so on) that is not in
283+
[`docs/spelling_wordlist.txt`](docs/spelling_wordlist.txt)
284+
will fail `make doc-spelling` and burn a CI run before a human
285+
even sees the PR.
286+
287+
Before pushing:
288+
289+
```bash
290+
make doc-spelling
291+
```
292+
293+
If it flags a word you actually meant to use, add it to
294+
`docs/spelling_wordlist.txt` (one word per line, roughly
295+
alphabetical) in the same commit as the fragment. If it flags
296+
a typo, fix the typo. Do not paper over real misspellings by
297+
adding them to the wordlist.
298+
299+
### 8. Commit hygiene
255300

256301
- One logical change per PR. If a refactor and a bugfix are bundled
257302
together, split them.
@@ -383,6 +428,14 @@ Design tests so every line runs:
383428
environment.
384429
- Do not invent a `## What / ## Why / ## How / ## Testing` PR
385430
body; use the aio-libs template above.
431+
- Do not try to push a feature branch to `aio-libs/multidict`;
432+
upstream rejects branch creation. Push to your fork and open
433+
the PR cross-repo. See _Push from a fork, not to upstream_
434+
above.
435+
- Do not push without running `make doc-spelling` first if you
436+
edited any `.rst` file (including `CHANGES/`). The docs build
437+
fails on unknown words and burns a CI run; see _Run the docs
438+
spell check before pushing_ above.
386439
- Do not skip the `CHANGES/` fragment "because the change is
387440
small". Even a one-line bugfix needs one.
388441
- Do not add `Co-Authored-By` trailers for LLM tools, in either

CHANGES/1343.contrib.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Documented the docs spell check in ``AGENTS.md`` so LLM
2+
contributors run ``make doc-spelling`` before pushing rather than
3+
burning a CI run on a missing dictionary entry
4+
-- by :user:`bdraco`.

CHANGES/1345.contrib.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Documented in :file:`AGENTS.md` that coverage is collected over
2-
the test tree as well as ``multidict/``, so unreachable
2+
the test tree as well as ``multidict/`` (so unreachable
33
defensive ``raise`` guards and one-sided cleanup branches in
4-
tests will surface as uncovered on the codecov patch report
4+
tests will surface as uncovered on the codecov patch report),
5+
and that branch creation is restricted on ``aio-libs/multidict``
6+
so all PRs must be pushed from a fork
57
-- by :user:`bdraco`.

docs/spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ changelog
2020
charset
2121
charsetdetect
2222
cibuildwheel
23+
codecov
2324
CPython
2425
criterias
2526
css

0 commit comments

Comments
 (0)