Skip to content

Commit 7635195

Browse files
committed
mypy for dev_tools separate
1 parent a9e6c9c commit 7635195

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

.github/workflows/pr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
pip install --no-deps -e .
6060
- run: |
6161
check/pytest-dev-tools
62+
check/mypy-dev-tools
6263
6364
notebooks:
6465
runs-on: ubuntu-24.04

check/mypy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cd "${topdir}" || exit $?
1515
CONFIG_FILE='mypy.ini'
1616

1717
echo -e -n "\033[31m"
18-
mypy --config-file=dev_tools/conf/$CONFIG_FILE "$@" qualtran/ dev_tools/
18+
mypy --config-file=dev_tools/conf/$CONFIG_FILE "$@" qualtran/
1919
result=$?
2020
echo -e -n "\033[0m"
2121

check/mypy-dev-tools

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
################################################################################
4+
# Runs mypy on the dev_tools/ folder using a preconfigured mypy.ini file.
5+
#
6+
# Usage:
7+
# check/mypy-dev-tool [--flags]
8+
################################################################################
9+
10+
# Get the working directory to the repo root.
11+
thisdir="$(dirname "${BASH_SOURCE[0]}")" || exit $?
12+
topdir="$(git -C "${thisdir}" rev-parse --show-toplevel)" || exit $?
13+
cd "${topdir}" || exit $?
14+
15+
CONFIG_FILE='mypy.ini'
16+
17+
echo -e -n "\033[31m"
18+
mypy --config-file=dev_tools/conf/$CONFIG_FILE "$@" dev_tools/
19+
result=$?
20+
echo -e -n "\033[0m"
21+
22+
exit ${result}

0 commit comments

Comments
 (0)