This repository has been archived by the owner on Oct 23, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When new rules have been added to WPT's "lint" tool, the corresponding
documentation has not always been updated [1] [2] [3]. Automatically
generating documentation from source code helps avoid this state and the
confusion it can cause contributors.
Introduce a pattern for defining linting rules. Rely on the new
structure during documentation generation to automatically create a
listing of all available linting rules.
The new structure centralizes information about the rules (name,
description, and instructions for correcting infractions). The process
honors the existing convention of Markdown within descriptions.
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] web-platform-tests/wpt#5299
[2] web-platform-tests/wpt#10501
[3] web-platform-tests/wpt#11479
This is intended to resolve gh-4.
@zcorpan @jgraham @gsnedders @marcoscaceres I'm demoing this with two rules,
but I'll be happy to migrate the rest of the rules to this format if the
general solution looks good to you. Here's a screen shot of the rendered
output:
What do you think?