Skip to content

Commit e60744f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8214b19 commit e60744f

File tree

7 files changed

+22
-25
lines changed

7 files changed

+22
-25
lines changed

mypy/main.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,16 +1019,13 @@ def add_invertible_flag(
10191019
help=argparse.SUPPRESS,
10201020
)
10211021
error_group.add_argument(
1022-
'--no-pretty',
1023-
action='store_false',
1024-
dest='pretty',
1025-
help='Disable pretty error messages (pretty is now the default).'
1022+
"--no-pretty",
1023+
action="store_false",
1024+
dest="pretty",
1025+
help="Disable pretty error messages (pretty is now the default).",
10261026
)
10271027
error_group.add_argument(
1028-
'--pretty',
1029-
action='store_true',
1030-
dest='pretty',
1031-
help=argparse.SUPPRESS
1028+
"--pretty", action="store_true", dest="pretty", help=argparse.SUPPRESS
10321029
)
10331030

10341031
incremental_group = parser.add_argument_group(

mypy/test/helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ def parse_options(
342342

343343
if flags:
344344
flag_list = flags.group(1).split()
345-
if '--pretty' not in flag_list:
346-
flag_list.append('--no-pretty')
345+
if "--pretty" not in flag_list:
346+
flag_list.append("--no-pretty")
347347
flag_list.append("--no-site-packages") # the tests shouldn't need an installed Python
348348
targets, options = process_options(flag_list, require_targets=False)
349349
if targets:
@@ -357,7 +357,7 @@ def parse_options(
357357
options.error_summary = False
358358
options.hide_error_codes = True
359359
options.force_union_syntax = True
360-
flag_list = ['--no-pretty']
360+
flag_list = ["--no-pretty"]
361361

362362
# Allow custom python version to override testfile_pyversion.
363363
if all(flag.split("=")[0] != "--python-version" for flag in flag_list):

mypy/test/testcmdline.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ def parse_args(line: str) -> list[str]:
131131
"""
132132
m = re.match("# cmd: mypy (.*)$", line)
133133
if not m:
134-
return ['--no-pretty'] # No args; mypy will spit out an error.
134+
return ["--no-pretty"] # No args; mypy will spit out an error.
135135
args = m.group(1).split()
136-
137-
if '--pretty' not in args:
138-
args.append('--no-pretty')
136+
137+
if "--pretty" not in args:
138+
args.append("--no-pretty")
139139

140140
return args
141141

mypy/test/testdaemon.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ def run_cmd(input: str) -> tuple[int, str]:
8080
if input[1:].startswith("mypy run --") and "--show-error-codes" not in input:
8181
input += " --hide-error-codes"
8282
is_pretty_test = "# NO-MODIFY" in input
83-
modified_input = input.replace('# NO-MODIFY', '').strip()
84-
cond1 = '--pretty' not in modified_input
83+
modified_input = input.replace("# NO-MODIFY", "").strip()
84+
cond1 = "--pretty" not in modified_input
8585
cond2 = modified_input.startswith(("dmypy run", "dmypy check"))
8686
cond3 = not is_pretty_test
8787
if cond1 and cond2 and cond3:
88-
parts = modified_input.split(' ', 2)
88+
parts = modified_input.split(" ", 2)
8989
command, subcommand = parts[0], parts[1]
9090
args = parts[2] if len(parts) > 2 else ""
9191
input = f"{command} {subcommand} {args} --no-pretty".strip()

mypy/test/testpep561.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ def parse_pkgs(comment: str) -> tuple[list[str], list[str]]:
174174
def parse_mypy_args(line: str) -> list[str]:
175175
m = re.match("# flags: (.*)$", line)
176176
if not m:
177-
return ['--no-pretty'] # No args; mypy will spit out an error.
177+
return ["--no-pretty"] # No args; mypy will spit out an error.
178178
args = m.group(1).split()
179-
args.append('--no-pretty')
179+
args.append("--no-pretty")
180180

181181
return args

mypy/test/testpythoneval.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def test_python_evaluation(testcase: DataDrivenTestCase, cache_dir: str) -> None
7272
sys.version_info.minor,
7373
):
7474
return
75-
if '--pretty' in additional_flags:
76-
mypy_cmdline.remove('--no-pretty')
77-
75+
if "--pretty" in additional_flags:
76+
mypy_cmdline.remove("--no-pretty")
77+
7878
mypy_cmdline.extend(additional_flags)
7979

8080
# Write the program to a file.

test-data/unit/daemon.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def bar() -> None:
395395
[case testDaemonInspectCheck]
396396
$ dmypy start # NO-MODIFY
397397
Daemon started
398-
$ dmypy check foo.py # NO-MODIFY
398+
$ dmypy check foo.py # NO-MODIFY
399399
Success: no issues found in 1 source file
400400
$ dmypy check foo.py --export-types # NO-MODIFY
401401
Success: no issues found in 1 source file
@@ -489,7 +489,7 @@ def unreachable(x: int) -> None:
489489
$ dmypy start --log-file log.txt -- --follow-imports=error --no-error-summary --no-pretty
490490
Daemon started
491491
$ dmypy check foo.py --export-types # NO-MODIFY
492-
$ dmypy inspect foo.py:1:a # NO-MODIFY
492+
$ dmypy inspect foo.py:1:a # NO-MODIFY
493493
invalid literal for int() with base 10: 'a'
494494
== Return code: 2
495495
$ dmypy inspect foo.pyc:1:2 # NO-MODIFY

0 commit comments

Comments
 (0)