From c467df8fa39fba0e4a68c60ef7cd707373c19719 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sat, 8 Oct 2022 17:33:13 +0300 Subject: [PATCH] Setup `mypy' for static type checking --- .mypy.ini | 13 +++++++++++++ src/utils/yaml.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .mypy.ini diff --git a/.mypy.ini b/.mypy.ini new file mode 100644 index 00000000..205d50d6 --- /dev/null +++ b/.mypy.ini @@ -0,0 +1,13 @@ +[mypy] +strict_optional = False +ignore_missing_imports = True +install_types = True +non_interactive = True +show_error_codes = True +exclude = (?x)( + src/interface/desktop/main_window.py + | src/interface/desktop/file_browser.py + | src/interface/desktop/system_tray.py + | build/* + | tests/* + ) diff --git a/src/utils/yaml.py b/src/utils/yaml.py index a70c6f76..07f7cd87 100644 --- a/src/utils/yaml.py +++ b/src/utils/yaml.py @@ -9,7 +9,7 @@ from src.utils.rawconfig import FullConfig # Do not emit tags when dumping to YAML -yaml.emitter.Emitter.process_tag = lambda self, *args, **kwargs: None +yaml.emitter.Emitter.process_tag = lambda self, *args, **kwargs: None # type: ignore[assignment] def save_config_to_file(yaml_config: dict, yaml_config_file: Path):