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 { post {
always { always {
// 发布lint报告 // 发布lint报告
@@ -88,27 +103,13 @@ pipeline {
alwaysLinkToLastBuild: true, alwaysLinkToLastBuild: true,
keepAll: true, keepAll: true,
reportDir: TEST_REPORTS_DIR, 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' 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 explicit_package_bases = True
show_error_codes = True show_error_codes = True
# Exclude duplicate modules and legacy code # Exclude tests code
exclude = biz/ffmpeg\.py exclude = tests/
# Ignore missing type annotations for third-party libraries # Ignore missing type annotations for third-party libraries
[mypy-requests.*] [mypy-requests.*]