Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
c95306e
failed attempt, very regex-heavy
wyattscarpenter May 9, 2025
5dbb010
ok I mean it works now but it doubles up insertions
wyattscarpenter May 9, 2025
c5c0857
works perfectly
wyattscarpenter May 9, 2025
82eb394
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 9, 2025
15236bd
get the strict flags another way, to make all the tests pass
wyattscarpenter May 9, 2025
4081906
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 9, 2025
b415f0f
generate the strict list in the build dir, so there won't be any funk…
wyattscarpenter May 9, 2025
00580de
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 9, 2025
98bc704
um, I meant srcdir. Sure.
wyattscarpenter May 9, 2025
a546416
bruh
wyattscarpenter May 9, 2025
c044f80
refactor out define_options
wyattscarpenter May 10, 2025
6a47e7d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 10, 2025
9ba2c9b
remove --experimental from dmypy's options after 'a short transition'…
wyattscarpenter May 10, 2025
8087150
move --use-fine-grained-cache to Incremental group
wyattscarpenter May 10, 2025
3a75ee6
create new 'experimental' group, rescuing --enable-incomplete-feature…
wyattscarpenter May 10, 2025
4f1e460
rename Optional arguments to Utility arguments, since all arguments a…
wyattscarpenter May 10, 2025
2a8a8e2
The metavar overrides the default of displaying the choices, so we ha…
wyattscarpenter May 10, 2025
8c61a64
update documentation
wyattscarpenter May 10, 2025
350fd38
update documentation so it's clear that an int field doesn't need to …
wyattscarpenter May 10, 2025
c0aa284
begin to enforce rules, although it's surprisingly failing
wyattscarpenter May 10, 2025
c76183d
continue automating, and correcting
wyattscarpenter May 10, 2025
72f1e5c
blacken
wyattscarpenter May 11, 2025
31dc2ff
remove the concern about links as it no longer seems to be useful
wyattscarpenter May 11, 2025
2c45a29
improve cli formatting error message and also linewrapping
wyattscarpenter May 11, 2025
67dd115
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 11, 2025
185371a
readd link I accidentally deleted
wyattscarpenter May 11, 2025
91233ca
name that occurs in python 3.9
wyattscarpenter May 11, 2025
52d2a4c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 11, 2025
26e221d
fix ci problems (type errors)
wyattscarpenter May 11, 2025
9706862
hold on a minute, this needs an s
wyattscarpenter May 11, 2025
01324aa
my arguments were in the wrong order
wyattscarpenter May 10, 2025
e07a90a
Merge branch 'master' into cli
wyattscarpenter Aug 3, 2025
a3b62b5
Update main.py: fix terminal punctuation
wyattscarpenter Aug 3, 2025
bf0b9a2
don't double-include strict_list.rst
wyattscarpenter Sep 9, 2025
66823b5
Merge branch 'master' into cli
wyattscarpenter Sep 13, 2025
9c8c2a1
Merge branch 'master' into cli
wyattscarpenter Sep 14, 2025
576ebbb
Update mypy/main.py: typo help → helpful
wyattscarpenter Sep 14, 2025
c09118b
Update command_line.rst: instead of moving experimental features up, …
wyattscarpenter Sep 17, 2025
b64e765
Update main.py: instead of moving experimental group up, move it down…
wyattscarpenter Sep 17, 2025
740a3c5
try dedenting, purely to minize diff confusion
wyattscarpenter Sep 17, 2025
6c8d1c8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 17, 2025
764492d
Merge branch 'master' into cli
wyattscarpenter Sep 21, 2025
f4404d0
Split off into own PR and thus Revert "programmatically enforce help …
wyattscarpenter Nov 3, 2025
3c78768
Split off into own PR and thus Revert "Rename optional arguments to u…
wyattscarpenter Nov 3, 2025
7f13ac0
Split off into own PR and thus manually revert the report OUTPUT_DIR …
wyattscarpenter Nov 3, 2025
f470eac
Merge branch 'master' into cli
wyattscarpenter Nov 3, 2025
655fef3
Split off into own PR and thus manually revert the output choices for…
wyattscarpenter Nov 3, 2025
8c2efb4
Split off into own PR and thus Revert "move --use-fine-grained-cache …
wyattscarpenter Nov 3, 2025
a201dc0
edit the description of experimental features
wyattscarpenter Nov 3, 2025
9f41bb7
Merge branch 'master' into cli
wyattscarpenter Nov 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/source/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,9 @@ format into the specified directory.
``mypy[reports]``.


