From 9e30a06e418ecdd4eeb837530b86be40bb1e3d2d Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Tue, 6 Aug 2024 14:28:30 +0200 Subject: [PATCH] Add a paragraph describing our stance on Python typing (#1979) --- docs/contributing.rst | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index 0021a88fa..c94d9e74c 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -112,10 +112,10 @@ For MySQL/MariaDB in a ``mysql`` shell:: Style ----- -The Django Debug Toolbar uses `black `__ to -format code and additionally uses ruff. The toolbar uses -`pre-commit `__ to automatically apply our style -guidelines when a commit is made. Set up pre-commit before committing with:: +The Django Debug Toolbar uses `ruff `__ to +format and lint Python code. The toolbar uses `pre-commit +`__ to automatically apply our style guidelines when a +commit is made. Set up pre-commit before committing with:: $ pre-commit install @@ -129,6 +129,18 @@ To reformat the code manually use:: $ pre-commit run --all-files + +Typing +------ + +The Debug Toolbar has been accepting patches which add type hints to the code +base, as long as the types themselves do not cause any problems or obfuscate +the intent. + +The maintainers are not committed to adding type hints and are not requiring +new code to have type hints at this time. This may change in the future. + + Patches -------