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 license checker #1448

Merged
merged 7 commits into from
Mar 26, 2020
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
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License.txt is outdated. The filename is LICENSE.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several style License among our repos, fixing it would be a big project, I will re-format them later.

# # --------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

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