Make the docs check fail on an em dash in a page

Aperta Adatta ai principianti
#21 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
markdown, python

Direzione di ricerca

Inizia con check() e la docstring del modulo in scripts/check_docs.py, poi esamina make_project, run_check e test_page_missing_from_nav_fails in tests/test_check_docs.py. Aggiorna il controllo e i test per i trattini lunghi e inserisci la regola nelle sezioni specificate di CONTRIBUTING.md e CLAUDE.md. Il lavoro è concluso quando i nuovi test coprono il rifiuto e i caratteri di trattino consentiti e i controlli documentati vengono superati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

good first issue type:chore

What to change

CLAUDE.md and CONTRIBUTING.md both say: no em dashes. No check enforces that today, so a reviewer has to catch every one by eye. Add one to scripts/check_docs.py. That script already runs in CI before the build.

  1. In check() in scripts/check_docs.py, read each Markdown page under the docs directory. Report a Problem for every line that contains an em dash (the character U+2014, which you can write in Python as "\u2014"), with that line's number. Use a message such as em dash, use a comma, colon, or parentheses instead. Flag every em dash, including any in code: the rule allows none. Leave en dashes and hyphens alone.
  2. Update the module docstring at the top of the script so it lists the new problem.
  3. Add tests to tests/test_check_docs.py using the existing make_project and run_check helpers:
    • A page with an em dash fails with exit code 1. The message names the file and the right line.
    • A page with only hyphens and en dashes still passes.
  4. Add the new check to the lists of what the script fails on, in both places:
    • CONTRIBUTING.md, in the paragraph under "Preview locally" that begins "The strict build fails on".
    • CLAUDE.md, in the scripts/check_docs.py bullet under "What this repository is".

The pages have no em dashes today, so the existing test_repository_pages_pass test should keep passing.

Where to look

  • scripts/check_docs.py: the check() function and the module docstring.
  • tests/test_check_docs.py: make_project, run_check, and test_page_missing_from_nav_fails as a model.
  • CONTRIBUTING.md, heading "Preview locally".
  • CLAUDE.md, heading "What this repository is".

How to test

From CONTRIBUTING.md:

uv sync
uv run pytest
uv run python scripts/check_docs.py
uv run zensical build --strict

Then try it by hand. Add an em dash to any page in docs/, run uv run python scripts/check_docs.py, and check that it prints that page and line and exits with 1 (echo $?). Take the em dash out before you commit.

Done when

  • uv run python scripts/check_docs.py reports any em dash in a page under docs/, with its file and line, and exits with 1.
  • New tests cover a page that fails and a page with hyphens and en dashes that passes.
  • The script's docstring, CONTRIBUTING.md, and CLAUDE.md list the new check.
  • uv run pytest, uv run python scripts/check_docs.py, and uv run zensical build --strict all pass, and every commit is signed off (git commit -s).
Lingua principale
Python
Stelle
0
Fork
0
Merge medio
10h 40m
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openpickleball/developers

Tutte le issue di openpickleball/developers

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.