Skip to content

IEFS002: main_file

.py or tasks.py exists and defines at least one @task function.

Category: file_structure ยท Applies to: eval

What it does

Looks for <name>.py first and tasks.py second, preferring whichever defines a @task, so a stray empty <name>.py does not hide the tasks in tasks.py. Fails when neither exists, when the file does not parse, or when it defines no task.

Why is this bad?

Keeping tasks in a predictably named module lets tooling and readers find them without opening every file in the package.

Example

src/my_eval/my_eval.py     # defines @task my_eval()
src/my_eval/tasks.py       # accepted alternative

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