-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[docs] Include a real listing of the flags strict enables in the online documentation #19062
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
base: master
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
This comment has been minimized.
This comment has been minimized.
for more information, see https://pre-commit.ci
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I remembered that sometimes this documentation gets processed into other formats, like a man page. I'm not sure what the process is there, but let's save them a little potential embarassment of introducing but not having a list
without loss of generality
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
|
||
def write_doc(self, docname: str, doctree: document) -> None: | ||
super().write_doc(docname, doctree) | ||
self._ref_to_doc.update({_id: docname for _id in doctree.ids}) | ||
|
||
def _add_strict_list(self) -> None: | ||
strict_flags: list[str] |
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.
Why is this explicit decl necessary?
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, I just left it in to document the type. What with define_options being so far away and us only using the middle of its tuple. I don't feel strongly about it one way or the other 🤷
return parser, strict_flag_names, strict_flag_assignments | ||
|
||
|
||
def process_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.
Amazing, this func that contains some real logic is only 200 LOC now, much better than 1000+ to scroll!
Fixes #19061
Currently, https://mypy.readthedocs.io/en/stable/command_line.html just says
Which makes cross-referencing the documentation difficult. Instead, there should be the same list there as appears when running
mypy --help
: egIdeally this section would be automatically generated from the code.
This pull request accomplishes this.