Closed Bug 1557103 Opened 5 years ago Closed 4 years ago

[wpt-sync] Sync PR 17189 - [docs] Generate linting docs from source

Categories

(Testing :: web-platform-tests, defect, P4)

defect

Tracking

(firefox72 fixed)

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 17189 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/17189
Details from upstream follow.

Mike Pennisi <mike@mikepennisi.com> wrote:

[docs] Generate linting docs from source

When new rules have been added to WPT's "lint" tool, the corresponding
documentation has not always been updated [1] [2] [3]. The static list
of rules currently describes only 22 of the 53 available rules.
Automatically generating documentation from source code helps avoid this
state and the confusion it can cause contributors.

Rely on the previously-implemented source code structure [4] during
documentation generation to automatically create a listing of all
available linting rules.

Although the Sphinx documentation generator includes a built-in
extension for generating documentation from Python source code, the
output of that extension is designed to document Python primitives such
as functions and classes. Such a format is inappropriate for this case
because the users of the linting tool do not interact with the internals
in this way. Define a custom docutils directive to tailor the
documentation to the needs of its audience.

[1] https://github.com/web-platform-tests/wpt/issues/5299
[2] https://github.com/web-platform-tests/wpt/issues/10501
[3] https://github.com/web-platform-tests/wpt/issues/11479
[4] https://github.com/web-platform-tests/wpt/pull/16268


As noted in the commit message, this nearly doubles the number of documented
linting rules. Over time, we can further improve it by separating out explicit
"to fix" instructions (and maybe even require that new rules do the same).

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/56fc8b1c2e12
[wpt PR 17189] - [docs] Generate linting docs from source, a=testonly
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.