Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor lint rules #16268

Merged
merged 2 commits into from Apr 19, 2019
Merged

Conversation

jugglinmike
Copy link
Contributor

As described in gh-15824, we're revamping WPT's documentation in a fork of the project. We'd like to automatically generate rules for the project's linter, and that requires some change to the source code. In the initial proposal for that improvement, @jgraham wrote:

This approach looks good. Please endeavour to land the lint changes upstream rather than in a docs branch, even if the motivating documentation isn't ready yet, otherwise there's a severe chance of conflicts which in this case would likely lead to regressing whole lint rules.

This is the requested change.

Because not all rules are backed with unit tests, the first commit in this patch improves coverage. Two rules remain uncovered:

Introduce additional structure to the definition of linting rules. This
change is in support of a planned improvement to the project's
documentation generator; this structure will allow user documentation to
be generated procedurally from the source code.
@jugglinmike
Copy link
Contributor Author

Rebased over gh-16349. @gsnedders can you please review and merge if this looks good to you?

@gsnedders gsnedders merged commit 4657e10 into web-platform-tests:master Apr 19, 2019
@jugglinmike
Copy link
Contributor Author

Thanks!

jugglinmike added a commit to bocoup/wpt that referenced this pull request Jun 5, 2019
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] web-platform-tests#5299
[2] web-platform-tests#10501
[3] web-platform-tests#11479
[4] web-platform-tests#16268
jugglinmike added a commit to bocoup/wpt that referenced this pull request Jun 5, 2019
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] web-platform-tests#5299
[2] web-platform-tests#10501
[3] web-platform-tests#11479
[4] web-platform-tests#16268
jugglinmike added a commit to bocoup/wpt that referenced this pull request Sep 5, 2019
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] web-platform-tests#5299
[2] web-platform-tests#10501
[3] web-platform-tests#11479
[4] web-platform-tests#16268
jugglinmike added a commit to bocoup/wpt that referenced this pull request Nov 11, 2019
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] web-platform-tests#5299
[2] web-platform-tests#10501
[3] web-platform-tests#11479
[4] web-platform-tests#16268
jugglinmike added a commit that referenced this pull request Nov 14, 2019
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] #5299
[2] #10501
[3] #11479
[4] #16268
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 29, 2019
…, a=testonly

Automatic update from web-platform-tests
[docs] Generate linting docs from source (#17189)

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] web-platform-tests/wpt#5299
[2] web-platform-tests/wpt#10501
[3] web-platform-tests/wpt#11479
[4] web-platform-tests/wpt#16268
--

wpt-commits: 204072e843f69e3a13628c01a928ea99aebed978
wpt-pr: 17189
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request Nov 29, 2019
…, a=testonly

Automatic update from web-platform-tests
[docs] Generate linting docs from source (#17189)

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] web-platform-tests/wpt#5299
[2] web-platform-tests/wpt#10501
[3] web-platform-tests/wpt#11479
[4] web-platform-tests/wpt#16268
--

wpt-commits: 204072e843f69e3a13628c01a928ea99aebed978
wpt-pr: 17189
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Nov 30, 2019
…, a=testonly

Automatic update from web-platform-tests
[docs] Generate linting docs from source (#17189)

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] web-platform-tests/wpt#5299
[2] web-platform-tests/wpt#10501
[3] web-platform-tests/wpt#11479
[4] web-platform-tests/wpt#16268
--

wpt-commits: 204072e843f69e3a13628c01a928ea99aebed978
wpt-pr: 17189

UltraBlame original commit: 56fc8b1c2e129a595c1bee4822ea5c07ee630404
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Nov 30, 2019
…, a=testonly

Automatic update from web-platform-tests
[docs] Generate linting docs from source (#17189)

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] web-platform-tests/wpt#5299
[2] web-platform-tests/wpt#10501
[3] web-platform-tests/wpt#11479
[4] web-platform-tests/wpt#16268
--

wpt-commits: 204072e843f69e3a13628c01a928ea99aebed978
wpt-pr: 17189

UltraBlame original commit: 56fc8b1c2e129a595c1bee4822ea5c07ee630404
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Nov 30, 2019
…, a=testonly

Automatic update from web-platform-tests
[docs] Generate linting docs from source (#17189)

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] web-platform-tests/wpt#5299
[2] web-platform-tests/wpt#10501
[3] web-platform-tests/wpt#11479
[4] web-platform-tests/wpt#16268
--

wpt-commits: 204072e843f69e3a13628c01a928ea99aebed978
wpt-pr: 17189

UltraBlame original commit: 56fc8b1c2e129a595c1bee4822ea5c07ee630404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants