Sanitize issue ID while preserving uppercase letters and # for readability. Examples: SOLR-12345, LUCENE-1234, PR#3758, GITHUB#2408, v9.8.0-entry-001
(issue_id: str)
| 362 | |
| 363 | @staticmethod |
| 364 | def _sanitize_issue_id(issue_id: str) -> str: |
| 365 | """ |
| 366 | Sanitize issue ID while preserving uppercase letters and # for readability. |
| 367 | Examples: SOLR-12345, LUCENE-1234, PR#3758, GITHUB#2408, v9.8.0-entry-001 |
| 368 | """ |
| 369 | # Replace unsafe characters with dash (preserving case) |
| 370 | sanitized = SlugGenerator.UNSAFE_CHARS_PATTERN.sub('-', issue_id) |
| 371 | |
| 372 | # Replace remaining unsafe characters (but keep letters/numbers/dash/hash/dot) |
| 373 | sanitized = re.sub(r'[^a-zA-Z0-9.#-]+', '-', sanitized) |
| 374 | |
| 375 | # Replace multiple consecutive dashes with single dash |
| 376 | sanitized = re.sub(r'-+', '-', sanitized) |
| 377 | |
| 378 | # Strip leading/trailing dashes |
| 379 | sanitized = sanitized.strip('-') |
| 380 | |
| 381 | return sanitized |
| 382 | |
| 383 | @staticmethod |
| 384 | def _sanitize_filename_part(text: str) -> str: |
no test coverage detected