Skip to content
This repository was archived by the owner on Oct 7, 2026. It is now read-only.
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

Open

Description

@mattwang44

Summary

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

  1. 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"]
  2. Remove the hook from .pre-commit-config.yaml:

    - repo: https://github.com/hardcoretech/missing
      rev: v0.3.0
      hooks:
        - id: missing-init-py
  3. 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

  1. pinned this issue on Oct 7, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions