Skip to content

Commit

Permalink
Update license header comments block for PEP8 (Azure#1333)
Browse files Browse the repository at this point in the history
* Remove UTF-8 BOM

* Update comment blocks for license headers
  • Loading branch information
troydai authored Nov 15, 2016
1 parent 2eb6a9a commit 487f019
Show file tree
Hide file tree
Showing 730 changed files with 1,558 additions and 1,480 deletions.
4 changes: 2 additions & 2 deletions bin/extract-loc.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /usr/bin/env python3
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

import os
import re
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
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.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Add command module logic to this package.

from azure.cli.commands import cli_command
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

from codecs import open
from setuptools import setup
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/azhelpgen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
4 changes: 2 additions & 2 deletions doc/sphinx/azhelpgen/azhelpgen.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 argparse
import json
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/cligroup/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
4 changes: 2 additions & 2 deletions doc/sphinx/cligroup/cligroup.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 copy
from docutils import nodes
from sphinx import addnodes
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python3
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
#
# az documentation build configuration file, created by
Expand Down
28 changes: 28 additions & 0 deletions scripts/_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python

# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

# common utilities for scripts

from __future__ import print_function


def get_repo_root():
"""
Returns the root path to this repository. The root is where .git folder is.
"""
import os.path
here = os.path.dirname(os.path.realpath(__file__))

while not os.path.exists(os.path.join(here, '.git')):
here = os.path.dirname(here)

return here


if __name__ == '__main__':
print(get_repo_root())

4 changes: 2 additions & 2 deletions scripts/command_coverage.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 __future__ import print_function
import os
Expand Down
4 changes: 2 additions & 2 deletions scripts/command_modules/_common.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 __future__ import print_function
import os
Expand Down
4 changes: 2 additions & 2 deletions scripts/command_modules/_task.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 __future__ import print_function

Expand Down
4 changes: 2 additions & 2 deletions scripts/command_modules/install.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.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

## Install the command modules using pip ##
from __future__ import print_function
Expand Down
4 changes: 2 additions & 2 deletions scripts/command_modules/package_verify.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.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

## Install the command modules using pip ##
from __future__ import print_function
Expand Down
4 changes: 2 additions & 2 deletions scripts/command_modules/test.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.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

## Run the tests for each command module ##

Expand Down
4 changes: 2 additions & 2 deletions scripts/curl_install_pypi/install.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python

#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

#
# This script will install the CLI into a directory and create an executable
Expand Down
4 changes: 2 additions & 2 deletions scripts/curl_install_pypi/setup_completion.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python

#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

#
# This script will set up tab completion for the Azure CLI.
Expand Down
4 changes: 2 additions & 2 deletions scripts/dev_setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python

#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

from __future__ import print_function

Expand Down
6 changes: 3 additions & 3 deletions scripts/dump_command_table.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 __future__ import print_function

Expand Down Expand Up @@ -131,4 +131,4 @@ def _dashed_to_camel(string):
IGNORE_ARGS = ['help', 'help_file', 'base_type']

APPLICATION.register(Application.COMMAND_PARSER_LOADED, _dump_command_table)
APPLICATION.execute([])
APPLICATION.execute([])
4 changes: 2 additions & 2 deletions scripts/dump_help.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 argparse
import json
Expand Down
6 changes: 3 additions & 3 deletions scripts/generate_command_inventory.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 argparse
import json
Expand Down Expand Up @@ -50,4 +50,4 @@ def default(self, o):#pylint: disable=method-hidden
heading = '=== COMMANDS IN {} PACKAGE(S) WITH {} PARAMETERS ==='.format(
cmd_set_names or 'ANY', param_names or 'ANY')
print('\n{}\n'.format(heading))
print('\n'.join(results))
print('\n'.join(results))
17 changes: 13 additions & 4 deletions scripts/license/_common.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

import os

ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..'))

PY_LICENSE_HEADER = \
"""#---------------------------------------------------------------------------------------------
"""# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
"""

env_folders = [
os.path.join(ROOT_DIR, 'env'),
os.path.join(ROOT_DIR, 'package-verify-env')
]

def contains_header(text):
return PY_LICENSE_HEADER in text

Expand All @@ -23,6 +28,10 @@ def has_shebang(text):
def get_files_without_header():
files_without_header = []
for current_dir, _, files in os.walk(ROOT_DIR):
# skip folders generated by virtual env
if any(d for d in env_folders if d in current_dir):
continue

for a_file in files:
if a_file.endswith('.py'):
cur_file_path = os.path.join(current_dir, a_file)
Expand Down
4 changes: 2 additions & 2 deletions scripts/license/add.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.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

# Add license header to every *.py file in the repo. Can be run multiple times without duplicating the headers.

Expand Down
4 changes: 2 additions & 2 deletions scripts/license/verify.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.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

# Verify that all *.py files have a license header in the file.

Expand Down
4 changes: 2 additions & 2 deletions scripts/nightly/nightly-build.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.
#---------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------

## Install the command modules using pip ##
from __future__ import print_function
Expand Down
Loading

0 comments on commit 487f019

Please sign in to comment.