Skip to content

Commit 60f10af

Browse files
hugovkezio-melotti
andauthored
Improve error wording
Co-authored-by: Ezio Melotti <[email protected]>
1 parent ac5a101 commit 60f10af

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/blurb/blurb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,10 @@ def finish_entry():
486486
try:
487487
int(value)
488488
except (TypeError, ValueError):
489-
throw(f"Invalid {issue_keys[key]} issue number! ({value!r})")
489+
throw(f"Invalid {issue_keys[key]} number: {value!r}")
490490

491491
if key == "gh-issue" and int(value) < lowest_possible_gh_issue_number:
492-
throw(f"The gh-issue number must be {lowest_possible_gh_issue_number} or above, not a PR number.")
492+
throw(f"Invalid gh-issue number: {value!r} (must be >= {lowest_possible_gh_issue_number})")
493493

494494
if key == "section":
495495
if no_changes:

tests/test_blurb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,15 @@ def test_parse():
217217
),
218218
(
219219
".. gh-issue: 1\n.. section: IDLE\nHello world!",
220-
r"The gh-issue number must be 32426 or above, not a PR number",
220+
r"Invalid gh-issue number: '1' \(must be >= 32426\)",
221221
),
222222
(
223223
".. bpo: one-two\n.. section: IDLE\nHello world!",
224-
r"Invalid bpo issue number! \('one-two'\)",
224+
r"Invalid bpo number: 'one-two'",
225225
),
226226
(
227227
".. gh-issue: one-two\n.. section: IDLE\nHello world!",
228-
r"Invalid GitHub issue number! \('one-two'\)",
228+
r"Invalid GitHub number: 'one-two'",
229229
),
230230
(
231231
".. gh-issue: 123456\n.. section: Funky Kong\nHello world!",

0 commit comments

Comments
 (0)