Skip to content

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

Merged
merged 4 commits into from
Jun 6, 2022

Conversation

DanielNoord
Copy link
Collaborator

Type of Changes

Type
βœ“ πŸ“œ Docs

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.

@coveralls
Copy link

coveralls commented May 22, 2022

Pull Request Test Coverage Report for Build 2446647805

  • 9 of 11 (81.82%) changed or added relevant lines in 2 files are covered.
  • 62 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.01%) to 95.52%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pylint/checkers/base_checker.py 3 4 75.0%
pylint/utils/docs.py 6 7 85.71%
Files with Coverage Reduction New Missed Lines %
pylint/checkers/modified_iterating_checker.py 2 97.56%
pylint/config/arguments_manager.py 2 98.22%
pylint/pyreverse/inspector.py 13 76.53%
pylint/checkers/variables.py 22 96.61%
pylint/lint/pylinter.py 23 94.9%
Totals Coverage Status
Change from base Build 2439119251: -0.01%
Covered Lines: 16334
Relevant Lines: 17100

πŸ’› - Coveralls

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a 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 ?

@DanielNoord
Copy link
Collaborator Author

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.

@Pierre-Sassoulas
Copy link
Member

I was quite happy this PR was under 100 lines

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 ?

@DanielNoord
Copy link
Collaborator Author

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 πŸ˜„

@Pierre-Sassoulas
Copy link
Member

OK then let's do #6589 first.

@Pierre-Sassoulas
Copy link
Member

Opened #6678 regarding the generated rst added to the repository.

result = get_rst_title("Pylint global options and switches", "-")
result += """
result = ""
if show_options:
Copy link
Member

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.

Copy link
Member

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)

@Pierre-Sassoulas
Copy link
Member

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 :)

@DanielNoord
Copy link
Collaborator Author

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 πŸ˜“

@Pierre-Sassoulas
Copy link
Member

On the plus side we detected the problem, adding the full output has its perks πŸ˜„

@Pierre-Sassoulas
Copy link
Member

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 πŸ˜„

@DanielNoord
Copy link
Collaborator Author

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 :ref:`checker_name Checker` work?

Anyway, let's merge this PR first and do follow-ups. This already has 1500 changed lines πŸ˜…

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).*
Copy link
Collaborator Author

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...

Copy link
Member

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").

@Pierre-Sassoulas
Copy link
Member

Anyway, let's merge this PR first and do follow-ups

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)

@DanielNoord
Copy link
Collaborator Author

Anyway, let's merge this PR first and do follow-ups

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.

@Pierre-Sassoulas
Copy link
Member

Hm, then we should probably split some of the work here. Perhaps by adding the links first?

Let me open a pre-refactor MR :) !

@DanielNoord
Copy link
Collaborator Author

Btw, perhaps we should draft this and focus on the changelog changes so we can release 2.14?

@DanielNoord DanielNoord marked this pull request as ready for review June 4, 2022 09:22
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2022

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰This comment was generated for commit 501fa08

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a 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.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a 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.

@DanielNoord DanielNoord merged commit 0da426f into pylint-dev:main Jun 6, 2022
@DanielNoord DanielNoord deleted the all-options branch June 6, 2022 08:42
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.

3 participants