fix(hermes): use partition instead of a magic length comparison
All checks were successful
Tests / Declarative: Post Actions passed: 1387
All checks were successful
Tests / Declarative: Post Actions passed: 1387
PLR2004. Pushed the previous commit with this gate failing - my check ran all four gates in one block and the output of the passing ones scrolled the failure off. Running them separately is the fix for that, not running them faster. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
ee902354c2
commit
01759e309a
@ -171,10 +171,10 @@ def issue_url(incident_id: str, ui_url: str) -> str:
|
|||||||
text = str(incident_id or "")
|
text = str(incident_id or "")
|
||||||
if not base or not text.startswith(INCIDENT_PREFIX):
|
if not base or not text.startswith(INCIDENT_PREFIX):
|
||||||
return ""
|
return ""
|
||||||
parts = text[len(INCIDENT_PREFIX) :].split("/", 1)
|
project, separator, key = text[len(INCIDENT_PREFIX) :].partition("/")
|
||||||
if len(parts) != 2 or not parts[0].strip() or not parts[1].strip():
|
if not separator or not project.strip() or not key.strip():
|
||||||
return ""
|
return ""
|
||||||
return base + _ISSUE_PATH.format(project=parts[0].strip(), key=parts[1].strip())
|
return base + _ISSUE_PATH.format(project=project.strip(), key=key.strip())
|
||||||
|
|
||||||
|
|
||||||
def _types(cfg: dict) -> tuple[str, ...]:
|
def _types(cfg: dict) -> tuple[str, ...]:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user