1001 B
1001 B
Python profile
Enable this profile for Python repositories.
Suggested standard
Codex SHOULD prefer:
pytestfor tests;rufffor linting and formatting checks;- type hints for public functions and non-trivial logic;
pathlibfor filesystem paths where practical;- explicit error handling;
- small, focused functions;
- simple modules over unnecessary class hierarchies.
Rules
Codex MUST:
- keep dependencies minimal;
- avoid broad
exceptclauses unless justified; - avoid hidden side effects at import time;
- separate business logic from CLI, web, or framework glue;
- avoid global mutable state unless justified;
- write tests for behavior, not implementation details;
- run tests inside Docker containers.
Validation examples
Use project-specific Docker-based commands, for example:
docker compose run --rm app ruff check .
docker compose run --rm app pytest
If formatting is configured:
docker compose run --rm app ruff format --check .