Skip to content

IECQ001: private_api_imports

No imports from private inspect_ai modules.

Category: code_quality ยท Applies to: eval, helper

What it does

Flags from inspect_ai.<...>._<name> import ... wherever a dotted segment starts with an underscore. One diagnostic per import.

Why is this bad?

Private modules change without notice. An evaluation importing one breaks on the next inspect_ai release with no deprecation period.

Example

from inspect_ai.scorer._metric import Score   # private

Use instead:

from inspect_ai.scorer import Score

Suppress on a line with # inspect-evals-lint: ignore[IECQ001] or ignore[private_api_imports]; select or ignore it in configuration by either, or by the prefix IECQ.