summaryrefslogtreecommitdiff
path: root/docs/internals/contributing/writing-code/coding-style.txt
diff options
context:
space:
mode:
authorDavid Smith <smithdc@gmail.com>2025-07-25 10:24:17 +0100
committernessita <124304+nessita@users.noreply.github.com>2025-08-25 10:51:10 -0300
commitf81e6e3a53ee36e3f730a71aa55a5744982dd016 (patch)
tree44a4fdd64e2d1489d80b1af8bd1ac3c7af3ad0dd /docs/internals/contributing/writing-code/coding-style.txt
parent4286a23df64f6ce3b9b6ed097f4d1aac7d9e0de4 (diff)
Refs #36485 -- Rewrapped docs to 79 columns line length.
Lines in the docs files were manually adjusted to conform to the 79 columns limit per line (plus newline), improving readability and consistency across the content.
Diffstat (limited to 'docs/internals/contributing/writing-code/coding-style.txt')
-rw-r--r--docs/internals/contributing/writing-code/coding-style.txt20
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/internals/contributing/writing-code/coding-style.txt b/docs/internals/contributing/writing-code/coding-style.txt
index 125525c737..64ef6c5a51 100644
--- a/docs/internals/contributing/writing-code/coding-style.txt
+++ b/docs/internals/contributing/writing-code/coding-style.txt
@@ -96,13 +96,12 @@ Python style
* In docstrings, follow the style of existing docstrings and :pep:`257`.
-* In tests, use
- :meth:`~django.test.SimpleTestCase.assertRaisesMessage` and
- :meth:`~django.test.SimpleTestCase.assertWarnsMessage`
- instead of :meth:`~unittest.TestCase.assertRaises` and
- :meth:`~unittest.TestCase.assertWarns` so you can check the
- exception or warning message. Use :meth:`~unittest.TestCase.assertRaisesRegex`
- and :meth:`~unittest.TestCase.assertWarnsRegex` only if you need regular
+* In tests, use :meth:`~django.test.SimpleTestCase.assertRaisesMessage` and
+ :meth:`~django.test.SimpleTestCase.assertWarnsMessage` instead of
+ :meth:`~unittest.TestCase.assertRaises` and
+ :meth:`~unittest.TestCase.assertWarns` so you can check the exception or
+ warning message. Use :meth:`~unittest.TestCase.assertRaisesRegex` and
+ :meth:`~unittest.TestCase.assertWarnsRegex` only if you need regular
expression matching.
Use :meth:`assertIs(…, True/False)<unittest.TestCase.assertIs>` for testing
@@ -149,9 +148,10 @@ Imports
* Put imports in these groups: future, standard library, third-party libraries,
other Django components, local Django component, try/excepts. Sort lines in
- each group alphabetically by the full module name. Place all ``import module``
- statements before ``from module import objects`` in each section. Use absolute
- imports for other Django components and relative imports for local components.
+ each group alphabetically by the full module name. Place all
+ ``import module`` statements before ``from module import objects`` in each
+ section. Use absolute imports for other Django components and relative
+ imports for local components.
* On each line, alphabetize the items with the upper case items grouped before
the lowercase items.