ci: run pylint for files endswith .py, and skip run when no files matched

pull/12097/head
Fu Hanxi 2023-08-11 11:03:52 +08:00
rodzic 28c9953ffe
commit e458a7a45c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: BD3B2FAD1B4969D4
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -35,10 +35,11 @@ check_pylint:
script:
- |
if [ -n "$CI_MERGE_REQUEST_IID" ]; then
export files=$(python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py files ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} | grep ".py");
export files=$(python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py files ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} | grep ".py$");
else
export files=$(find . -iname "*.py" -print);
fi
- if [ -z "$files" ]; then echo "No python files found"; exit 0; fi
- run_cmd pylint --exit-zero --load-plugins=pylint_gitlab --output-format=gitlab-codeclimate:pylint.json $files
# build stage