Skip to content

Commit ab00112

Browse files
Exclude maintainer scripts from Python checks
Maintainer scripts may require a more recent Python than the version we currently use for Python checks (3.6). #293 Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
1 parent 6466dc6 commit ab00112

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

scripts/check-python-files.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ elif [ "$1" = "--can-mypy" ]; then
5555
fi
5656

5757
echo 'Running pylint ...'
58+
# Exclude `maintainer` subdirectories, because they can contain code
59+
# that does not work with the versions of pylint and mypy we use on the CI.
60+
# https://github.com/Mbed-TLS/mbedtls-framework/issues/293
61+
#
5862
# When we move Python code between repositories, there is a transition
5963
# period during which code is duplicated between the old repository and
6064
# the new repository.
@@ -64,7 +68,9 @@ echo 'Running pylint ...'
6468
# runs of pylint: one for the A files, and one for the others.
6569
# Remove exceptions below once the A file (or the moved code in the A file)
6670
# has been removed from all consuming branches.
67-
find framework/scripts scripts tests/scripts -name '*.py' \( \
71+
find framework/scripts scripts tests/scripts \
72+
-name maintainer -prune -o \
73+
-name '*.py' \( \
6874
! -path scripts/abi_check.py \
6975
! -path scripts/code_size_compare.py \
7076
! -path scripts/ecp_comb_table.py \
@@ -87,7 +93,10 @@ $PYTHON -m mypy framework/scripts || {
8793
ret=1
8894
}
8995

90-
$PYTHON -m mypy scripts tests/scripts || {
96+
# Exclude `maintainer` subdirectories, because they can contain code
97+
# that does not work with the versions of pylint and mypy we use on the CI.
98+
# https://github.com/Mbed-TLS/mbedtls-framework/issues/293
99+
$PYTHON -m mypy --exclude maintainer scripts tests/scripts || {
91100
echo >&2 "mypy reported errors in the parent repository"
92101
ret=1
93102
}

0 commit comments

Comments
 (0)