Skip to content

Settle the Subprocess-Failure Rule for a Status Printed in Message Text #3365

Closed

Description

@ptr727

Context

The CODESTYLE.md rule proposed in #3363 classifies a subprocess failure by which command failed and its exit status, never by its message text. A local strict review pass on its pull request raised two follow-ups that fall outside that one-bullet change.

Scope Question

Some tools exit with one status for failures that need different handling. gh api exits 1 for every HTTP error, so a 404 (the object is absent, expected) and a 401 or a network failure (unexpected) share an exit status, and no split into separate operations gives the 404 a command of its own. The only signal separating them is the (HTTP 404) status code gh prints on stderr, which is a status code inside message text rather than prose.

Decide whether the rule admits a structured status a tool prints, such as an HTTP status code, and if so, how the bullet says it without enumerating tools.

Existing Sites

  • scripts/pr_review.py matches HTTP_STATUS = re.compile(r"\(HTTP (\d{3})\)") against ABSENT = {"404", "422"}, the scope question above.
  • scripts/pr_review.py retries a gh api call when its stderr contains "unknown flag: --allow-escape-sequences", which is version-dependent wording, the exact case the rule names.

Each site moves onto the rule in a change of its own once the scope question is answered.

Activity

  1. ptr727 commented on Oct 22, 2026

    @ptr727
    OwnerAuthor

    The scope question above is answered in #3366, whose bullet classifies by "the status code it reports", counting "one printed inside the message", so the (HTTP NNN) match conforms. Open review findings on that wording are in #3367. What stays here is the unknown flag: --allow-escape-sequences stderr match in scripts/pr_review.py, which classifies by wording.

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

    documentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions