-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Clarified strict documentation #18903
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
for more information, see https://pre-commit.ci
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 also fixes/improves documentation aspect of #14143. Thanks!
docs/source/command_line.rst
Outdated
|
||
If both strict and strict-included flags are set, strict does not take precedence | ||
nor override corresponding flags. You can see the list of flags enabled by strict | ||
mode in the full :option:`mypy --help` output. |
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 --warn-unreachable
deserves explicit mention here as something many (most?) of the users should be interested in enabling separately. It may become part of --strict
in future, but isn't now (see #18078)
Co-authored-by: Stanislav Terliakov <[email protected]>
docs/source/command_line.rst
Outdated
If both strict and strict-included flags are set, strict does not take precedence | ||
nor override corresponding flags. You can see the list of flags enabled by strict |
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.
Can this be summarized as "all other error-checking flags have precedence over strict, regardless of the order in which they are passed"?
(that's right, right?)
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 believe you are right, but I think specifying that only the strict-related flags take precedence makes it clearer because they would be otherwise unrelated/wouldn't override. I have updated it to be:
"The strict flag does not take precedence over other strict-related flags. Directly specifying a flag of alternate behavior will override the behavior of strict, regardless of the order in which they are passed."
Although I was going for clarity, does this still seem too verbose?
for more information, see https://pre-commit.ci
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.
LGTM, thank you!
Fixes #18760
This documentation change basically clarifies strict's behavior as described in the issue, adding precedence of the strict flag with respect to other error-checking flags