Skip to content

Commit 8a4bf78

Browse files
author
Your Name
committed
Allow models to be wishy washy about pipe specification in hashlines
1 parent 2a1e739 commit 8a4bf78

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cecli/helpers/hashline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Regex patterns for hashline parsing
77
# Format: |{line_number}{hash_fragment}|
8-
HASHLINE_PREFIX_RE = re.compile(r"^\|(-?\d+)([a-zA-Z]{2})\|")
8+
HASHLINE_PREFIX_RE = re.compile(r"^\|?(-?\d+)([a-zA-Z]{2})\|")
99
# Format: |{line_number}{hash_fragment}|
1010
PARSE_NEW_FORMAT_RE = re.compile(r"^\|?(-?\d+)([a-zA-Z]{2})\|?$")
1111
# Format: {hash_fragment}|{line_number}
@@ -201,7 +201,7 @@ def normalize_hashline(hashline_str: str) -> str:
201201
# If neither pattern matches, raise error
202202
raise HashlineError(
203203
f"Invalid hashline format '{hashline_str}'. "
204-
"Expected either '|{line_num}{hash_fragment}|' "
204+
"Expected '{line_num}{hash_fragment}' "
205205
"where line_num is an integer and hash_fragment is exactly 2 letters. "
206206
)
207207

0 commit comments

Comments
 (0)