Skip to content

Commit 61abe11

Browse files
committed
run-mypy: Remove options that duplicate the mypy configuration.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 5c0f88d commit 61abe11

File tree

1 file changed

+1
-43
lines changed

1 file changed

+1
-43
lines changed

tools/run-mypy

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -112,37 +112,6 @@ parser.add_argument(
112112
help="""run mypy on all python files, ignoring the exclude list.
113113
This is useful if you have to find out which files fail mypy check.""",
114114
)
115-
parser.add_argument(
116-
"--no-disallow-untyped-defs",
117-
dest="disallow_untyped_defs",
118-
action="store_false",
119-
default=True,
120-
help="""Don't throw errors when functions are not annotated""",
121-
)
122-
parser.add_argument(
123-
"--scripts-only",
124-
dest="scripts_only",
125-
action="store_true",
126-
default=False,
127-
help="""Only type check extensionless python scripts""",
128-
)
129-
parser.add_argument(
130-
"--warn-unused-ignores",
131-
dest="warn_unused_ignores",
132-
action="store_true",
133-
default=False,
134-
help="""Use the --warn-unused-ignores flag with mypy""",
135-
)
136-
parser.add_argument(
137-
"--no-ignore-missing-imports",
138-
dest="ignore_missing_imports",
139-
action="store_false",
140-
default=True,
141-
help="""Don't use the --ignore-missing-imports flag with mypy""",
142-
)
143-
parser.add_argument(
144-
"--quick", action="store_true", default=False, help="""Use the --quick flag with mypy"""
145-
)
146115
args = parser.parse_args()
147116

148117
if args.all:
@@ -156,7 +125,6 @@ files_dict = lister.list_files(
156125
modified_only=args.modified,
157126
exclude=exclude + ["stubs"],
158127
group_by_ftype=True,
159-
extless_only=args.scripts_only,
160128
)
161129

162130
for inpath in force_include:
@@ -181,22 +149,12 @@ for file_path in python_files:
181149

182150
mypy_command = "mypy"
183151

184-
extra_args = ["--follow-imports=silent"]
185-
if args.disallow_untyped_defs:
186-
extra_args.append("--disallow-untyped-defs")
187-
if args.warn_unused_ignores:
188-
extra_args.append("--warn-unused-ignores")
189-
if args.ignore_missing_imports:
190-
extra_args.append("--ignore-missing-imports")
191-
if args.quick:
192-
extra_args.append("--quick")
193-
194152
# run mypy
195153
status = 0
196154
for repo, python_files in repo_python_files.items():
197155
print(f"Running mypy for `{repo}`.", flush=True)
198156
if python_files:
199-
result = subprocess.call([mypy_command] + extra_args + python_files)
157+
result = subprocess.call([mypy_command, "--"] + python_files)
200158
if result != 0:
201159
status = result
202160
else:

0 commit comments

Comments
 (0)