Skip to content

Coding standards

Editor
Engineering leadership

Everyone who writes or reviews code.

While writing and reviewing code.

  • Must: Code in the repo is formatted and linted the way that repo already runs in CI or pre-commit. Do not argue style that the toolchain already enforces.
  • Must: Names and structure describe the outcome. Do not leave debug dumps, commented-out blocks, or secrets in the merge.
  • Must: Handle failure where the user or operator will feel it: validation, timeouts, and errors that need a log line.
  • Should: Prefer clear code over clever code. If you need a comment to explain what, rename instead.
  • Should: Match the patterns already in the file you are editing, unless you are deliberately changing the pattern in that PR.
  • Team decides: Language-specific lint rules. Put stack-only rules on the stack page.

A reviewer spends time on behavior and risk, not on tabs vs spaces.

  1. Run the repo’s format and lint locally before you open the PR.
  2. Remove secrets, dead code, and leftover debug.
  3. Add or update tests for behavior you change. See Automated tests.
  4. If you introduce a new pattern, say why in the PR.