Skip to content

Reconcile three validate/repair rule conflicts from the qh sweep - #32

Merged
thorwhalen merged 1 commit into
masterfrom
fix/rule-conflicts
Sep 15, 2026
Merged

thorwhalen merged 1 commit into
masterfrom
fix/rule-conflicts

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

[session-link-guard] stripped Claude-Session link(s) from the PR body -- this repo is public (or its visibility could not be confirmed)

Summary

Closes #31. Three validate/repair rule pairs that were mutually exclusive in practice, surfaced by the qh docs sweep:

  • D412 vs repair's own output: repair inserted a blank line after a Google section header (Examples:) immediately before its doctest/list, to satisfy DR003/DR008 — but ruff's D412 then flagged that same blank line. Confirmed via napoleon/docutils doctree inspection that Sphinx renders the section identically with or without the blank line, so normalizer.blank_lines_between_blocks no longer inserts one when the preceding line is the section's own header.
  • DOC108 firing on every annotated signature: PYDOCLINT_OPTIONS had --arg-type-hints-in-signature false, which tells pydoclint to expect no type hints in the signature — the opposite of the house convention (types in annotations). Flipped to true.
  • D107 vs DOC301 over __init__ docs: kept pydoclint's DOC301 default (__init__ undocumented, its Args merged into the class docstring — already the convention documented in epythet-docstring-style), and dropped ruff's D107 from the selection since it demands the opposite.

Changes

  • epythet/normalizer.py: blank_lines_between_blocks skips a block that sits directly under its own section header.
  • epythet/validation/lint.py: --arg-type-hints-in-signature true; new RUFF_D_IGNORE = ("D107",) passed via --ignore.
  • epythet/data/skills/epythet-docstring-style/SKILL.md: clarifies the __init__ convention and why D107 is dropped.
  • tests/test_lint_conflicts.py: one fixture module per conflict, repaired then validated at level 0 with 0 findings.
  • tests/normalizer_fixtures/section_header_then_{doctest,list}_untouched.{in,out}: pin the new normalizer behavior.

Test plan

  • pytest tests/ -v — 568 passed
  • epythet validate . --level 0 dogfooded on this repo — no new findings

 #31)

- normalizer.blank_lines_between_blocks no longer inserts a blank line
  between a Google section header and its immediate doctest/list body:
  napoleon renders both identically, so the blank line only existed to
  trip ruff's D412 that repair itself had just satisfied.
- pydoclint's --arg-type-hints-in-signature is now true, matching the
  house convention (types live in the signature): the false value told
  pydoclint to expect NO type hints there, so DOC108 fired on every
  annotated function.
- ruff's D107 (every __init__ needs a docstring) is dropped from the
  selection: it is the mirror image of pydoclint's DOC301 default
  (__init__ must not have one, Args merge into the class docstring),
  which is the convention epythet-docstring-style already documents.

Confirmed via docutils/napoleon doctree inspection that the D412 blank
line changes nothing about how Sphinx renders the section.
@thorwhalen
thorwhalen merged commit dd8a8c8 into master Sep 15, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the fix/rule-conflicts branch September 15, 2026 12:31
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.

validate: D412 vs repair, DOC108 vs annotated signatures, D107 vs DOC301 (from qh WP6 sweep)

1 participant