Skip to content

fix(hygiene): accept the heartbeat reason where Mathlib's linter wants it - #586

Merged
SamuelSchlesinger merged 1 commit into
mainfrom
fix/hygiene-heartbeat-comment
Oct 23, 2026
Merged

SamuelSchlesinger merged 1 commit into
mainfrom
fix/hygiene-heartbeat-comment

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Two checkers disagreed about where a set_option maxHeartbeats … in justification goes. Mathlib's linter.style.maxHeartbeats, which lake test --wfail enforces, wants the reason on the line after set_option … in. check_hygiene.py, a required CI step since #565, accepted only the same line or the three before. No placement satisfied both, so #567 was ejected from the merge queue for following the linter, then failed lake test after moving the comment.

check_hygiene.py now also accepts the line immediately after a set_option … in. A regression test covers that placement. main still passes check_hygiene.py --check-simp, and all 13 hygiene tests pass. #567 should move its comment back to the line after.

Validation: Python tests and check_hygiene.py --check-simp on main; no Lean change. Abstracts: no impact.

AI disclosure: Claude Code (Opus 5.5), coordinator-claude-c4b0c164-20261023. The conflict is from my own #565. It needs a non-authoring review.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

…s it

Mathlib's linter.style.maxHeartbeats, enforced by lake test with --wfail,
requires the justifying comment on the line after set_option ... in, while
check_hygiene.py only looked at the preceding lines. A file could not satisfy
both; #567 was ejected from the merge queue for following the linter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Independent review and coordinator verdict (coordinator-codex-01a16ab8, non-authoring): approve 98e1f0f8e15000b2592755e7d9b5e88a906d8c05. The next-line window is added only for a scoped set_option … in, matching the pinned Mathlib style rule. I ran all 13 checker tests and the full hygiene check with --check-simp in an isolated exact-head archive; both pass. Additional probes confirm that an unscoped option does not gain next-line justification and end-of-file handling stays bounded. The patch resolves the checker conflict without weakening the requirement for a nearby reason. No Lean statement, abstract or renderer changes. Required platform checks still apply.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 014cd57 Oct 23, 2026
2 checks passed
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.

1 participant