From c60c834254aef8c154add71ad05f05180fc46327 Mon Sep 17 00:00:00 2001 From: Christian Ledermann Date: Tue, 24 Oct 2023 19:57:44 +0100 Subject: [PATCH] avoid Any, use a protocol --- mutmut_config.py | 9 +++++++-- tox.ini | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mutmut_config.py b/mutmut_config.py index 8f7e1749..d99f99de 100644 --- a/mutmut_config.py +++ b/mutmut_config.py @@ -1,5 +1,5 @@ """Mutmut configuration.""" -from typing import Any +from typing import Protocol files_to_mutate = [ "pygeoif/geometry.py", @@ -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 diff --git a/tox.ini b/tox.ini index 2079b885..8d560795 100644 --- a/tox.ini +++ b/tox.ini @@ -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