Skip to content

Commit

Permalink
chore: fix lints
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Oct 2, 2024
1 parent c35ec66 commit 290f163
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
6 changes: 4 additions & 2 deletions plumbum/colorlib/styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sys
from abc import ABCMeta, abstractmethod
from copy import copy
from typing import IO
from typing import IO, ClassVar

from .names import (
FindNearest,
Expand Down Expand Up @@ -343,7 +343,9 @@ class Style(metaclass=ABCMeta):
"""The class of color to use. Never hardcode ``Color`` call when writing a Style
method."""

attribute_names: dict[str, str] | dict[str, int]
# These must be defined by subclasses
# pylint: disable-next=declare-non-slot
attribute_names: ClassVar[dict[str, str] | dict[str, int]]

_stdout: IO | None = None
end = "\n"
Expand Down
12 changes: 8 additions & 4 deletions plumbum/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,11 @@ def verify(proc, retcode, timeout, stdout, stderr):

class BaseRedirection(BaseCommand):
__slots__ = ("cmd", "file")
SYM: ClassVar[str]
KWARG: ClassVar[str]
MODE: ClassVar[str]

# These must be defined by subclasses
SYM: ClassVar[str] # pylint: disable=declare-non-slot
KWARG: ClassVar[str] # pylint: disable=declare-non-slot
MODE: ClassVar[str] # pylint: disable=declare-non-slot

def __init__(self, cmd, file):
self.cmd = cmd
Expand Down Expand Up @@ -563,9 +565,11 @@ def popen(self, args=(), **kwargs):


class ConcreteCommand(BaseCommand):
QUOTE_LEVEL: ClassVar[int]
__slots__ = ("executable",)

# These must be defined by subclasses
QUOTE_LEVEL: ClassVar[int] # pylint: disable=declare-non-slot

def __init__(self, executable, encoding):
self.executable = executable
self.custom_encoding = encoding
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ optional_tests = """


[tool.pylint]
master.py-version = "3.8"
master.jobs = "0"
master.load-plugins = ["pylint.extensions.no_self_use"]
py-version = "3.8"
jobs = "0"
load-plugins = ["pylint.extensions.no_self_use"]
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
messages_control.enable = [
Expand Down Expand Up @@ -162,6 +162,7 @@ messages_control.disable = [
"too-many-public-methods",
"too-many-return-statements",
"too-many-statements",
"too-many-positional-arguments",
"unidiomatic-typecheck", # TODO: might be able to remove
"unnecessary-lambda-assignment", # TODO: 4 instances
"unused-import", # identical to flake8 but has typing false positives
Expand Down

0 comments on commit 290f163

Please sign in to comment.