Skip to content

Commit e437495

Browse files
authored
fix: avoid false handoff lint warnings
1 parent 9574d84 commit e437495

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/brigade/handoff_cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ def _lint_card_action(
642642
if prohibited in sections:
643643
errors.append(f"card handoffs must omit the {prohibited} section entirely")
644644

645-
if "## " in suggested_card:
645+
if any(line.startswith("## ") for line in suggested_card.splitlines()):
646646
warnings.append("Suggested card content contains level-2 markdown headings, which may be parsed as handoff sections")
647647

648648

tests/test_handoff_cmd.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ def test_handoff_lint_accepts_card_handoff_without_document_sections(tmp_path, c
7272
assert "(create-card)" in out
7373

7474

75+
def test_handoff_lint_allows_level_three_card_headings_without_warning(tmp_path, capsys):
76+
path = tmp_path / "note.md"
77+
path.write_text(CARD_HANDOFF + "\n### Details\n\nMore durable context.\n")
78+
79+
assert handoff_cmd.lint(target=tmp_path, paths=[path]) == 0
80+
81+
out = capsys.readouterr().out
82+
assert "warning:" not in out
83+
84+
7585
def test_handoff_lint_rejects_card_handoff_with_empty_document_sections(tmp_path, capsys):
7686
path = tmp_path / "note.md"
7787
path.write_text(CARD_HANDOFF + "\n## Target document\n\n## Suggested document content\n")

0 commit comments

Comments
 (0)