Skip to content

Commit

Permalink
Use override decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
realshouzy committed Jan 24, 2024
1 parent 5a2ca57 commit bd30b65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pip_review/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
VERSION_PATTERN,
)

if sys.version_info >= (3, 12): # pragma: >=3.12 cover
from typing import override
else: # pragma: <3.12 cover
from typing_extensions import override

if TYPE_CHECKING:
import re
from collections.abc import Callable
Expand Down Expand Up @@ -112,6 +117,7 @@ def _filter_forwards(args: list[str], exclude: set[str]) -> list[str]:


class StdOutFilter(logging.Filter):
@override
def filter(self, record: logging.LogRecord) -> bool:
return record.levelno in {logging.DEBUG, logging.INFO}

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ ignore = [
"ERA001",
"EM101",
"TRY003",
"D107",
"UP035",
"UP036",
]
fixable = ["ALL"]
unfixable = []
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
packaging
typing_extensions>=4.6.0;python_version<"3.12"

0 comments on commit bd30b65

Please sign in to comment.