Changes between Initial Version and Version 8 of Ticket #36500
- Timestamp:
- Jul 21, 2025, 5:01:12 PM (2 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36500
- Property Has patch set
- Property Cc added
- Property Component Packaging → Core (Other)
- Property Version 5.2 → dev
- Property Status assigned → new
- Property Keywords flake8 added
- Property Summary pre-commit should enforce 79 char limit for docstrings and comments → inconsistent 79 char limit for docstrings and comments
- Property Type Cleanup/optimization → Bug
-
Ticket #36500 – Description
initial v8 1 1 Django's coding style has long required [https://docs.djangoproject.com/en/5.2/internals/contributing/writing-code/coding-style/#python-style:~:text=We%20allow%20up%20to%2088%20characters%20as%20this%20is%20the%20line%20length%20used%20by%20black.%20This%20check%20is%20included%20when%20you%20run%20flake8.%20Documentation%2C%20comments%2C%20and%20docstrings%20should%20be%20wrapped%20at%2079%20characters%2C%20even%20though%20PEP%208%20suggests%2072. limiting docstrings and comments] to 79 characters, while allowing a larger 88-char limit for code lines. (The latter matches Black's default.) 2 2 3 Currently, only the 88 char limit is enforced by pre-commit linting, via flake8. The 79 char limit is manually enforced during PR review. 3 But a large number of files in Django's source code have docstrings and block comments with lines that are between 80–88 characters long, violating this coding standard. 4 5 Currently, only the 88 char limit is enforced by pre-commit linting, via flake8. The 79 char limit is (sometimes) manually enforced during PR review. 4 6 5 7 Early versions of flake8 supported only a single `max-line-length ` limit that applied to both code and comments/docstrings. flake8 3.7.8 (2019-07-08) added a separate `max-doc-length` configuration option. 6 8 7 Django should set that option so reviewers and contributors don't need to spend time cycling on line length. 9 Django should either automatically enforce (via flake8 and pre-commit) this requirement or remove it so reviewers and contributors don't need to spend time cycling on line length. 10 11 [Edited to clarify discrepancy between existing coding standard and existing code.]