-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Refactor dmypy files and format dmypy argument parser #19628
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
|
?? pre-commit wiped my style changes |
This comment has been minimized.
This comment has been minimized.
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
|
Thanks for your interest in contributing to mypy! I'm not sure that large cosmetic changes are something the mypy team is interested in. These can be tricky to review, and there are some downsides like damaging the git blame history and the risk of breaking existing behavior (which it look like this change did, going by the test failures). In particular, style changes that aren't compatible with the existing code formatter (black) aren't likely to be accepted, since that creates a future maintanence burden. If you'd like to contribute (which I very much hope you do!), I'd suggest taking a look at some of the open issues tagged good-first-issue or good-second-issue, which can be great ways to get familiar with the codebase to build up to larger issues. You can also check out CONTRIBUTING.md and the Developer Guides for some general contributing guidelines and tips on where to start. |
|
Agree with @brianschubert, especially regarding style changes: we employ |
|
Yeah, sorry, this is not going to happen. |
This PR doesn't benefit users except that more information (argparse description) is displayed in subcommands' help (e.g.
dmypy start -h).Formats argparse code of dmypy like this
It feels maybe redundant to explain the style, but still:
The option options are placed in the first line.
("--log-file", metavar="FILE", type=str,The help has its own line.
help="Direct daemon stdout/stderr to FILE")With these two parts uniformly, visually separated and horizonally aligned, it is easier to understand the options by reading the option options and help text.
Also
mypy/dmypy_(os,server,util).pyare moved todmypydirectory because before it gave me an unsafe feeling thatmypyandmypy.dmypycode might tangle together.Note: I don't know how to test these changes (or if they need tests). The
selfandpytest-fasttests pass but I didn't check others.The main intent is just to make the code readable.