Skip to content

Commit

Permalink
Fix type annotations for logging classes
Browse files Browse the repository at this point in the history
Signed-off-by: John Pennycook <[email protected]>
  • Loading branch information
Pennycook committed Oct 10, 2024
1 parent 78d472a commit 9abcf0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions codebasin/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def _help_string(*lines: str, is_long=False, is_last=False):


class Formatter(logging.Formatter):
def __init__(self, *, colors=False):
def __init__(self, *, colors: bool = False):
self.colors = colors

def format(self, record):
def format(self, record: logging.LogRecord) -> str:
msg = record.msg
level = record.levelname.lower()

Expand Down Expand Up @@ -98,7 +98,7 @@ def __init__(self, regex: str, msg: str):
self.msg = msg
self._count = 0

def inspect(self, record):
def inspect(self, record: logging.LogRecord):
if self.regex.search(record.msg):
self._count += 1

Expand Down Expand Up @@ -136,7 +136,7 @@ def __init__(self):
),
]

def filter(self, record):
def filter(self, record: logging.LogRecord) -> bool:
if record.levelno == logging.WARNING:
for meta_warning in self.meta_warnings:
meta_warning.inspect(record)
Expand Down

0 comments on commit 9abcf0c

Please sign in to comment.