Opened 2 months ago

Last modified 8 weeks ago

#36500 closed Bug

pre-commit should enforce 79 char limit for docstrings and comments — at Initial Version

Reported by: Mike Edmunds Owned by: Mike Edmunds
Component: Core (Other) Version: dev
Severity: Normal Keywords: flake8
Cc: David Smith Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Django's coding style has long required limiting docstrings and comments to 79 characters, while allowing a larger 88-char limit for code lines. (The latter matches Black's default.)

Currently, only the 88 char limit is enforced by pre-commit linting, via flake8. The 79 char limit is manually enforced during PR review.

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.

Django should set that option so reviewers and contributors don't need to spend time cycling on line length.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top