diff options
| author | Juraj Linkeš <[email protected]> | 2023-07-25 10:48:42 +0200 |
|---|---|---|
| committer | Thomas Monjalon <[email protected]> | 2023-09-25 16:18:00 +0200 |
| commit | f507f39be3e8eca90b1d7b41d24b914a7edcb8f1 (patch) | |
| tree | 4430075cf0e68b16000663bc64f9164dd665b34c /devtools | |
| parent | a4b74fc624e76acb7c5a3874e9e32b58761f5f1e (diff) | |
dts: update dependencies and mypy execution
Poetry changed the syntax of dev dependencies section in version
1.2.0. Updated the lock file with Poetry 1.5.1 added that to the
documentation.
The scripts section did nothing, so it got removed.
Update Pylama linters:
* pep8 is the same as pycodestyle
* pylint is missing dependencies and thus not executed. It reports a
number of warnings and may be introduced in a future patch.
* mypy doesn't work properly with Pylama. Pylama executes linting
file-by-file and mypy works on all files at once.
Mypy has thus been moved outside Pylama and is executed separately.
Added Mypy configuration that makes it easier to specify ignored issues
in more detail.
Signed-off-by: Juraj Linkeš <[email protected]>
Acked-by: Jeremy Spewock <[email protected]>
Diffstat (limited to 'devtools')
| -rwxr-xr-x | devtools/dts-check-format.sh | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/devtools/dts-check-format.sh b/devtools/dts-check-format.sh index c9b3702642..3f43e17e88 100755 --- a/devtools/dts-check-format.sh +++ b/devtools/dts-check-format.sh @@ -1,6 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2022 University of New Hampshire +# Copyright(c) 2023 PANTHEON.tech s.r.o. usage() { echo "Usage: $(basename $0) [options] [directory]" @@ -11,9 +12,10 @@ usage() { format=true lint=true +typecheck=true # Comments after args serve as documentation; must be present -while getopts "hfl" arg; do +while getopts "hflt" arg; do case $arg in h) # Display this message echo 'Run formatting and linting programs for DTS.' @@ -26,6 +28,9 @@ while getopts "hfl" arg; do l) # Don't run linter lint=false ;; + t) # Don't run type checker + typecheck=false + ;; ?) usage exit 1 @@ -93,6 +98,20 @@ if $lint; then fi fi +if $typecheck; then + if $format || $lint; then + echo + fi + heading "Checking types in $directory/" + if command -v mypy > /dev/null; then + mypy . + errors=$((errors + $?)) + else + echo "mypy not found, unable to check types" + errors=$((errors + 1)) + fi +fi + echo heading "Summary for $directory/" echo "Found $errors errors" |
