Skip to content

Load a Hyphenated Sibling Check From One Shared Helper #532

Closed

Description

@ptr727

Summary

Three files in checks/ each define the same five-line helper, which loads a sibling script by path because a hyphenated file name cannot be imported by name:

  • checks/fuzz-media-parsers.py, load
  • checks/tests/test_check_media_metadata.py, load
  • checks/check-csp.py, load_sibling, the third copy, which the CSP gate added to reuse check-url-parity.py's site_origin

A defect class seen a second time gets one primitive, per GOVERNANCE.md "Design Before Code". Each copy is the import bootstrap itself, so none can be reused from the others. The consolidation is a small importable module in checks/, such as checks/sibling.py, that all three import by name. A script run as checks/<name>.py has checks/ on its path, and the test suite runs from checks/, so both reach it.

Done

One definition, all three sites on it, and ruff, mypy, and the suite passing under checks/.

🤖 Generated with Claude Code

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions