diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 55ffeacd309..2b7b9b4e099 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -137,11 +137,6 @@ jobs: AZURE_EXTENSION_DIR=~/.azure/cliextensions az --version AZURE_EXTENSION_DIR=~/.azure/cliextensions python scripts/ci/azdev_linter_style.py --type style - echo "------------------- Please note -------------------" - echo "This task does not block the PR merge." - echo "And it is recommended if you want to create a separate PR to fix these style issues." - echo "CLI will modify it to force block PR merge on 2025." - echo "---------------------- Thanks ----------------------" displayName: "azdev style on Modified Extensions" env: ADO_PULL_REQUEST_LATEST_COMMIT: HEAD diff --git a/scripts/ci/azdev_linter_style.py b/scripts/ci/azdev_linter_style.py index 23a06eb7d67..0908944af8b 100644 --- a/scripts/ci/azdev_linter_style.py +++ b/scripts/ci/azdev_linter_style.py @@ -12,7 +12,7 @@ import json import logging import os -from subprocess import check_call, check_output +from subprocess import check_call, check_output, CalledProcessError import service_name from pkg_resources import parse_version @@ -201,7 +201,18 @@ def azdev_on_internal_extension(modified_files, azdev_type): if azdev_type in ['all', 'linter']: azdev_extension.linter() if azdev_type in ['all', 'style']: - azdev_extension.style() + try: + azdev_extension.style() + except CalledProcessError as e: + statement_msg = """ + ------------------- Please note ------------------- + This task does not block the PR merge. + And it is recommended if you want to create a separate PR to fix these style issues. + CLI will modify it to force block PR merge on 2025. + ---------------------- Thanks ---------------------- + """ + logger.error(statement_msg) + exit(1) logger.info('Checking service name for internal extensions') service_name.check()