Skip to content

gh-list-no-limit check is defeated by a trailing comment or quoted string containing the substring --limit #1146

Description

@AmirF194

What's broken

validate_gh_list_limit (the gh-list-no-limit check) is meant to flag any fenced gh issue list / gh pr list command that has no --limit flag. It decides that by testing whether the literal substring --limit occurs anywhere on the logical line, so a trailing shell comment or a quoted argument that merely mentions --limit silently defeats the check even though the command has no such flag.

Which layer

tools/skill-and-tool-validator/src/skill_and_tool_validator/__init__.py, validate_gh_list_limit (around line 2715), the if "--limit" in logical_line: continue line.

How to reproduce

from pathlib import Path
from skill_and_tool_validator import validate_gh_list_limit

text = (
    "```bash\n"
    "gh issue list --repo <repo> --state open  # add --limit later if slow\n"
    "```\n"
)
print(list(validate_gh_list_limit(Path("SKILL.md"), text)))

Expected vs actual

Expected: one gh-list-no-limit violation, since the command has no real --limit flag and would silently cap at GitHub's default page size.

Actual: no violations. The trailing comment's literal text --limit satisfies the substring check even though it is not a flag. A quoted argument that mentions --limit (for example --search "mentions --limit") has the same effect.

Surface area

Only this one check function; _GH_LIST_RE matching and the fenced-block boundary are unaffected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions