Reinforce the docstring/comment line-break convention for agents - #2375
Merged
Conversation
The 'break lines only after punctuation' rule is deliberate but easy to miss, and code reviewers (Copilot included) sometimes suppress mid-phrase-break findings as low-confidence. - docstrings.instructions.md: state the rule more explicitly, and instruct reviewers to always surface a mid-phrase break (do not suppress it as low-confidence). - Add a CLAUDE.md so Claude Code sessions pick up the .github/instructions conventions (Claude reads CLAUDE.md; the Copilot instruction files are not auto-loaded by it), with the line-break rule called out. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TaMepbxRYzJxQKFtu6Hq4p Signed-off-by: F.N. Claessen <felix@seita.nl>
Documentation build overview
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The repo convention "break lines only after punctuation" (docstrings and comments) is deliberate — it keeps review comments and text search stable — but it's easy to miss, and code reviewers (Copilot included) sometimes suppress mid-phrase-break findings as low-confidence, so they never surface.
Two small, non-code changes to help agents and reviewers apply it consistently:
.github/instructions/docstrings.instructions.md: state the rule more explicitly (each physical line ends at a comma/semicolon/colon/period;E501is ignored andmax-line-lengthis 160, so a long clause is preferred over a mid-phrase break), and add a short "For code review" directive telling reviewers to always surface a mid-phrase break and not treat it as low-confidence or suppress it.CLAUDE.md(new): Claude Code readsCLAUDE.md, but does not auto-load.github/instructions/*.md(that's Copilot's mechanism). This adds a short pointer so Claude sessions follow the same conventions, with the line-break rule called out, plus pointers to the pre-commit, changelog and other instruction files.No code or behavior changes.
Motivation
Prompted by Copilot suppressing four docstring/comment line-break findings on #2295 that were, in fact, wanted. The findings themselves are fixed on that branch; this PR is about keeping them from being missed/suppressed going forward.
🤖 Generated with Claude Code