-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove redundant options documentation and improve formatting #6665
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
Conversation
Pull Request Test Coverage Report for Build 2446647805
π - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to add the generated file(s?) to the repository (as we did for the messages list) in order to see what changed because the review is really hardcore otherwise π We could auto-update them for release with tbump too. What do you think ?
Agreed! But perhaps let's do that after the current rework is done? I was quite happy this PR was under 100 lines and I tend to look at the final output in RTD anyway when reviewing these PRs. |
Yeah sure this PR is quite elegant π We don't have to ruin it though, we can add the generated file from another one and rebase on main when it's merged. It's just a lot harder to check everything when you need to compare two HTMLs side by side instead, of a a git diff on .rst code then check the modified HTML visually. Do you want me to add the generated file in another PR ? |
Yeah, but I would wait with adding the generated file right now. It's just more stuff we potentially need to move around during the renaming process. We shouldn't really need to touch these generate files at this point anyway π |
OK then let's do #6589 first. |
7e0c2cf
to
8b31ac7
Compare
Opened #6678 regarding the generated rst added to the repository. |
result = get_rst_title("Pylint global options and switches", "-") | ||
result += """ | ||
result = "" | ||
if show_options: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to suggest a function but it's easier if I do the commit directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Beside we can check that the refactor is not changing the behavior easily as we have the full generated output in the repo)
Found an issue when the default value is the current interpreter in all-options.rst: -**Default:** ``(3, 10)``
+**Default:** ``(3, 8)``
- py-version = [3, 10]
+ py-version = [3, 8] My interpreter is 3.8, yours is probably 3.10 :) |
That should probably be fixed in a follow-up PR. We need to special case it I guess... Annoying π |
On the plus side we detected the problem, adding the full output has its perks π |
I want to add link between section, I think we'll need to do a refactor first. There's issue with the doc generation because we have a string for the checker name instead of the checker so it's hard to do the right ref between extension and standard checker. I can push the work in progress if you're interested or simply want to understand what I'm talking about π |
I understand what you are talking about, but wouldn't Anyway, let's merge this PR first and do follow-ups. This already has 1500 changed lines π |
doc/exts/pylint_options.py
Outdated
def _get_checker_title(checker: str) -> str: | ||
result = _get_checker_configuration_rst_anchor(checker) | ||
result += get_rst_title(f"``{checker.capitalize()}`` **Checker**", "-") | ||
result += f":ref:`See the description of the checker itself <pylint.extensions.{checker}>`.\n\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result += f":ref:`See the description of the checker itself <pylint.extensions.{checker}>`.\n\n" | |
result += f":ref:`See the description of the checker itself <pylint.extensions.{checker}>`.\n\n" |
Here with a string we can't know if the checker is a pylint extension or a standard checker.
@@ -1192,7 +1240,7 @@ Standard Checkers | |||
|
|||
--spelling-dict | |||
""""""""""""""" | |||
*Spelling dictionary name. Available dictionaries: af (aspell), am (aspell), ar (aspell), ast (aspell), az (aspell), be (aspell), be_BY (aspell), be_SU (aspell), bg (aspell), bn (aspell), br (aspell), ca (aspell), cs (aspell), csb (aspell), cy (aspell), da (aspell), de (aspell), de_AT (aspell), de_CH (aspell), de_DE (aspell), el (aspell), en (aspell), en_AU (aspell), en_CA (aspell), en_GB (aspell), en_US (aspell), eo (aspell), es (aspell), es_ES (AppleSpell), et (aspell), fa (aspell), fi (aspell), fo (aspell), fr (aspell), fr_CH (aspell), fr_FR (aspell), fy (aspell), ga (aspell), gd (aspell), gl (aspell), gr (aspell), grc (aspell), gu (aspell), gv (aspell), he (aspell), hi (aspell), hil (aspell), hr (aspell), hsb (aspell), hu (aspell), hu_HU (AppleSpell), hus (aspell), hy (aspell), ia (aspell), id (aspell), it (aspell), it_IT (AppleSpell), kn (aspell), ku (aspell), ky (aspell), la (aspell), lt (aspell), lv (aspell), mg (aspell), mi (aspell), mk (aspell), ml (aspell), mn (aspell), mr (aspell), ms (aspell), mt (aspell), nds (aspell), nl (aspell), nl_NL (AppleSpell), nn (aspell), ny (aspell), or (aspell), pa (aspell), pl (aspell), pt_BR (aspell), pt_PT (aspell), qu (aspell), ro (aspell), ru (aspell), rw (aspell), sc (aspell), sk (aspell), sk_SK (aspell), sl (aspell), sr (aspell), srd (aspell), sv (aspell), sv_SE (AppleSpell), sw (aspell), ta (aspell), te (aspell), tet (aspell), tk (aspell), tl (aspell), tn (aspell), tr (aspell), uk (aspell), uz (aspell), vi (aspell), wa (aspell), yi (aspell), zu (aspell).* | |||
*Spelling dictionary name. Available dictionaries: en_GB (aspell), en_US (hunspell), en_AU (aspell), en (aspell), en_CA (aspell).* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another problematic default value. I'm starting to doubt whether we should in fact include these generated files...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really problematic if the generated file change a little (In fact I could have avoided adding this by doing a partial add). The fact is it permits to see the doc depends on the generator's operating system which it should not, so imo it's a good think that it makes problem apparent. (We can fix it later, should be something like "depends on your operating system" or "default to your current interpreter").
We're removing the information from the page so we should probably add a link to where the information are at, right ? Otherwise it's really hard to find the option / message generated. (I thought of a follow-up where I'd add the link the to the message overview in the message list of the extension page) |
Hm, then we should probably split some of the work here. Perhaps by adding the links first? I'm losing track of the refactors, added TODOs and actual changes that are in this PR. |
Let me open a pre-refactor MR :) ! |
Btw, perhaps we should draft this and focus on the changelog changes so we can release |
fdd3774
to
107fe0e
Compare
π€ According to the primer, this change has no effect on the checked open source code. π€πThis comment was generated for commit 501fa08 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to add a link to the option page of the checker, did you try :ref:`checker_name Checker
like you suggested earlier ? I'm going to continue working on the doc for some time. Mainly links between section for easier navigability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look neat ! I have a suggestion for the text of the link, let me know what you think.
Co-authored-by: Pierre Sassoulas <[email protected]>
Type of Changes
Description
@Pierre-Sassoulas Potentially do this before #6589. I tried to improve the formatting of the options page a little bit. After this we can do one more PR that removes the
pylint features
page all together I think.