Skip to content

Commit b2997fe

Browse files
committed
added flag for plugin args
Signed-off-by: Dibri Nsofor <[email protected]>
1 parent 7788c21 commit b2997fe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mypy/main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,12 @@ def add_invertible_flag(
10031003
action="store_true",
10041004
help="Skip cache internal consistency checks based on mtime",
10051005
)
1006+
incremental_group.add_argument(
1007+
"--plugins",
1008+
nargs='*',
1009+
dest="special-opts:cli_plugins",
1010+
help="Include user defined plugins during Mypy's type analysis",
1011+
)
10061012

10071013
internals_group = parser.add_argument_group(
10081014
title="Advanced options", description="Debug and customize mypy internals."
@@ -1291,6 +1297,10 @@ def set_strict_flags() -> None:
12911297
special_opts = argparse.Namespace()
12921298
parser.parse_args(args, SplitNamespace(options, special_opts, "special-opts:"))
12931299

1300+
# Parse extra plugins passed via cli args
1301+
if special_opts.cli_plugins:
1302+
options.plugins.extend(special_opts.cli_plugins)
1303+
12941304
# The python_version is either the default, which can be overridden via a config file,
12951305
# or stored in special_opts and is passed via the command line.
12961306
options.python_version = special_opts.python_version or options.python_version

0 commit comments

Comments
 (0)