Skip to content

Reinforce the docstring/comment line-break convention for agents - #2375

Merged
Flix6x merged 1 commit into
mainfrom
chore/agent-docstring-convention
Aug 1, 2026
Merged

Reinforce the docstring/comment line-break convention for agents#2375
Flix6x merged 1 commit into
mainfrom
chore/agent-docstring-convention

Conversation

@Flix6x

@Flix6x Flix6x commented Aug 1, 2026

Copy link
Copy Markdown
Member

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; E501 is ignored and max-line-length is 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 reads CLAUDE.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

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>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 flexmeasures | 🛠️ Build #33865588 | 📁 Comparing e1ac8ae against latest (42a79c6)

  🔍 Preview build  

1 file changed
± api/v3_0.html

@Flix6x Flix6x added the AI Infra label Aug 1, 2026
@Flix6x Flix6x self-assigned this Aug 1, 2026
@Flix6x
Flix6x merged commit e762239 into main Aug 1, 2026
13 checks passed
@Flix6x
Flix6x deleted the chore/agent-docstring-convention branch August 1, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant