Skip to content

Commit c32dfe5

Browse files
committed
Improve strict not supported in inline config error message
1 parent 2684385 commit c32dfe5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

mypy/config_parser.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,11 @@ def set_strict_flags() -> None:
343343
if reports:
344344
errors.append((lineno, "Reports not supported in inline configuration"))
345345
if strict_found:
346-
errors.append((lineno, "Setting 'strict' not supported in inline configuration"))
346+
errors.append((lineno,
347+
"Setting 'strict' not supported in inline configuration: specify it in "
348+
"a configuration file instead, or set individual inline flags "
349+
"(see 'mypy -h' for the list of flags enabled in strict mode)"))
350+
347351
sections.update(new_sections)
348352

349353
return sections, errors

test-data/unit/check-inline-config.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,4 @@ main:1: error: Unrecognized option: skip_file = True
161161
[case testInlineStrict]
162162
# mypy: strict
163163
[out]
164-
main:1: error: Setting 'strict' not supported in inline configuration
164+
main:1: error: Setting 'strict' not supported in inline configuration: specify it in a configuration file instead, or set individual inline flags (see 'mypy -h' for the list of flags enabled in strict mode)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy