Skip to content

Commit a07812d

Browse files
authored
Fail fast when user tries to generate reports with parallel workers (#21341)
This is not supported, and support is somewhat non-trivial, so fail fast instead of generating incomplete/empty reports.
1 parent 07e4612 commit a07812d

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

mypy/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,14 @@ def main(
101101
# Supporting both parsers would be really tricky, so just support the new one.
102102
options.native_parser = True
103103
if options.cache_dir == os.devnull:
104-
fail("error: cache must be enabled in parallel mode", stderr, options)
104+
fail("error: Cache must be enabled in parallel mode", stderr, options)
105+
if options.report_dirs:
106+
fail(
107+
"error: Reports are not supported in parallel mode yet\n"
108+
"note: Use -n0 to disable parallel checking",
109+
stderr,
110+
options,
111+
)
105112

106113
if options.allow_redefinition and not options.local_partial_types:
107114
fail(

test-data/unit/cmdline.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ a.py:1: error: Simple statements must be separated by newlines or semicolons
12821282
[file a.py]
12831283
pass
12841284
[out]
1285-
error: cache must be enabled in parallel mode
1285+
error: Cache must be enabled in parallel mode
12861286
== Return code: 2
12871287

12881288
[case testCheckingStubPackagesWorksInParallelMode]

0 commit comments

Comments
 (0)