Skip to content
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
12 changes: 6 additions & 6 deletions scripts/automation/style/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def run_pep8(modules):
help='Run pylint')
parser.add_argument('--module', dest='modules', action='append',
help='The modules on which the style check should run. Accept short names, '
'except azure-cli, azure-cli-core and azure-cli-nspkg')
'except azure-cli, azure-cli-core and azure-cli-nspkg')
args = parser.parse_args()

if args.ci:
Expand All @@ -68,11 +68,11 @@ def run_pep8(modules):
# Run pylint on all modules
return_code_sum = run_pylint(selected_modules)

# Run flake8 on white-listed modules
pep8_ready_modules = automation_path.filter_user_selected_modules(
['azure-cli', 'azure-cli-core', 'azure-cli-nspkg', 'acs',
'component', 'cloud', 'feedback', 'profile', 'sql', 'storage',
'vm'])
# Run flake8 on modules
pep8_ready_modules = automation_path.filter_blacklisted_modules(
['azure-cli-testsdk', 'acr', 'appservice', 'batch', 'configure', 'container',
'datalake', 'documentdb', 'find', 'iot', 'keyvault', 'network', 'redis', 'resource',
'role', 'taskhelp'])

return_code_sum += run_pep8(pep8_ready_modules)

Expand Down
10 changes: 10 additions & 0 deletions scripts/automation/utilities/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ def get_test_results_dir(with_timestamp=None, prefix=None):
return result


def filter_blacklisted_modules(black_list_modules):
"""Returns the paths to the modules except those in the black list."""
import itertools

existing_modules = list(itertools.chain(get_core_modules_paths(),
get_command_modules_paths()))
black_list_modules = set(black_list_modules)
return list((name, path) for name, path in existing_modules if name not in black_list_modules)


def filter_user_selected_modules(user_input_modules):
import itertools

Expand Down