|
4 | 4 |
|
5 | 5 | import datetime
|
6 | 6 |
|
7 |
| -from framework import utils |
| 7 | +from framework import utils_repo |
8 | 8 |
|
9 | 9 | AMAZON_COPYRIGHT_YEARS = range(2018, datetime.datetime.now().year + 1)
|
10 | 10 | AMAZON_COPYRIGHT = (
|
|
24 | 24 | ALIBABA_COPYRIGHT = "Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved."
|
25 | 25 | ALIBABA_LICENSE = "SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause"
|
26 | 26 |
|
27 |
| -EXCLUDE = ["build", ".kernel", ".git"] |
28 |
| - |
29 | 27 |
|
30 | 28 | def _has_amazon_copyright(string):
|
31 | 29 | for year in AMAZON_COPYRIGHT_YEARS:
|
@@ -90,16 +88,10 @@ def test_for_valid_licenses():
|
90 | 88 | """
|
91 | 89 | Test that all *.py, *.rs and *.sh files contain a valid license.
|
92 | 90 | """
|
93 |
| - python_files = utils.get_files_from( |
94 |
| - find_path="..", pattern="*.py", exclude_names=EXCLUDE |
95 |
| - ) |
96 |
| - rust_files = utils.get_files_from( |
97 |
| - find_path="..", pattern="*.rs", exclude_names=EXCLUDE |
98 |
| - ) |
99 |
| - bash_files = utils.get_files_from( |
100 |
| - find_path="..", pattern="*.sh", exclude_names=EXCLUDE |
101 |
| - ) |
102 | 91 |
|
| 92 | + python_files = list(utils_repo.git_repo_files(root="..", glob="*.py")) |
| 93 | + rust_files = list(utils_repo.git_repo_files(root="..", glob="*.rs")) |
| 94 | + bash_files = list(utils_repo.git_repo_files(root="..", glob="*.sh")) |
103 | 95 | all_files = rust_files + python_files + bash_files
|
104 | 96 | error_msg = []
|
105 | 97 | for file in all_files:
|
|
0 commit comments