From 7537440ea0064cbd27aa1658667ba6378f67ea35 Mon Sep 17 00:00:00 2001 From: Atri Bhattacharya Date: Sat, 2 Mar 2024 06:37:12 +0530 Subject: [PATCH] chore: Make noqa comments more specific to checks. --- src/tartex/_parse_args.py | 14 +++++++------- tests/test_bash_completion.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tartex/_parse_args.py b/src/tartex/_parse_args.py index 7685bf4..e10507a 100644 --- a/src/tartex/_parse_args.py +++ b/src/tartex/_parse_args.py @@ -16,7 +16,7 @@ from rich.markdown import Markdown from rich.syntax import Syntax -from tartex.__about__ import __appname__ as APPNAME # noqa +from tartex.__about__ import __appname__ as APPNAME # noqa: N812 from tartex.__about__ import __version__ from tartex._completion import ( COMPFILE, @@ -95,7 +95,7 @@ def __init__( option_strings, dest=argparse.SUPPRESS, default=argparse.SUPPRESS, - help=None, + help=None, # noqa: A002 ): """Initialise Action class""" super().__init__( @@ -108,7 +108,7 @@ def __init__( # Note that correct __call__ signature requires all positional args even if # they are not used in this method itself - def __call__(self, parser, namespace, values, option_string=None): # noqa + def __call__(self, parser, nsp, vals, opt_str=None): # noqa: ARG002 richprint(Markdown(COMPLETIONS_GUIDE)) parser.exit() @@ -125,7 +125,7 @@ def __init__( option_strings, dest=argparse.SUPPRESS, default=argparse.SUPPRESS, - help=None, + help=None, # noqa: A002 ): """Initialise Action class""" super().__init__( @@ -138,7 +138,7 @@ def __init__( # Note that correct __call__ signature requires all positional args even if # they are not used in this method itself - def __call__(self, parser, namespace, values, option_string=None): #noqa + def __call__(self, parser, namespace, values, option_string=None): # noqa parser.exit() @@ -222,7 +222,7 @@ def _format_action_invocation(self, action): return ", ".join(parts) - def _split_lines(self, text, width): + def _split_lines(self, text, width): # noqa: ARG002 return wrap(text, width=52, break_on_hyphens=False) @@ -292,7 +292,7 @@ def parse_args(args): "-p", "--packages", action="store_true", - help="List of TeX/LaTeX packages used and locations" + help="List of TeX/LaTeX packages used and locations", ) parser.add_argument( diff --git a/tests/test_bash_completion.py b/tests/test_bash_completion.py index 717b874..8841742 100644 --- a/tests/test_bash_completion.py +++ b/tests/test_bash_completion.py @@ -28,7 +28,7 @@ def test_install(capsys, monkeypatch, tmpdir): assert exc.value.code == 0 bc = BashCompletion() - print(bc.data, end="") + print(bc.data, end="") # noqa: T201 compl_file = Path.home() / bc.install_dir / APPNAME assert str(compl_file.parent) in capsys.readouterr().out assert compl_file.exists()