You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pre-commit Snippet: Exclude hub_fetch_run.py From a Repo's Own ruff, With force-exclude #4243
catalog/snippets/pre-commit/README.md and the snippet's own header say a build-profile repo with a uv.lock may swap a ruff hook's entry for uv run <tool>. That runs the repository's own ruff config, and the snippet tells the repo to copy hub_fetch_run.py beside the config. Nothing tells it to keep ruff off that copy.
A repository whose ruff config is stricter than the hub's then has the hook lint, autofix, and reformat the carried helper whenever a commit stages it. Take a repository with this config:
Staging the copied hub_fetch_run.py and committing makes ruff check --fix remove its # noqa: BLE001 (RUF100). It reports a docstring line over 120 columns (E501), and ruff format rewraps two calls. The commit then fails, and the working copy is no longer byte-identical to the snippet. A repo-wide ruff check . in CI fails on the same file.
extend-exclude = ["hub_fetch_run.py"] alone does not fix it. pre-commit passes staged files to ruff by name, and ruff ignores its exclude settings for an explicitly named path unless force-exclude = true is set.
Proposed Change
The pre-commit snippet README, and the snippet header's uv run note, should state that a repository running ruff under its own config excludes the helper with both settings:
The same applies to a .ruff.toml. RESYNC.md's step that copies the helper could carry the same line.
Found In
The aiopurpleair adoption of hub_fetch_run.py (ptr727/aiopurpleair#303), where the first commit attempt rewrote the helper before the exclude was added.
Activity
Exclude the Fetch Helper From ruff and Drop Hub-Audit Pointers From t…