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 }}
This repository was archived by the owner on Oct 7, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 7, 2026. It is now read-only.
Deprecate missing-init-py in favour of ruff INP001 #25
missing-init-py is superseded by ruff's INP001 (implicit-namespace-package, from flake8-no-pep420). Users should migrate to it, and once no repo depends on this hook, this repo can be archived.
How to migrate
Enable the rule in your ruff config:
[tool.ruff.lint]
select = [..., "INP001"]
# Replaces `--exclude <dir>` from this hook
[tool.ruff.lint.per-file-ignores]
"{doc,docker}/**" = ["INP001"]
Run ruff check --select INP001 . once to find the existing violations, then fix them or add them to per-file-ignores.
INP001 has been in ruff for a long time, so older pins like ruff-pre-commit v0.6.1 already include it. You don't need to upgrade ruff.
Behavior differences
missing-init-py
ruff INP001
Missing __init__.py
creates it, exits 1
reports it, exits 1 (no autofix; touch it yourself)
Scope per run
whole repo (always_run)
staged .py files only
--exclude doc
matches by string prefix, so it also excludes docker/, docs/, …
glob in per-file-ignores, exact
File with a shebang
flagged
skipped (treated as a script)
Parent dir missing __init__.py when the child dir has one
not flagged
not flagged
The prefix-match row matters when migrating: a dir this hook never actually checked will start being checked by ruff. Run step 3 to see whether that applies to you.
Activity