From 02d26d6e27c31cd8bba41cefd7700c690b57ca8d Mon Sep 17 00:00:00 2001 From: jamesconwaydev <148910373+jamesconwaydev@users.noreply.github.com> Date: Wed, 18 Nov 2026 08:24:12 -0700 Subject: [PATCH] fix(description): let a # follow a letter, so C# and F# repos can say so Every # was rejected, so a C# library couldn't name its own language. A # straight after a letter is neither a heading nor an issue link, so only that one is allowed now; #123, ## and 1# still fail. --- scripts/devstream/description.py | 8 +++++--- scripts/tests/test_description.py | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/devstream/description.py b/scripts/devstream/description.py index f2c3407..c9aec1b 100644 --- a/scripts/devstream/description.py +++ b/scripts/devstream/description.py @@ -3,7 +3,9 @@ from pathlib import Path MIN_LEN, MAX_LEN = 10, 140 -FORBIDDEN = set("<>[]()`*_#") +FORBIDDEN = set("<>[]()`*_") +# Only "#" straight after a letter is a name like C# or F#; anywhere else it is a heading or an issue link. +HASH = re.compile(r"(? tuple[str | None, str | None]: return None, "Descriptions can't include links." if "@" in t: return None, "Descriptions can't mention people or teams." - if FORBIDDEN & set(t): - return None, "Descriptions can't include these characters: < > [ ] ( ) ` * _ #" + if FORBIDDEN & set(t) or HASH.search(t): + return None, "Descriptions can't include < > [ ] ( ) ` * or _, and # only in a name like C#." if any(w.isupper() and len(w) > 5 for w in re.findall(r"[^\W\d_]+", t)): return None, "Descriptions can't have long words in ALL CAPS." if BLOCKED.search(t.casefold()): diff --git a/scripts/tests/test_description.py b/scripts/tests/test_description.py index 19d0bf4..ac4a3cf 100644 --- a/scripts/tests/test_description.py +++ b/scripts/tests/test_description.py @@ -82,6 +82,11 @@ def test_forbidden_characters(self): for c in "<>[]()`*_#": bad(f"A tool with a {c} in the text here") + def test_hash_only_after_a_letter(self): + ok("A fast JSON parser for C# and F# projects") + for t in ("Fixes #123 and more in the tool", "A tool ## for headings here", "Ranked 1# among all the tools", "A tool for C_# and the rest"): + bad(t) + def test_emoji_runs(self): ok("A neat tool \U0001F600\U0001F600 for people") bad("A neat tool \U0001F600\U0001F600\U0001F600 for people")