code-comments: allow a contiguous comment header block at the top of every file #198

Closed
opened 2026-06-08 20:22:07 +00:00 by coilysiren · 0 comments
Owner

The code-comments hook (agentic_os/check_code_comments.py) previously allowed
YAML only a single comment on line 1, and code comments anywhere up to two
contiguous lines with no header allowance.

Relax both into one unified rule:

  • Every file may carry a contiguous comment header block above the first
    content line, of any length (each line still capped at 90 chars). Shebang and
    encoding lines count as preamble, so the header block may follow them.
  • After content begins, code allows up to two contiguous comment lines; YAML
    allows none (a key-sorter would drift any later comment off its target).

This lets license and teaching headers sit at the top of any file while keeping
inline comments short and non-contiguous.

Follow-up to #159 / #160.

The code-comments hook (`agentic_os/check_code_comments.py`) previously allowed YAML only a single comment on line 1, and code comments anywhere up to two contiguous lines with no header allowance. Relax both into one unified rule: - Every file may carry a contiguous comment header block above the first content line, of any length (each line still capped at 90 chars). Shebang and encoding lines count as preamble, so the header block may follow them. - After content begins, code allows up to two contiguous comment lines; YAML allows none (a key-sorter would drift any later comment off its target). This lets license and teaching headers sit at the top of any file while keeping inline comments short and non-contiguous. Follow-up to #159 / #160.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/agentic-os#198
No description provided.