mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-12-10 09:33:26 +00:00
run mypy during package build
This commit is contained in:
parent
32530e356d
commit
ee87f312bf
2
debian/control
vendored
2
debian/control
vendored
@ -18,6 +18,7 @@ Build-Depends:
|
||||
flake8,
|
||||
isort <!nocheck>,
|
||||
lsb-release,
|
||||
mypy <!nocheck>,
|
||||
pylint <!nocheck>,
|
||||
python3-all,
|
||||
python3-apt,
|
||||
@ -30,6 +31,7 @@ Build-Depends:
|
||||
python3-pytest,
|
||||
python3-requests <!nocheck>,
|
||||
python3-setuptools,
|
||||
python3-typeshed <!nocheck>,
|
||||
python3-yaml <!nocheck>,
|
||||
Standards-Version: 4.7.2
|
||||
Vcs-Git: https://git.launchpad.net/ubuntu-dev-tools
|
||||
|
||||
2
debian/rules
vendored
2
debian/rules
vendored
@ -3,7 +3,7 @@
|
||||
override_dh_auto_clean:
|
||||
dh_auto_clean
|
||||
rm -f .coverage
|
||||
rm -rf .tox
|
||||
rm -rf .mypy_cache .tox
|
||||
|
||||
override_dh_auto_test:
|
||||
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
|
||||
|
||||
@ -4,3 +4,7 @@ line-length = 99
|
||||
[tool.isort]
|
||||
line_length = 99
|
||||
profile = "black"
|
||||
|
||||
[tool.mypy]
|
||||
disallow_incomplete_defs = true
|
||||
ignore_missing_imports = true
|
||||
|
||||
@ -21,6 +21,12 @@ run_flake8() {
|
||||
flake8 --max-line-length=99 --ignore=E203,W503 . $PYTHON_SCRIPTS
|
||||
}
|
||||
|
||||
run_mypy() {
|
||||
echo "Running mypy..."
|
||||
mypy .
|
||||
mypy --scripts-are-modules $PYTHON_SCRIPTS
|
||||
}
|
||||
|
||||
run_pylint() {
|
||||
echo "Running pylint..."
|
||||
pylint "$@" $(find * -name '*.py') $PYTHON_SCRIPTS
|
||||
@ -31,10 +37,12 @@ if test "${1-}" = "--errors-only"; then
|
||||
run_black || true
|
||||
run_isort || true
|
||||
run_flake8 || true
|
||||
run_mypy
|
||||
run_pylint --errors-only
|
||||
else
|
||||
run_black
|
||||
run_isort
|
||||
run_flake8
|
||||
run_mypy
|
||||
run_pylint
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user