INNER CODE UNIT · Python

line_number

uvwt/agentdock · core-skills/skill-authoring/run.py:143

def line_number(content: str, offset: int) -> int:
    return content.count("\n", 0, offset) + 1


ADVISORY_MARKERS = (
    "不得", "禁止", "不应", "不要", "明确废弃", "硬错误", "检查以下",
    "must not", "do not", "forbidden", "prohibited", "reject",
)
LIST_ITEM_PATTERN = re.compile(r"^(?:[-*+]|\d+\.)\s+")


def has_advisory_marker(value: str) -> bool:
    lowered = value.lower()
    return any(marker in lowered for marker in ADVISORY_MARKERS)


def markdown_match_is_advisory(content: str, start: int) -> bool:
    lines = content.splitlines()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…