This commit is contained in:
2025-09-24 11:35:52 +08:00
parent 501cea3888
commit ba90778b2d
2 changed files with 18 additions and 17 deletions

31
Jenkinsfile vendored
View File

@@ -80,6 +80,21 @@ pipeline {
"""
}
}
}
stage('Type Checking') {
steps {
script {
echo 'Running type checking with mypy...'
sh """
. ${VENV_NAME}/bin/activate
export PYTHONPATH=\${PWD}:\$PYTHONPATH
# 运行mypy类型检查
mypy --explicit-package-bases services/ entity/ > ${TEST_REPORTS_DIR}/mypy-report.txt || true
"""
}
}
post {
always {
// 发布lint报告
@@ -88,27 +103,13 @@ pipeline {
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: TEST_REPORTS_DIR,
reportFiles: 'flake8-report.txt,black-report.txt',
reportFiles: 'flake8-report.txt,black-report.txt,mypy-report.txt',
reportName: 'Code Quality Report'
])
}
}
}
stage('Type Checking') {
steps {
script {
echo 'Running type checking...'
sh """
. ${VENV_NAME}/bin/activate
export PYTHONPATH=\${PWD}:\$PYTHONPATH
# 运行mypy类型检查
mypy entity/ services/ --html-report ${TEST_REPORTS_DIR}/mypy-html --txt-report ${TEST_REPORTS_DIR}/mypy-txt || true
"""
}
}
}
}
}

View File

@@ -16,8 +16,8 @@ namespace_packages = True
explicit_package_bases = True
show_error_codes = True
# Exclude duplicate modules and legacy code
exclude = biz/ffmpeg\.py
# Exclude tests code
exclude = tests/
# Ignore missing type annotations for third-party libraries
[mypy-requests.*]