Skip to content

Commit 8d02b47

Browse files
authored
dmypy: warn instead of failing if report generation is configured (#10181)
### Description Log a warning instead of failing when `dmypy run` is called on a project that has report generation configured via setup.cfg Resolves #10118 ## Test Plan 1. Built package locally 2. Installed into my virtualenv 3. Created test project with mypy.ini contents: ```ini [mypy] html_report = build/html ``` 1. Ran `dmypy run .` Result: ``` dmypy run . dmypy: ignoring report generation settings. Start/restart cannot generate reports. Daemon started ```
1 parent 8c8d169 commit 8d02b47

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mypy/dmypy_server.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,11 @@ def process_start_options(flags: List[str], allow_sources: bool) -> Options:
135135
['-i'] + flags, require_targets=False, server_options=True
136136
)
137137
if options.report_dirs:
138-
sys.exit("dmypy: start/restart cannot generate reports")
138+
print("dmypy: Ignoring report generation settings. Start/restart cannot generate reports.")
139139
if options.junit_xml:
140-
sys.exit("dmypy: start/restart does not support --junit-xml; "
141-
"pass it to check/recheck instead")
140+
print("dmypy: Ignoring report generation settings. "
141+
"Start/restart does not support --junit-xml. Pass it to check/recheck instead")
142+
options.junit_xml = None
142143
if not options.incremental:
143144
sys.exit("dmypy: start/restart should not disable incremental mode")
144145
if options.follow_imports not in ('skip', 'error', 'normal'):

0 commit comments

Comments
 (0)