Skip to content

Commit 8b0041d

Browse files
committed
Enable --pretty by default for better error messages
Changed the default value of --pretty from False to True to provide visually nicer output by default. Users can still disable it with --no-pretty if they prefer more concise error messages. Updated defaults in: - mypy/options.py: Changed self.pretty = False to True - mypy/main.py: Changed default=False to default=True for --pretty flag - docs/source/command_line.rst: Added note about default and --no-pretty Fixes python#19108
1 parent 3143ad5 commit 8b0041d

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎docs/source/command_line.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,7 @@ in error messages.
937937

938938
Use visually nicer output in error messages: use soft word wrap,
939939
show source code snippets, and show error location markers.
940+
This is enabled by default. Use :option:`--no-pretty` to disable.
940941

941942
.. option:: --no-color-output
942943

‎mypy/main.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ def add_invertible_flag(
10071007
)
10081008
add_invertible_flag(
10091009
"--pretty",
1010-
default=False,
1010+
default=True,
10111011
help="Use visually nicer output in error messages:"
10121012
" Use soft word wrap, show source code snippets,"
10131013
" and show error location markers",

‎mypy/options.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ def __init__(self) -> None:
365365
self.hide_error_codes = False
366366
self.show_error_code_links = False
367367
# Use soft word wrap and show trimmed source snippets with error location markers.
368-
self.pretty = False
368+
self.pretty = True
369369
self.dump_graph = False
370370
self.dump_deps = False
371371
self.logical_deps = False

0 commit comments

Comments
 (0)