Skip to content

Commit 9e305da

Browse files
committed
renamed flag, updated docs, rewrote logic -- replaced nargs with str opt
Signed-off-by: Dibri Nsofor <[email protected]>
1 parent f57dcde commit 9e305da

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/source/command_line.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ in developing or debugging mypy internals.
888888
This flag will invoke the Python debugger when mypy encounters
889889
a fatal error.
890890

891-
.. option:: --plugins {MODULE|PLUGIN_FILE} ...
891+
.. option:: --extend-plugins {MODULE|PLUGIN_FILE} ...
892892

893893
This flag acts as a supplementary way to pass (a list of) plugins to customize
894894
Mypy's type checking approach. See :ref:`extending-mypy` for more details.

mypy/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,8 +1009,9 @@ def add_invertible_flag(
10091009
)
10101010
internals_group.add_argument("--pdb", action="store_true", help="Invoke pdb on fatal error")
10111011
internals_group.add_argument(
1012-
"--plugins",
1013-
nargs="*",
1012+
"--extend-plugins", "--ep",
1013+
type=lambda s: [item.strip() for item in s.split(',')],
1014+
metavar="{MODULE|PLUGIN_FILE}",
10141015
dest="special-opts:cli_plugins",
10151016
help="Include user defined plugins during Mypy's type analysis",
10161017
)
@@ -1300,6 +1301,7 @@ def set_strict_flags() -> None:
13001301
# Parse extra plugins passed via cli args
13011302
if special_opts.cli_plugins:
13021303
options.plugins.extend(special_opts.cli_plugins)
1304+
print(special_opts.cli_plugins)
13031305

13041306
# The python_version is either the default, which can be overridden via a config file,
13051307
# or stored in special_opts and is passed via the command line.

0 commit comments

Comments
 (0)