Skip to content

Tracebacks where the exit-status table promises a diagnostic #7

Description

@mairas

From the review on PR #1: #1 (comment)

check-anchors reserves exit 2 for "the check could not run" and PR #1 extended that to translation-status --check, check-typography and check-glossary. The rest of the package has not caught up, and the failure mode is always the same: a raw traceback at exit 1, which is the status a workflow reads as "the check found problems".

  • A missing or unreadable mkdocs.yml gives FileNotFoundError and exit 1 in every command that reads it, while check_anchors.configured_base() silently returns / for the same condition — in the function whose own docstring explains that a wrong base makes the checker report a pass it did not earn.
  • blob_hash uses check=True, so any git failure surfaces as CalledProcessError. A *.md directory under a locale reproduces it (exit 128, uncaught).
  • git is an undeclared runtime dependency; its absence gives FileNotFoundError from subprocess._execute_child. (Running outside a work tree is fine — hash-object needs no repository.) PR Package the documentation checkers and add a blocking translation gate #1 documented the requirement in the README; the diagnostic is still a traceback.
  • configured_languages() calls next() with no default, raising StopIteration when no locale is marked default.
  • stamp-translation writes files one at a time and raises SystemExit mid-batch on a bad path, leaving earlier files written and later ones not.
  • No subprocess.run call passes a timeout=, so a hung git hangs the job.

Fix: one config-loading path that turns a missing or malformed mkdocs.yml into a one-line message at exit 2, and the same treatment for a missing git. Validate every path in stamp-translation before writing any of them.

The exit-status table is now in the README; the code should match it everywhere.

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