Skip to content

Commit bda9898

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

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

codespell_lib/_codespell.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,11 @@ def _supports_ansi_colors() -> bool:
389389
def parse_options(
390390
args: Sequence[str],
391391
) -> tuple[argparse.Namespace, argparse.ArgumentParser, list[str]]:
392-
393392
# Split lines read from `@PATH` using shlex.split(), otherwise default
394-
# behaviour is to have one arg per line. See:
393+
# behaviour is to have one arg per line. See:
395394
# https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.convert_arg_line_to_args
396395
class ArgumentParser(argparse.ArgumentParser):
397-
def convert_arg_line_to_args(self, arg_line: str
398-
) -> list[str]:
396+
def convert_arg_line_to_args(self, arg_line: str) -> list[str]:
399397
if sys.platform == "win32":
400398
# On Windows, shlex.split() seems to be messed up by back
401399
# slashes. Temporarily changing them to forward slashes seems
@@ -406,7 +404,7 @@ def convert_arg_line_to_args(self, arg_line: str
406404
else:
407405
ret = shlex.split(arg_line)
408406
return ret
409-
407+
410408
parser = ArgumentParser(
411409
formatter_class=NewlineHelpFormatter,
412410
fromfile_prefix_chars="@",

codespell_lib/tests/test_basic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,11 +1459,13 @@ def test_stdin(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None:
14591459
assert stdout == "1: Thsi ==> This\n"
14601460
assert code == 1
14611461

1462+
14621463
def test_args_from_file(
14631464
tmp_path: Path,
14641465
capsys: pytest.CaptureFixture[str],
14651466
) -> None:
14661467
import textwrap
1468+
14671469
print()
14681470
fname1 = tmp_path / "tmp1"
14691471
fname2 = tmp_path / "tmp2"
@@ -1476,12 +1478,12 @@ def test_args_from_file(
14761478
print(f"{fname_list=}")
14771479
args = ["codespell", f"@{fname_list}"]
14781480
print(f"Running: {args=}")
1479-
cp = subprocess.run( # noqa: S603
1481+
cp = subprocess.run( # noqa: S603
14801482
args,
14811483
check=False,
14821484
text=True,
14831485
capture_output=True,
1484-
)
1486+
)
14851487
code = cp.returncode
14861488
stdout = cp.stdout
14871489
stderr = cp.stderr

0 commit comments

Comments
 (0)