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
Carry the hub_fetch_run.py Ruff Exclude to Every Site That Copies or Lints It #4263
The pre-commit snippet now tells a repository running ruff under its own config to exclude the carried hub_fetch_run.py, with extend-exclude and force-exclude = true. The other places that copy the helper, or run ruff over a tree holding it, carry no such line:
catalog/snippets/husky/pre-commit runs uv run ruff over the whole tree.
RESYNC.md step 6 copies the helper.
STANDUP.md "Wire a local commit hook" copies it.
The VS Code Lint tasks run ruff over the tree.
Take a repository whose own ruff config is stricter than the hub's, for example select = ["E", "W", "F", "RUF"] with line-length = 120. A Husky.Net or tasks-only setup then fails ruff check . on the helper, and an autofix rewrites it so it is no longer byte-identical to the snippet.
The pre-commit README's new sentence is also scoped to a repository "whose own ruff config applies". A repository with no ruff config still lints the helper at ruff's defaults, so that qualifier reads as an exemption it is not.
Done when
Every place that copies the helper or runs ruff over a tree holding it states the exclude, or points at the one sentence that does. The pre-commit README's wording covers a repository with no ruff config of its own.
Found by the local strict review passes on the pre-commit snippet fix.
One more layout, raised by Copilot on promotion #4255 and routed here by the maintainer on 2026-11-17: a repository whose Python lives only in declared subdirectories, each with its own pyproject.toml, and with no ruff config at the root. The pre-commit snippet runs ruff from the root, so it lints the root hub_fetch_run.py copy under ruff's defaults, and the snippet's exclude has no config file to go in.
Three candidate homes each break something:
A new root pyproject.toml makes python_directories.py resolve the root as a Python directory where nothing is declared.
A root ruff.toml is drift under spec/project-types.jsonpython.config.placement.
Either one becomes the closest config for a subdirectory project with no [tool.ruff]. Ruff then stops reading that project's requires-python for its target version.
Settling it needs a decision on where root ruff config may live in that layout, possibly a spec exception. A conformant Python repository with a root pyproject.toml already carries [tool.ruff] there, so the snippet's current guidance covers it.
Decision, 2026-11-18, maintainer's answer: the exclude goes on ruff's command line rather than in any config file.
The hook snippets and the VS Code Lint tasks call ruff with --extend-exclude hub_fetch_run.py --force-exclude. That covers every layout, the subdirectory-only one with no root ruff config included. It adds no file, so python_directories.py, python.config.placement, and each subdirectory's target-version discovery stay as they are. The accepted trade-off is that a bare ruff check . typed by hand still lints the helper.
Checked in a scratch layout under ruff 0.17.5, with a stricter-than-default config in effect: without the flags, ruff check . reports the helper. With them, ruff check passes on the directory and on explicit file paths, and ruff format --check skips the helper when it is named explicitly.
The rejected options were a spec exception for a root ruff.toml and moving the helper out of the root.
Activity
ptr727 commentedon Nov 17, 2026
One more layout, raised by Copilot on promotion #4255 and routed here by the maintainer on 2026-11-17: a repository whose Python lives only in declared subdirectories, each with its own
pyproject.toml, and with no ruff config at the root. The pre-commit snippet runs ruff from the root, so it lints the roothub_fetch_run.pycopy under ruff's defaults, and the snippet's exclude has no config file to go in.Three candidate homes each break something:
pyproject.tomlmakespython_directories.pyresolve the root as a Python directory where nothing is declared.ruff.tomlis drift underspec/project-types.jsonpython.config.placement.[tool.ruff]. Ruff then stops reading that project'srequires-pythonfor its target version.Settling it needs a decision on where root ruff config may live in that layout, possibly a spec exception. A conformant Python repository with a root
pyproject.tomlalready carries[tool.ruff]there, so the snippet's current guidance covers it.ptr727 commentedon Nov 18, 2026
Decision, 2026-11-18, maintainer's answer: the exclude goes on ruff's command line rather than in any config file.
The hook snippets and the VS Code Lint tasks call ruff with
--extend-exclude hub_fetch_run.py --force-exclude. That covers every layout, the subdirectory-only one with no root ruff config included. It adds no file, sopython_directories.py,python.config.placement, and each subdirectory's target-version discovery stay as they are. The accepted trade-off is that a bareruff check .typed by hand still lints the helper.Checked in a scratch layout under ruff 0.17.5, with a stricter-than-default config in effect: without the flags,
ruff check .reports the helper. With them,ruff checkpasses on the directory and on explicit file paths, andruff format --checkskips the helper when it is named explicitly.The rejected options were a spec exception for a root
ruff.tomland moving the helper out of the root.Exclude the Root Fetch Helper on ruff's Command Line (#4267)