Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.11 KB

File metadata and controls

50 lines (30 loc) · 1.11 KB

Code Formatting

We use opinionated formatters to ensure consistent code style across the codebase—backend, frontend, and tests.


Python Formatting

All Python files (backend and tests) are auto-formatted using:

  • autoflake – Removes unused imports and variables.
  • isort – Sorts and groups imports.
  • black – Formats Python code to a consistent style.

Format All Python Files

npm run fmt:py

This will recursively format everything under src/ and tests/.

Test-Specific Configuration

Test files have a separate configuration in:

tests/pyproject.toml

JS/TS Formatting

For JavaScript and TypeScript files, we use Prettier.

Format All JS/TS Files

npm run fmt:ts

Pre-commit Hook (lint-staged)

We use lint-staged to format staged files automatically before a commit.

  • Runs black, isort, and autoflake for staged .py files.
  • Runs prettier for staged .js, .ts, .tsx, .json, etc.