Skip to content

Commit

Permalink
[CI] add license checker (Azure#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jianhui Harold authored Mar 26, 2020
1 parent 93f3ab8 commit 3f78c4f
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 57 deletions.
1 change: 0 additions & 1 deletion azure-cli-extensions.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<Compile Include="scripts\ci\test_source.py" />
<Compile Include="scripts\ci\util.py" />
<Compile Include="scripts\ci\verify_codeowners.py" />
<Compile Include="scripts\ci\verify_license.py" />
<Compile Include="scripts\refdoc\azhelpgen\azhelpgen.py" />
<Compile Include="scripts\refdoc\azhelpgen\__init__.py" />
<Compile Include="scripts\refdoc\cligroup\cligroup.py" />
Expand Down
30 changes: 30 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,36 @@ jobs:
TSLint: false
ToolLogsNotFoundAction: 'Standard'

- job: CheckLicenseHeader
displayName: "Check License"
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
inputs:
versionSpec: 3.6
- bash: |
set -ev
# prepare and activate virtualenv
python -m venv env/
chmod +x ./env/bin/activate
source ./env/bin/activate
# clone azure-cli
git clone -q --single-branch -b dev https://github.com/Azure/azure-cli.git ../azure-cli
pip install -q azdev
azdev setup -c ../azure-cli -r ./
azdev --version
az --version
azdev verify license
- job: StaticAnalysis
displayName: "Static Analysis"
pool:
Expand Down
6 changes: 0 additions & 6 deletions scripts/ci/source_code_static_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import os
import sys
import argparse
import multiprocessing

from pylint import lint
Expand All @@ -16,7 +15,6 @@
from util import get_repo_root

from verify_codeowners import main as _verify_codeowners
from verify_license import main as _verify_license


SDK_FILE_MARKER = r"# Code generated by Microsoft (R) AutoRest Code Generator."
Expand Down Expand Up @@ -143,10 +141,6 @@ def main():

_verify_codeowners()

parser = argparse.ArgumentParser()
parser.add_argument('excluded_paths', nargs='*')
_verify_license(parser.parse_args())

print("All static checks successful!")


Expand Down
47 changes: 0 additions & 47 deletions scripts/ci/verify_license.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/hack/azext_hack/_validators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# # --------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
import re
from knack.util import CLIError

Expand Down
2 changes: 1 addition & 1 deletion src/hack/azext_hack/_website_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# # --------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

from azure.cli.command_modules.appservice.custom import (
create_app_service_plan,
Expand Down
2 changes: 1 addition & 1 deletion src/hack/azext_hack/custom.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# # --------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
from uuid import uuid4

from azure.cli.core.commands.client_factory import get_mgmt_service_client
Expand Down

0 comments on commit 3f78c4f

Please sign in to comment.