Skip to content

Commit 1b4349d

Browse files
committed
Fix ruff check with override
Signed-off-by: Cristian Le <git@lecris.dev>
1 parent 5dcef82 commit 1b4349d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ builtins-ignorelist = ["help", "format", "input", "filter", "copyright", "max"]
451451
"typing.TypeGuard".msg = "Use tmt._compat.typing.TypeGuard instead."
452452
"typing.TypeIs".msg = "Not present in centos-stream-10"
453453
"typing_extensions.Self".msg = "Use tmt._compat.typing.Self instead."
454+
"typing.override".msg = "Use tmt._compat.typing.override instead."
454455
"pathlib.Path".msg = "Use tmt._compat.pathlib.Path instead."
455456
"pathlib.PosixPath".msg = "Use tmt._compat.pathlib.Path instead."
456457
"pydantic".msg = "Use tmt._compat.pydantic instead."

tmt/_compat/typing.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@
1212
else:
1313
from typing_extensions import Self
1414

15+
if sys.version_info >= (3, 12):
16+
from typing import override
17+
else:
18+
from typing_extensions import override
19+
1520
__all__ = [
1621
"Concatenate",
1722
"ParamSpec",
1823
"Self",
1924
"TypeAlias",
2025
"TypeGuard",
26+
"override",
2127
]

tmt/log.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
)
4242

4343
from tmt._compat.pathlib import Path
44+
from tmt._compat.typing import override
4445
from tmt._compat.warnings import deprecated
4546
from tmt.container import container, simple_field
4647

@@ -314,6 +315,7 @@ def __init__(self, fmt: str, apply_colors: bool = False) -> None:
314315

315316
self._decolorize = create_decolorizer(apply_colors)
316317

318+
@override
317319
def formatMessage(self, record: logging.LogRecord) -> str:
318320
return self._decolorize(super().formatMessage(record))
319321

0 commit comments

Comments
 (0)