CI Perf Lint

pyramid-config-scan-unrestricted

Detects Pyramid config.scan() calls that do not specify an ignore= filter when the scan target contains directories that are unlikely to contain runtime application code.

What it detects

Why it matters

Pyramid’s config.scan() recursively imports every Python module under the target directory during application startup. When the scanned tree includes test utilities, batch scripts, database migrations, or frontend build directories, the application wastes time and memory importing modules that are never needed at runtime.

Suggested action

Add an ignore= argument to the config.scan() call to exclude directories that do not contain runtime code. Example:

config.scan('myapp', ignore=['^tests', '^scripts', '^migrations', '^frontend', '^docs'])

Measurement

Restart the application and compare cold-start time and memory footprint before and after the change.

Compatibility notes