From 10ad5f88a282535af09fe38a3ddaf09ac52768c2 Mon Sep 17 00:00:00 2001 From: lenayoung8 <153099057+lenayoung8@users.noreply.github.com> Date: Tue, 8 Apr 2025 14:13:05 -0400 Subject: [PATCH 1/7] Clarified strict documentation --- docs/source/command_line.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index 2a54c1144171..f95c8a22d202 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -749,12 +749,18 @@ of the above sections. .. option:: --strict - This flag mode enables all optional error checking flags. You can see the - list of flags enabled by strict mode in the full :option:`mypy --help` output. + This flag mode enables a defined subset of optional error-checking flags. + This subset primarily includes checks for inadvertent type unsoundness (i.e + strict will catch type errors as long as intentional methods like type ignore + or casting were not used.) - Note: the exact list of flags enabled by running :option:`--strict` may change - over time. + 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. + Note: the exact list of flags enabled by running :option:`--strict` may change + over time. + .. option:: --disable-error-code This flag allows disabling one or multiple error codes globally. From 33305cd7ec63c967e81b113dc681acd4c17a2481 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 18:22:30 +0000 Subject: [PATCH 2/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/source/command_line.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index f95c8a22d202..fadf590fa365 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -749,18 +749,18 @@ of the above sections. .. option:: --strict - This flag mode enables a defined subset of optional error-checking flags. - This subset primarily includes checks for inadvertent type unsoundness (i.e + This flag mode enables a defined subset of optional error-checking flags. + This subset primarily includes checks for inadvertent type unsoundness (i.e strict will catch type errors as long as intentional methods like type ignore or casting were not used.) 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 + nor override corresponding flags. You can see the list of flags enabled by strict mode in the full :option:`mypy --help` output. - Note: the exact list of flags enabled by running :option:`--strict` may change + Note: the exact list of flags enabled by running :option:`--strict` may change over time. - + .. option:: --disable-error-code This flag allows disabling one or multiple error codes globally. From 94a13ed91ee9663e7289a2c75a4da0c334389549 Mon Sep 17 00:00:00 2001 From: lenayoung8 <153099057+lenayoung8@users.noreply.github.com> Date: Tue, 8 Apr 2025 15:26:04 -0400 Subject: [PATCH 3/7] Added note about --warn-unreachable --- docs/source/command_line.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index fadf590fa365..9b35868a2a04 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -754,6 +754,9 @@ of the above sections. strict will catch type errors as long as intentional methods like type ignore or casting were not used.) + Note: the --warn-unreachable flag documented in :option:`--warn-unreadhable` + is not automatically enabled by the strict flag. + 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. From 733ac09a8098100b5b87bbe3d801469babfa1472 Mon Sep 17 00:00:00 2001 From: lenayoung8 <153099057+lenayoung8@users.noreply.github.com> Date: Tue, 8 Apr 2025 15:28:35 -0400 Subject: [PATCH 4/7] Update command_line.rst --- docs/source/command_line.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index 9b35868a2a04..2391e0064fea 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -754,7 +754,7 @@ of the above sections. strict will catch type errors as long as intentional methods like type ignore or casting were not used.) - Note: the --warn-unreachable flag documented in :option:`--warn-unreadhable` + Note: the --warn-unreachable flag documented in :option:`--warn-unreachable` is not automatically enabled by the strict flag. If both strict and strict-included flags are set, strict does not take precedence From f6aa39d441bae3de681ff2390a435a620914ee9d Mon Sep 17 00:00:00 2001 From: lenayoung8 <153099057+lenayoung8@users.noreply.github.com> Date: Tue, 8 Apr 2025 16:39:26 -0400 Subject: [PATCH 5/7] Update docs/source/command_line.rst Co-authored-by: Stanislav Terliakov <50529348+sterliakov@users.noreply.github.com> --- docs/source/command_line.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index 2391e0064fea..ebde9f097d6e 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -754,7 +754,7 @@ of the above sections. strict will catch type errors as long as intentional methods like type ignore or casting were not used.) - Note: the --warn-unreachable flag documented in :option:`--warn-unreachable` + Note: the :option:`--warn-unreachable` flag is not automatically enabled by the strict flag. If both strict and strict-included flags are set, strict does not take precedence From 9ddaf9359946cd338604e3675b6b8e55e4023f93 Mon Sep 17 00:00:00 2001 From: lenayoung8 <153099057+lenayoung8@users.noreply.github.com> Date: Wed, 9 Apr 2025 09:04:13 -0400 Subject: [PATCH 6/7] Updated precedence line --- docs/source/command_line.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index ebde9f097d6e..de4cc4cd4ef4 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -757,9 +757,11 @@ of the above sections. Note: the :option:`--warn-unreachable` flag is not automatically enabled by the strict flag. - 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. + 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. + You can see the list of flags enabled by strict mode in the full + :option:`mypy --help` output. Note: the exact list of flags enabled by running :option:`--strict` may change over time. From 4c100c3f200f5cebffa176c972a3b0d00356d70a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 13:05:34 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/source/command_line.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index de4cc4cd4ef4..b455e287017e 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -757,8 +757,8 @@ of the above sections. Note: the :option:`--warn-unreachable` flag is not automatically enabled by the strict flag. - The strict flag does not take precedence over other strict-related flags. - Directly specifying a flag of alternate behavior will override the + 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. You can see the list of flags enabled by strict mode in the full :option:`mypy --help` output.