You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,17 @@ Filing the issue first (before writing code) lets feedback shape scope before im
29
29
30
30
Frontend styling uses **CSS Modules**: co-locate a `Component.module.css` next to each component's `.tsx` file. No Tailwind, no styled-components, no CSS-in-JS runtime. See the [design system guide](docs/developer/design-system.md) for the full conventions.
31
31
32
+
### Type annotations (backend)
33
+
34
+
The Python codebase has `mypy` running in **gradual mode** — `disallow_untyped_defs` is `false`, so missing annotations don't fail CI. The intent is to ratchet stricter over time, not to demand annotations on every change. Concretely:
35
+
36
+
-**New code**: add type annotations to function signatures (parameters and return types). Inside function bodies, only annotate where the type is non-obvious or the inference is wrong.
37
+
-**Existing code you touch**: if you're already editing a function for another reason, adding annotations is welcome but not required.
38
+
-**Don't annotate just to silence mypy.** If a type is genuinely ambiguous (`Any` is fine, `# type: ignore[code]` with the specific code is fine when you know why), say so explicitly rather than papering over it.
39
+
-**Django models**: `django-stubs` and `djangorestframework-stubs` are installed; mypy can check ORM call sites without per-call annotation.
40
+
41
+
The goal is that contributors can land work without fighting the type checker, while the typed surface grows incrementally where it pays for itself.
42
+
32
43
If an issue takes much longer than its size suggested, post an update on the issue with an honest read on whether you can finish; releasing it back to the backlog is fine.
0 commit comments