Skip to content

Commit

Permalink
avoid Any, use a protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Oct 24, 2023
1 parent 83ee20b commit c60c834
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mutmut_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Mutmut configuration."""
from typing import Any
from typing import Protocol

files_to_mutate = [
"pygeoif/geometry.py",
Expand All @@ -9,7 +9,12 @@
]


def pre_mutation(context: Any) -> None:
class Context(Protocol):
filename: str
skip: bool


def pre_mutation(context: Context) -> None:
"""Only include the files specified above."""
if context.filename not in files_to_mutate:
context.skip = True
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ per-file-ignores =
tests/test_feature.py: ECE001,S10,D10,S307,DALL000,PT009,T003,P103
feature.py: A003
types.py: A003
mutmut_config.py: TYP001
kwargs_ignore_function_pattern_extend = '^cast$'
literal_inline_quotes = double
literal_multiline_quotes = double
Expand Down

0 comments on commit c60c834

Please sign in to comment.