Entry files

An entry point is a file PragyaLint assumes gets run or imported from outside your codebase — the starting point for reachability analysis. Everything reachable from an entry point is "alive"; everything else is a candidate for deletion.

Conventional entries

With no --entry flag, PragyaLint treats these as entries automatically:

PatternWhy
__main__.pyRunnable as a package (python -m yourpkg).
main.pyCommon script entry-point filename.
app.pyCommon web-app entry-point filename.
cli.pyCommon CLI entry-point filename.
setup.pyPackage build script, invoked by pip/setuptools directly.
Root-level __init__.pyPackage's public surface.

Disable this with --no-conventional-entries if you want to specify entries explicitly and nothing else.

Explicit entries

Pass one or more entry points explicitly with --entry:

pragyalint --entry src/server.py --entry src/worker.py
pragyalint --entry src.server   # module-name form also works

When --entry is given, it's used in addition to test-file discovery (below) — not instead of it.

Test files are always entries

This applies regardless of --entry. Pytest (and unittest discovery) import conftest.py and test_*.py/*_test.py files themselves, by walking the filesystem — not through any import statement in your source. A pure import-graph reachability check would always see these as unreachable and try to delete your whole test suite. PragyaLint recognizes this convention and treats matching files as entries automatically.

Matched by any of:

Top-level definitions inside entry files (including test files) aren't flagged by unused_local/unused_export by default either — pytest calls test_foo functions by name-convention, not by reference, so they'd otherwise show up as "defined but never used" too. Pass --include-entry-exports if you specifically want entry-file definitions checked anyway.

Non-root __init__.py files

Only the root __init__.py counts as a conventional entry. Package __init__.py files deeper in your tree are analyzed normally — if nothing imports that subpackage, it's still flagged as unreachable.