Code Style & Quality
To maintain a high-quality codebase, we adhere to specific style guides and use automated tools to enforce them.
Mandatory Quality Checksâ
We use pre-commit hooks to ensure consistency. These checks must pass before submitting a PR.
Setup Pre-commitâ
-
Install pre-commit:
pip install pre-commit
# OR
brew install pre-commit -
Install hooks:
pre-commit install -
Run checks manually:
pre-commit run --all-files
# OR
make precommit-local
Language-Specific Guidelinesâ
Go Codeâ
- Format with
gofmt. - Naming: Use meaningful variable and function names.
- Comments: Document exported functions and types.
- Modules: Run
make check-go-mod-tidyto verify all modules are tidy. - Lint: Run
make go-lintto check for issues, ormake go-lint-fixto auto-fix.
Rust Codeâ
- Format with
cargo fmt. - Lint with
cargo clippy. - Use
Resulttypes for error handling. - Document public APIs.
Python Codeâ
- Follow PEP 8 style guidelines.
- Use type hints.
- Write docstrings for classes and functions.