From d0bb8f1303181d97c87e1291556ecd48cfc48a28 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Thu, 21 Mar 2024 11:35:47 +0100
Subject: [PATCH] [mypy] Enabled some checks.

---
 .pre-commit-config.yaml |  3 ++-
 pyproject.toml          | 17 ++++++++++-------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index fc6045cd3..3e9c65864 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -47,6 +47,7 @@ repos:
     hooks:
       - id: mypy
         files: ogstools
+        exclude: ".*/examples/.*"
   - repo: https://github.com/codespell-project/codespell
     rev: "v2.2.5"
     hooks:
@@ -67,4 +68,4 @@ repos:
   - repo: https://github.com/executablebooks/mdformat
     rev: 0.7.16
     hooks:
-    - id: mdformat
+      - id: mdformat
diff --git a/pyproject.toml b/pyproject.toml
index 7c656d05b..3ff6c2b35 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -90,16 +90,19 @@ testpaths = ["tests"]
 line-length = 80
 
 [tool.mypy]
-files = "ogstools"
+files = "ogstools/**/*.py"
+# does not work when mypy invoked directly, works in pre-commit as explicitly
+# stated there again:
 exclude = ['.*/examples/.*']
+ignore_missing_imports = true
+scripts_are_modules = true
+# Set to true when current issues are fixed
 strict = false
-show_error_codes = true
-enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
+# Delete following lines when strict is true:
+check_untyped_defs = true
+disallow_untyped_defs = true
+disallow_incomplete_defs = true
 warn_unreachable = true
-# Uncomment and fix one by one:
-# check_untyped_defs = true
-# disallow_untyped_defs = true
-# disallow_incomplete_defs =  true
 
 [tool.ruff]
 select = [
-- 
GitLab