-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Reorganize command line documentation #5333
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
Reorganize command line documentation #5333
Conversation
7f7032f
to
3da6a9e
Compare
Just for reference, here's what the new sections look like when rendered: Also, sorry about the size of the diff -- I sort of got carried away. FWIW most of the new stuff is in the "running mypy and managing imports" section -- the diff for the "The mypy command line" page is large, but it's mostly just me re-indenting and lightly tweaking existing text. |
I think it would make reviewing much easier to separate the |
@ethanhs: Yeah, I thought about doing that. The only real issue is that the new Also, I was hungry and wanted to go get dinner :/ I can look into splitting it up a little later though -- I suppose we can always just wait on merging until both PRs are approved to avoid temporary out-of-sync-ness. Edit: they're split up now. |
This commit reorganizes our documentation about the command line along with several miscellaneous fixes. In short, I moved the stuff about running mypy/managing imports to a separate file and reorganized the command line section. Specific major changes include: 1. I split up information about running mypy and information about mypy's command line flags into two separate pages: "Running mypy and managing imports" and "The mypy command line". Rationale: I felt the current documentation on running mypy is very dense: it includes a lot of info on managing imports, how mypy discovers files, etc that I think were really only of interest to advanced programmers who are in the middle of trying to get mypy to run on a complex code base. I think splitting up the text into two makes it easier for both beginners and experts to get the info they're looking for. 2. I rewrote the section about how mypy handles the `--ignore-missing-imports` and `--follow-imports` flags (Now located in "Running mypy..." > "How mypy handles imports"). In particular, it more clearly distinguishes how to handle missing imports vs handling imports to files you didn't want type check: the former is applicable to everybody; the latter is only really applicable to people who are progressively adding type hints. 3. I moved information about how mypy searches the file system and resolves imports to the bottom of the "Running mypy..." section. I think most people don't really need that info to start: running `mypy my_whole_codebase` is generally a good starting point. 4. I reorganized the command line section to mirror how the flags are grouped when you run `mypy --help`. Some minor changes: 1. I switched to using [definition lists][0] instead of bullet points to document flags: I think it looks cleaner. 2. I removed the `mypy --help` summary from the command line page: I don't really think anybody was reading that at all. 3. I added documentations about the `--warn-unused-casts`, `-warn-unused-ignores`, `--show-error-contexts`, `--warn-unsed-configs`, and the different report flags. I did *not* document `--cache-fine-grained` and `--memory-xml-report` mostly because I don't actually understand what exactly those do. 4. I added moved the note about integrating mypy into a separate page, and added a brief note about plugins to that page. [0]: https://sphinx-rtd-theme.readthedocs.io/en/latest/demo/lists_tables.html#definition-lists
3da6a9e
to
79a0a18
Compare
This commit adjusts the output of running `mypy --help` to mirror the changes made in python#5333. Specifically, it rearranges the order of the flags slightly and replaces the summary of the flags at the top with a short description of how to use mypy along with links for learning more.
Needed after merge with master.
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.
Looks great! I fixed a few nits. Once tests pass I'll merge.
Thanks again! |
This commit adjusts the output of running `mypy --help` to mirror the changes made in #5333. Specifically, it rearranges the order of the flags slightly and replaces the summary of the flags at the top with a short description of how to use mypy along with links for learning more. It also makes every group title and flag help text start with a capital.
This commit reorganizes our documentation about the command line along with several miscellaneous fixes.
In short, I moved the stuff about running mypy/managing imports to a separate file and reorganized the command line section.
Specific major changes include:
I split up information about running mypy and information about mypy's command line flags into two separate pages: "Running mypy and managing imports" and "The mypy command line".
Rationale: I felt the current documentation on running mypy is very dense: it includes a lot of info on managing imports, how mypy discovers files, etc that I think were really only of interest to advanced programmers who are in the middle of trying to get mypy to run on a complex code base.
I think splitting up the text into two makes it easier for both beginners and experts to get the info they're looking for.
I rewrote the section about how mypy handles the
--ignore-missing-imports
and--follow-imports
flags (Now located in "Running mypy..." > "How mypy handles imports").In particular, it more clearly distinguishes how to handle missing imports vs handling imports to files you didn't want type check: the former is applicable to everybody; the latter is only really applicable to people who are progressively adding type hints.
I moved information about how mypy searches the file system and resolves imports to the bottom of the "Running mypy..." section.
I think most people don't really need that info to start: running
mypy my_whole_codebase
is generally a good starting point.I reorganized the command line section to mirror how the flags are grouped when you run
mypy --help
.Some minor changes:
I switched to using definition lists instead of bullet points to document flags: I think it looks cleaner.
I removed the
mypy --help
summary from the command line page: I don't really think anybody was reading that at all.I added documentations about the
--warn-unused-casts
,-warn-unused-ignores
,--show-error-contexts
,--warn-unsed-configs
, and the different report flags. Those flags were apparently undocumented.I did not document
--cache-fine-grained
and--memory-xml-report
mostly because I don't actually understand what exactly those do.I added moved the note about integrating mypy into a separate page, and added a brief note about plugins to that page.