Stand up restructuredtext-lint to catch problems in our documentation early
Categories
(Firefox Build System :: Documentation Infrastructure, enhancement)
Tracking
(firefox70 fixed)
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: ahal, Assigned: championshuttler)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Rst is not the easiest markup language to dive into. It would be great if we could catch common problems early with a linter. I found:
https://github.com/twolfson/restructuredtext-lint
There is a bit of documentation on standing up new linters here:
https://firefox-source-docs.mozilla.org/tools/lint/create.html
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Comment 2•3 years ago
•
|
||
Here are some tips for how I would go about completing this bug:
-
Create a dummy linter that just returns a hardcoded error. This can be the scaffolding you build off of. Make sure you can run it with:
./mach lint -l rst
This creates the scaffolding and gives you an easy way to test.
-
Figure out how to bootstrap the
restructured_text
linter. You can copy theflake8
mechanism for this (i.e checkin a requirements.txt into the tree). You can use thehashin
library to generate the hashes. -
Implement the linter. This will importing
restructuredtext_lint
, running it on the specified files, and returning the results. You can use other linters as examples. -
Define custom roles. Restructured text uses something called "roles". Sphinx has a bunch of custom roles that aren't in the main spec, so we'll need to tell the linter about them. You can see more info here:
https://github.com/twolfson/restructuredtext-lint#extension
Assignee | ||
Comment 3•3 years ago
|
||
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/180fb2c33c4b Setup rst linter for the documentation. r=ahal
Comment 5•3 years ago
|
||
bugherder |
Description
•