Skip to content

ci: enforce ascii-only pr body and widen the self-check grep#98

Merged
0xKT merged 2 commits into
mainfrom
docs/fix_ascii_check_grep_in_agents_md
Jul 7, 2026
Merged

ci: enforce ascii-only pr body and widen the self-check grep#98
0xKT merged 2 commits into
mainfrom
docs/fix_ascii_check_grep_in_agents_md

Conversation

@0xKT

@0xKT 0xKT commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

A non-ASCII PR body slipped onto main via #97: the repo squash-merges with
the PR description as the commit body, but nothing checked that body before
merge, so an em-dash only tripped the post-merge commit lint on main (too
late to fix cleanly). Close the gap at both the guidance and the enforcement
layer.

  • Enforcement (CI): add check_pr_body (ASCII-only, reusing
    commit_lint._is_ascii) and a "Validate PR body" step in the pull_request
    job, so a non-ASCII PR body fails the PR check before merge and points at
    the offending line.
  • Guidance (AGENTS.md 3.7): the preview grep now uses [^\x00-\x7F] (any
    non-ASCII), not a CJK-only pattern that gave a false pass.
  • Guidance (AGENTS.md 3.1.1): state the punctuation rule is ASCII-only, not
    merely no-full-width (calls out em-dash / curly quotes / ellipsis).

Type

  • CI / tooling
  • Docs

Verification

  • Relevant tests pass locally
uv run pytest tests/test_commit_lint.py -q                    # 12 passed
PR_BODY="line with a non-ascii dash" python3 scripts/check_pr_body.py  # exit 1, flags line
python3 scripts/check_commit_messages.py "origin/main..HEAD"  # PASS
grep -nP "[^\x00-\x7F]" <this body>                           # 0 matches

Risk

  • Backward compatibility considered

The new check runs in the existing required pull_request job, so it is
enforced immediately without a new required-check name. ASCII-only PR bodies
are already implied by the squash-to-main constraint, so this only moves the
check earlier (pre-merge instead of post-merge).

Related Issues

N/A (follow-up to the commit-lint failure on #97)

0xKT and others added 2 commits July 7, 2026 20:47
The section 3.7 preview grep only matched CJK plus full-width
punctuation, so em-dash / curly quotes / ellipsis passed as clean while
the CI (commit_lint._is_ascii) rejects any non-ascii. Since the squash
commit body is the PR description, such a char fails the post-merge
commit lint on main (as seen on #97).

Switch to grep -nP "[^\x00-\x7F]", and note in the 3.1.1 punctuation
row that the rule is ascii-only, not merely no-full-width.

Co-authored-by: Claude (claude-opus-4-8) <noreply@anthropic.com>
The PR body becomes the squash commit body, but nothing checked it
before merge: the pr-title job only linted the title, and commit-lint
only saw branch commits. A non-ascii PR body therefore only failed the
post-merge commit lint on main, too late to fix cleanly (as on #97).

Add check_pr_body (ascii-only, reusing commit_lint._is_ascii) and a
Validate PR body step in the pull_request job, so a non-ascii body fails
the PR check before merge and points at the offending line.

Co-authored-by: Claude (claude-opus-4-8) <noreply@anthropic.com>
@0xKT 0xKT changed the title docs: widen pr-description non-ascii check to full ascii range ci: enforce ascii-only pr body and widen the self-check grep Jul 7, 2026
@0xKT 0xKT requested review from arelchan and cyfyifanchen July 7, 2026 13:14
@0xKT 0xKT merged commit edf2ae4 into main Jul 7, 2026
7 checks passed
@0xKT 0xKT deleted the docs/fix_ascii_check_grep_in_agents_md branch July 7, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants