[flake8-no-pep420] Document preview behavior (INP001) (#29764)

## Summary

INP001's preview-mode check for missing `__init__.py` files in
namespace-package directories with nested packages is now documented.
Empty directories and directory trees with no Python files are not
flagged.

## Test Plan

git diff --check passing. Documentation generation stalled while syncing
the Rust 1.99 toolchain; no tests run.

---------

Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
This commit is contained in:
Anshaj KumarandBrent Westbrook authored and GitHub committed 2026-10-27 19:26:00 +00:00
1 parent 731a26b88f
commit 22c07fed17
1 file changed
+13
@@ -30,6 +30,19 @@ use crate::package::PackageRoot;
/// `__init__.py` file is typically meant to be a regular package, and
/// the absence of the `__init__.py` file is probably an oversight.
///
/// ## Preview
///
/// In preview, the rule also checks for packages without `__init__.py` files between two regular
/// packages, such as `bar` in the project structure below.
///
/// ```text
/// foo/
/// ├── __init__.py
/// └── bar/
/// └── baz/
/// └── __init__.py
/// ```
///
/// ## Options
/// - `namespace-packages`
#[derive(ViolationMetadata)]