Opened 3 months ago

Closed 4 weeks ago

Last modified 3 weeks ago

#36485 closed Cleanup/optimization (fixed)

Add linting tool for documentation

Reported by: David Smith Owned by: David Smith
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Adam Johnson 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

As Natalia wrote on this forum post

Currently, style guidelines for docs are well documented, but checking them is still a manual part of the review process. That often results in extra back-and-forth over small formatting details, which can slow things down. Automating this would help ease that overhead, making reviews more efficient for both contributors and maintainers.

The documentation can be linted with sphinx-lint with some modifications such that it works with Django's documentation. Main edits are for Django's .txt extension (vs default .rst) and some additional exceptions for the line length check.

Change History (15)

comment:1 by David Smith, 3 months ago

Version 0, edited 3 months ago by David Smith (next)

comment:2 by Natalia Bidart, 3 months ago

Has patch: set
Triage Stage: UnreviewedAccepted
Version: 5.2dev

Thank you David! I'm so looking forward to this :-)

comment:3 by nessita <124304+nessita@…>, 7 weeks ago

In 7f9bf35:

Refs #36485 -- Grouped docs checks under a unified make check target.

Added a new 'check' rule to the docs Makefile which runs both the black
and spelling checks.

comment:4 by Natalia <124304+nessita@…>, 7 weeks ago

In a9c7d4b7:

[5.2.x] Refs #36485 -- Grouped docs checks under a unified make check target.

Added a new 'check' rule to the docs Makefile which runs both the black
and spelling checks.

Backport of 7f9bf357feac06bb34017e1f6c7a7730b1991ede from main.

comment:5 by Adam Johnson, 6 weeks ago

Cc: Adam Johnson added

comment:6 by Natalia Bidart, 4 weeks ago

Triage Stage: AcceptedReady for checkin

comment:7 by nessita <124304+nessita@…>, 4 weeks ago

In ef2f16b:

Refs #36485 -- Added sphinx-lint support and make lint rule for docs.

This adds a lint.py script to run sphinx-lint on Django's docs files,
a mathing lint target in the docs/Makefile and docs/make.bat, and
updates docs/requirements.txt accordingly.

comment:8 by nessita <124304+nessita@…>, 4 weeks ago

In 6f8e23d1:

Refs #36485 -- Removed unnecessary parentheses in :meth: and :func: roles in docs.

comment:9 by nessita <124304+nessita@…>, 4 weeks ago

In 724e5ec6:

Refs #36485 -- Fixed dangling hyphen and unbalanced inline markup in docs.

comment:10 by nessita <124304+nessita@…>, 4 weeks ago

In 01a460f2:

Refs #36485 -- Removed trailing spaces and tabs in docs.

comment:11 by nessita <124304+nessita@…>, 4 weeks ago

In 4286a23d:

Refs #36485 -- Removed double spaces after periods in sentences.

comment:12 by nessita <124304+nessita@…>, 4 weeks ago

In f81e6e3:

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.

comment:13 by nessita <124304+nessita@…>, 4 weeks ago

Resolution: fixed
Status: assignedclosed

In 43e4d0a:

Fixed #36485 -- Added lint-docs check in Tox and GitHub Actions.

The check docs target now runs spelling, black, and lint, so all
current documentation quality checks can be run with a single command.

Also documented the lint-docs check's availability and usage.

comment:14 by nessita <124304+nessita@…>, 4 weeks ago

In 9efce80:

Refs #36485 -- Ignored line-length formatting changes in git blame.

comment:15 by GitHub <noreply@…>, 3 weeks ago

In a6271945:

Refs #36485 -- Corrected docs linter to detect too-long lines at file end.

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