Skip to content

Commit

Permalink
fix: add explicit error for invalid versions encountered during colle…
Browse files Browse the repository at this point in the history
…ct (#101)

* Add explicit error for invalid versions encountered during collect

* Adjust line length to appease the linter
  • Loading branch information
SnoopJ committed Jul 18, 2023
1 parent dced8a1 commit d959940
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/scriv/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ 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 d959940

Please sign in to comment.