Code Style¶
Terranova enforces consistent code style via pre-commit hooks.
Setup¶
Install pre-commit hooks after cloning:
Once installed, the hooks run automatically on git commit. To run them manually:
Python¶
Formatter: Black (v22.3.0)
Black reformats Python code with no configuration — just run it:
Linter: flake8 (v3.9.2) via pyproject-flake8
Flake8 configuration is in pyproject.toml. Run it with:
Frontend (TypeScript / JavaScript)¶
Formatter: Prettier (v2.4.1)
Prettier configuration is in .prettierrc. Files excluded from formatting are listed in .prettierignore.
Run Prettier manually:
Editor configuration¶
Most editors support Black and Prettier natively via extensions. Configure your editor to format on save using the project's formatter settings for the best experience.
- VS Code: Install the
ms-python.black-formatterandesbenp.prettier-vscodeextensions - JetBrains IDEs: Black and Prettier are supported via the built-in external tools configuration