Enabling incomplete/experimental features
.. _enabling-incomplete-experimental-features:

Experimental features
*****************************************

.. option:: --enable-incomplete-feature {PreciseTupleTypes,InlineTypedDict,TypeForm}
Expand Down Expand Up @@ -1217,6 +1219,11 @@ List of currently incomplete/experimental features:
* ``TypeForm``: this feature enables ``TypeForm``, as described in
`PEP 747 – Annotating Type Forms <https://peps.python.org/pep-0747/>_`.

.. option:: --find-occurrences CLASS.MEMBER

This flag will make mypy print out all usages of a class member
based on static type information. This feature is experimental.


Miscellaneous
*************
Expand Down
2 changes: 1 addition & 1 deletion docs/source/html_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _add_strict_list(self) -> None:
):
raise ValueError(f"{strict_part=}, which doesn't look right (by a simple heuristic).")
self.strict_file.write_text(
"For this version of mypy, the list of flags enabled by strict is: " + strict_part
"For this version of mypy, the flags enabled by strict are: " + strict_part
)

def _verify_error_codes(self) -> None:
Expand Down
37 changes: 24 additions & 13 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,12 +1115,6 @@ def add_invertible_flag(
internals_group.add_argument(
"--disable-expression-cache", action="store_true", help=argparse.SUPPRESS
)
parser.add_argument(
"--enable-incomplete-feature",
action="append",
metavar="{" + ",".join(sorted(INCOMPLETE_FEATURES)) + "}",
help="Enable support of incomplete/experimental features for early preview",
)
internals_group.add_argument(
"--custom-typeshed-dir", metavar="DIR", help="Use the custom typeshed in DIR"
)
Expand Down Expand Up @@ -1173,6 +1167,28 @@ def add_invertible_flag(
"--skip-c-gen", dest="mypyc_skip_c_generation", action="store_true", help=argparse.SUPPRESS
)

experimental_group = parser.add_argument_group(
title="Experimental options",
description="Enable features that work well enough to be useful,"
+ " but perhaps not as well as you might wish."
+ " These features may be enabled by default in the future,"
+ " or may be made non-experimental."
+ " Experimental features that are better described in some other context"
+ " may be documented in some other place instead.",
)
experimental_group.add_argument(
"--enable-incomplete-feature",
action="append",
metavar="{" + ",".join(sorted(INCOMPLETE_FEATURES)) + "}",
help="Enable support of incomplete/experimental features for early preview",
)
experimental_group.add_argument(
"--find-occurrences",
metavar="CLASS.MEMBER",
dest="special-opts:find_occurrences",
help="Print out all usages of a class member",
)

misc_group = parser.add_argument_group(title="Miscellaneous")
misc_group.add_argument("--quickstart-file", help=argparse.SUPPRESS)
misc_group.add_argument(
Expand All @@ -1186,12 +1202,6 @@ def add_invertible_flag(
default="global",
help="If --junit-xml is set, specifies format. global (default): single test with all errors; per_file: one test entry per file with failures",
)
misc_group.add_argument(
"--find-occurrences",
metavar="CLASS.MEMBER",
dest="special-opts:find_occurrences",
help="Print out all usages of a class member (experimental)",
)
misc_group.add_argument(
"--scripts-are-modules",
action="store_true",
Expand Down Expand Up @@ -1549,7 +1559,8 @@ def set_strict_flags() -> None:
reason = cache.find_module(p)
if reason is ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS:
fail(
f"Package '{p}' cannot be type checked due to missing py.typed marker. See https://mypy.readthedocs.io/en/stable/installed_packages.html for more details",
f"Package '{p}' cannot be type checked due to missing py.typed marker."
+ " See https://mypy.readthedocs.io/en/stable/installed_packages.html for more details",
stderr,
options,
)
Expand Down