- Format code:
make formator./format(runs ruff format, import sorting, docformatter, JSON formatting) - Lint:
make lintorrecipe/run_test.sh lint(uses ruff) - Type check:
make typecheckorrecipe/run_test.sh typecheck(uses mypy) - All tests:
make testorrecipe/run_test.sh(lint + typecheck + unittest + CLI) - Unit tests only:
make unittestorrecipe/run_test.sh unittest(pytest with coverage, 4 parallel workers) - Single test:
pytest -n 4 src/wxvx/tests/test_<name>.py::<test_function>from project root
- Imports: Use
from __future__ import annotationsat top; stdlib → third-party → local; sort with ruff (isort) - Formatting: Use ruff format (automatically handles line length, indentation, quotes)
- Types: Use type hints everywhere; run mypy for verification; use
TYPE_CHECKINGfor circular imports - Naming:
snake_casefor functions/variables,PascalCasefor classes,UPPER_CASEfor constants/Enums - Errors: Raise
WXVXErrorfor domain errors; log tracebacks at debug level; use descriptive error messages - Docstrings: Format with docformatter; use triple-quoted strings for module/class/function docs
- Comments: Use
# Publicand# Privatesections to separate interface from implementation - Resources: Access package resources via
wxvx.util.resource()orresource_path() - Logging: Use Python logging module; avoid print statements
- Testing: Use pytest; mock with
unittest.mock; organize tests insrc/wxvx/tests/