The project uses pre-commit to ensure code quality. The hooks run automatically before each commit:
Hook |
Description |
|---|---|
|
PEP 8 static analysis (Tryton style: ignores E123, E124, E126, E128, E741, W503) |
|
Import sorting (VERTICAL_GRID, trytond prefix) |
|
Removes trailing whitespace |
|
Ensures files end with a newline |
|
Ensures no space before |
|
Ensures XML is indented with 4 spaces and no tabs |
|
Disallows |
|
Docstrings must use triple double quotes |
|
Ensures class names use CamelCase |
Install pre-commit:
pip install pre-commit
pre-commit install
After installation, the hooks run automatically on every git commit. To run them manually:
pre-commit run --all-files
Tests are executed inside the Docker container using Invoke.
Run static analysis and unit tests for a single module:
inv tests --name speco
Run static analysis and unit tests for all modules:
inv tests
Run BDD (behave) tests for a single module:
inv bdd.run --name speco
Run BDD (behave) tests for all modules:
inv bdd.all
Build the Sphinx documentation:
inv dev.docs
The generated documentation is available in backend/doc/_build/html/.