Skip to Content

Code Style

All style rules are enforced by pre-commit hooks — no manual formatter runs are required. The rules below describe what the hooks enforce.

Python

  • Linter and formatter: ruff — configured in .pre-commit-config.yaml. It replaces both flake8 and black.
  • Type hints: encouraged on all public functions and class methods. Not enforced in CI today, but PRs without type hints on new code will receive review feedback.
  • Line length: 100 characters (ruff default override).

TypeScript

  • Formatter: prettier via pre-commit — no per-project config needed.
  • Mode: strict in tsconfig.json for all TS apps.
  • Avoid any; use unknown and narrow types explicitly.

SQL (dbt)

  • Use CTEs to break up logic — avoid nested subqueries.
  • Lowercase all SQL keywords (select, from, where, join).
  • snake_case for all identifiers (columns, aliases, model names).
  • One CTE per logical transformation step; name CTEs descriptively.
with source as ( select * from {{ source('hmis', 'facility_reports') }} ), renamed as ( select facility_id, report_month, outpatient_visits from source ) select * from renamed
Last updated on