Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.99 KB

File metadata and controls

47 lines (35 loc) · 1.99 KB

0002 — Python code style: double quotes throughout

Status: Accepted — May 2026 Scope: All Python source under django-backend/

Context

The repository has Python code in django-backend/ and .vscode/settings.json already enables editor.formatOnSave. The recommended editor extensions include both ms-python.black-formatter and charliermarsh.ruff. Both tools default to double-quoted strings when they reformat Python code.

However, no project-level formatter config exists yet (no pyproject.toml, no ruff.toml). That means style is currently "whatever each contributor's editor does on save," which produces unpredictable diffs:

  • Django's startproject template generates single-quoted strings.
  • A contributor with formatOnSave enabled saves the file → all quotes flip to double.
  • The next PR contains the genuine change PLUS dozens of unrelated quote flips, drowning the review in noise.

Decision

All new and existing Python code in django-backend/ uses double-quoted strings. As part of T3 (env-driven settings), the existing config/settings.py was mechanically converted from single to double quotes so the convention is consistent from this point forward.

This matches the default behavior of Black, ruff format, and PEP 8's "prefer double quotes when not closing a docstring" guidance.

Consequences

  • Contributors should let their editor reformat on save (it will produce double quotes by default — no extra config needed today).
  • A future task will add a project-level ruff configuration in pyproject.toml so this rule is enforced by CI rather than assumed by editor behavior.
  • Until that task lands, occasional drift is possible but small.
  • If a contributor's editor produces single quotes (e.g., a Black variant or a misconfigured Prettier-for-Python plugin), they should normalize before opening a PR.

Follow-ups

  • T-tooling (TBD): add ruff config + a CI check so this rule is enforced rather than honored by convention alone.