Skip to content

Commit

Permalink
Add explicit error for invalid versions encountered during collect
Browse files Browse the repository at this point in the history
  • Loading branch information
SnoopJ authored and Ned Batchelder committed Jul 18, 2023
1 parent b3e8a8d commit 60c2cf8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/scriv/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ def collect(
if etitle is None:
continue
eversion = Version.from_text(etitle)
if eversion is None:
sys.exit(
f"Entry {etitle!r} is not a valid version! "
+ "If scriv should ignore this heading, add 'scriv-end-here' somewhere before it"
)
if eversion == version:
sys.exit(
f"Entry {etitle!r} already uses "
Expand Down

0 comments on commit 60c2cf8

Please sign in to comment.