From 00ed7b6b3c94500d263411e4bd837908d95abf22 Mon Sep 17 00:00:00 2001 From: Duncan Macleod <macleoddm@cardiff.ac.uk> Date: Mon, 17 Mar 2025 12:10:18 +0000 Subject: [PATCH 1/2] Add type-checking in CI This allows highlighting typing issues reported by mypy --- .gitlab-ci.yml | 1 + pyproject.toml | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 977b882..5d030d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ include: code_quality_analyzer: ruff install_extra: "test" run_advanced_sast: true + - component: $CI_SERVER_FQDN/computing/gitlab/components/python/type-checking@2 # -- Debian packaging --------------- diff --git a/pyproject.toml b/pyproject.toml index 042ed16..cf1a40f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,11 +80,24 @@ source = [ ] [tool.coverage.report] +exclude_lines = [ + # ignore when asked + "pragma: no( |-)cover", + # don't complain about typing blocks + "if (typing\\.)?TYPE_CHECKING", +] precision = 1 [tool.coverage.run] source = ["gwdatafind"] +[tool.mypy] +check_untyped_defs = true +exclude = [ + "^docs/", +] +ignore_missing_imports = true + [tool.pytest.ini_options] addopts = "-r a --color=yes" filterwarnings = [ -- GitLab From 564b14ff5c019bdd42b0fd72d8517ba41a723d89 Mon Sep 17 00:00:00 2001 From: Duncan Macleod <macleoddm@cardiff.ac.uk> Date: Mon, 17 Mar 2025 12:10:35 +0000 Subject: [PATCH 2/2] ci: update component verisons --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5d030d4..f961412 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ include: # -- Python ------------------------- - - component: $CI_SERVER_FQDN/computing/gitlab/components/python/all@1 + - component: $CI_SERVER_FQDN/computing/gitlab/components/python/all@2 inputs: code_quality_analyzer: ruff install_extra: "test" @@ -37,7 +37,7 @@ include: # -- Red Hat packaging -------------- - - component: $CI_SERVER_FQDN/computing/gitlab/components/redhat/all@1 + - component: $CI_SERVER_FQDN/computing/gitlab/components/redhat/all@2 inputs: needs: [sdist] redhat_versions: -- GitLab