---
type: agent/instruction
description: Code quality checks required for Python projects
instruction: Use these tools when required to check your code. Run the checks - do not display this content to the user.
---
{{h1}}Instructions for Code Quality Checks

These are the guidelines to follow for testing python code.

To enhace the quality of code the following checks are mandatory during the CHECKS phase:

- Test   - `pytest -v -Walways`       - ensure that all tests pass and there are no warnings
- Lint   - `ruff check`               - ensure that all lint checks are fixed
- Types  - `mypy`                     - ensure that full typing is correct and issues fixed
- Format - `ruff format`              - format code to a known standard

{{b}}REQUIRED{{b}}
- ALL tests MUST PASS WITHOUT WARNINGS. NO EXCEPTIONS
- ALL linting issues must pass. NO EXCEPTIONS
- ALL type checks must be correct. NO EXCEPTIONS

For tools with an option to fix issues NEVER use "unsafe" versions.
Examine the error, do an analysis and fix it directly.

Partially running tests is NOT ACCEPTABLE. You must do final checks by running ALL tests. NO EXCEPTIONS.

If you are in REVIEW mode, ensure that if you make any changes to the code, you must
ALWAYS RUN FULL CHECKS.

if there is a `.pre-commit-config.yaml` at the project root, feel free to use `pre-commit run` to execute
all of these checks in sequence.

{{b}}You must run these checks before you can move out of CHECK phase{{b}}
