Skip to content

Commit

Permalink
chore: Make noqa comments more specific to checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
badshah400 committed Mar 2, 2024
1 parent ef17404 commit 7537440
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/tartex/_parse_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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__(
Expand All @@ -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()

Expand All @@ -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__(
Expand All @@ -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()


Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bash_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7537440

Please sign in to comment.