From 5225981c9a61dbdd3a03dfb9172466723472dcb7 Mon Sep 17 00:00:00 2001 From: mr-tz Date: Mon, 11 Nov 2024 16:24:59 +0000 Subject: [PATCH] mypy ignore --- .gitignore | 1 + floss/render/default.py | 2 +- floss/render/json.py | 2 +- tests/conftest.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 32a5de6cf..32cf7f990 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ lib/ # Pyenv file .python-version +.venv # Test executables bin/ diff --git a/floss/render/default.py b/floss/render/default.py index eedc46f3f..a3d7aa097 100644 --- a/floss/render/default.py +++ b/floss/render/default.py @@ -315,7 +315,7 @@ def get_color(color): def render(results: floss.results.ResultDocument, verbose, disable_headers, color): - sys.__stdout__.reconfigure(encoding="utf-8") + sys.__stdout__.reconfigure(encoding="utf-8") # type: ignore [union-attr] console = Console(file=io.StringIO(), color_system=get_color(color), highlight=False, soft_wrap=True) if not disable_headers: diff --git a/floss/render/json.py b/floss/render/json.py index d3e87b391..d95900538 100644 --- a/floss/render/json.py +++ b/floss/render/json.py @@ -17,7 +17,7 @@ class FlossJSONEncoder(json.JSONEncoder): def default(self, o): if dataclasses.is_dataclass(o): - return dataclasses.asdict(o) + return dataclasses.asdict(o) # type: ignore [arg-type] if isinstance(o, datetime.datetime): return o.isoformat("T") + "Z" return super().default(o) diff --git a/tests/conftest.py b/tests/conftest.py index 9d4022e5d..cfb1fa2c1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -154,7 +154,7 @@ def runtest(self): def reportinfo(self): return self.path, 0, "usecase: %s" % self.name - def repr_failure(self, excinfo): + def repr_failure(self, excinfo): # type: ignore [override] if isinstance(excinfo.value, FLOSSStringsNotExtracted): expected = excinfo.value.expected got = excinfo.value.got