-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Document each rule separately #1056
Comments
+1 |
+1 |
They have a MarkDown by each rule: https://github.com/eslint/eslint/tree/master/docs/rules |
I was more thinking about the markdown file itself, seems handcrafted to me: |
Are the msgs dict in the checked assembed into some data structure in pylint? If so, could we perhaps use that as a base to generate some markdown table with all the warnings that pylint can generate. Even if it's not similar to what ESLint has it's a small step in that direction, still better than nothing. |
We already do that. That is how https://pylint.readthedocs.io/en/latest/features.html is generated, completely automatic. The problem is we cannot go too much in details when documenting a rule, since the initial purpose of the structure we are using is to show a short help message when calling |
Perhaps as a start you don't have to go into too much details on each and every rule. Those that need some clarification could get a manual markdown file as need araise, somewhere in the code tree.The https://pylint.readthedocs.io/en/latest/features.html generator can look through that directory and create a link if a matching markdown file exists. |
This could work, we could generate those files when building the documentation, using as a content the help message. If the files already exist, we can assume they are already updated, thus we can go and put additional information where necessary. |
or you could have a separate page with 'clarifications' for the rules that need it and the docs could link to those clarifications if they exist. That way you would only need to maintain the clarifications and still generate the 'normal' rules information. |
I would incline to have them separated, rather than going with a clarifications page. Anyway, the generation is kind of easy, we just need to implement it based on the current features.rst generation. |
You mean to just augment the current features page with at least one new section for each rule with examples, clarifications, and when the rule in its current form was introduced in pylint. Correct? I'm not sure what you want/mean there... |
Oh, sorry about being confusing. What I was suggesting was something along these lines:
|
We can do a better job at documenting our rules. Currently we're employing an automatic approach, in which we generate a restructuredText document from the help messages of the rules, but this means we can't explain them properly, we can't put actual examples in the help messages and we can't version them (when they were added, removed etc)
We can take same inspiration from how the folks from ESLint are doing things: http://eslint.org/docs/rules/
The text was updated successfully, but these errors were encountered: