Update hooks and use autopep8 + add-trailing-comma instead of black

This commit is contained in:
Max R 2025-07-20 19:12:27 -04:00
parent 23d2a8517e
commit 5fab0d1887
33 changed files with 110 additions and 102 deletions

View file

@ -97,7 +97,7 @@ def mock_file_checker_with_plugin(plugin_target):
# Prevent it from reading lines from stdin or somewhere else
with mock.patch(
"flake8.processor.FileProcessor.read_lines", return_value=["Line 1"]
"flake8.processor.FileProcessor.read_lines", return_value=["Line 1"],
):
file_checker = checker.FileChecker(
filename="-",
@ -325,12 +325,12 @@ def test_handling_syntaxerrors_across_pythons():
if sys.version_info < (3, 10): # pragma: no cover (<3.10)
# Python 3.9 or older
err = SyntaxError(
"invalid syntax", ("<unknown>", 2, 5, "bad python:\n")
"invalid syntax", ("<unknown>", 2, 5, "bad python:\n"),
)
expected = (2, 4)
else: # pragma: no cover (3.10+)
err = SyntaxError(
"invalid syntax", ("<unknown>", 2, 1, "bad python:\n", 2, 11)
"invalid syntax", ("<unknown>", 2, 1, "bad python:\n", 2, 11),
)
expected = (2, 1)
file_checker = checker.FileChecker(

View file

@ -314,7 +314,7 @@ def test_cli_config_option_respected(tmp_path):
"""\
[flake8]
ignore = F401
"""
""",
)
py_file = tmp_path / "t.py"
@ -330,7 +330,7 @@ def test_cli_isolated_overrides_config_option(tmp_path):
"""\
[flake8]
ignore = F401
"""
""",
)
py_file = tmp_path / "t.py"
@ -364,7 +364,7 @@ def test_output_file(tmpdir, capsys):
def test_early_keyboard_interrupt_does_not_crash(capsys):
with mock.patch.object(
config, "load_config", side_effect=KeyboardInterrupt
config, "load_config", side_effect=KeyboardInterrupt,
):
assert cli.main(["does-not-exist"]) == 1
out, err = capsys.readouterr()

View file

@ -86,7 +86,7 @@ def test_local_plugin_can_add_option(local_config):
stage1_args, rest = stage1_parser.parse_known_args(argv)
cfg, cfg_dir = config.load_config(
config=stage1_args.config, extra=[], isolated=False
config=stage1_args.config, extra=[], isolated=False,
)
opts = finder.parse_plugin_options(