Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{CI} Add statement for azdev style #7101

Merged
merged 4 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions scripts/ci/azdev_linter_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down