diff --git a/conformance-suites/2.0.0/py/lint/README.md b/conformance-suites/2.0.0/py/lint/README.md index b030932f83..fea854baf9 100644 --- a/conformance-suites/2.0.0/py/lint/README.md +++ b/conformance-suites/2.0.0/py/lint/README.md @@ -22,7 +22,7 @@ WebGL/sdk/tests working directory like this: You can use the lint tool to check submitted pull request and fix the errors reported by the tool. Reviewers will not merge branches with tests that have lint errors, so you must either [fix all lint errors](#fixing-lint-errors) or update -[white-list test files] (#updating-the-whitelist) to suppress the errors. +[allow-list test files] (#updating-the-allowlist) to suppress the errors. ## Usage of lint tool @@ -46,7 +46,7 @@ WebGL/sdk/tests:
You must fix any errors the lint tool reports, unless an error is for something essential to a certain test or that for some other exceptional reason shouldn't prevent the test from being merged. In those cases you can -update [white-list test files](#updating-the-whiteslist) to suppress the errors. +update [allow-list test files](#updating-the-allowlist) to suppress the errors. Otherwise, use the details in this section to fix all errors reported. * **CR AT EOL**: Test-file line ends with CR (U+000D) character; **fix**: @@ -65,32 +65,32 @@ Otherwise, use the details in this section to fix all errors reported. * **FILENAME WHITESPACE**: Test file name contains white space; **fix**: remove white space from test file name. -## Updating the whitelist +## Updating the allowlist Normally you must [fix all lint errors](#fixing-lint-errors). But in the unusual case of error reports for things essential to certain tests or that for other exceptional reasons shouldn't prevent a merge of a test, you can -update and commit the `lint.whitelist` file in the WebGL/sdk/tests/py/lint/ +update and commit the `lint.allowlist` file in the WebGL/sdk/tests/py/lint/ directory to suppress errors the lint tool would report for a test file. -To add a test file or directory to the whitelist, use the following format: +To add a test file or directory to the allowlist, use the following format: ``` ERROR TYPE:file/name/pattern ``` -For example, to whitelist the file `example/file.html` such that all +For example, to allowlist the file `example/file.html` such that all `TRAILING WHITESPACE` errors the lint tool would report for it are -suppressed, add the following line to the `lint.whitelist` file. +suppressed, add the following line to the `lint.allowlist` file. ``` TRAILING WHITESPACE:example/file.html ``` -To whitelist an entire directory rather than just one file, use the `*` -wildcard. For example, to whitelist the `example` directory such that all +To allowlist an entire directory rather than just one file, use the `*` +wildcard. For example, to allowlist the `example` directory such that all `TRAILING WHITESPACE` errors the lint tool would report for any files in it -are suppressed, add the following line to the `lint.whitelist` file. +are suppressed, add the following line to the `lint.allowlist` file. ``` TRAILING WHITESPACE:example/* @@ -100,15 +100,15 @@ If needed, you can also use the `*` wildcard to express other filename patterns or directory-name patterns (just as you would when, e.g., executing shell commands from the command line). -Finally, to whitelist just one line in a file, use the following format: +Finally, to allowlist just one line in a file, use the following format: ``` ERROR TYPE:file/name/pattern:line_number ``` -For example, to whitelist just line 128 of the file `example/file.html` +For example, to allowlist just line 128 of the file `example/file.html` such that any `TRAILING WHITESPACE` error the lint tool would report for -that line is suppressed, add the following to the `lint.whitelist` file. +that line is suppressed, add the following to the `lint.allowlist` file. ``` TRAILING WHITESPACE:example/file.html:128 diff --git a/conformance-suites/2.0.0/py/lint/lint.whitelist b/conformance-suites/2.0.0/py/lint/lint.allowlist similarity index 100% rename from conformance-suites/2.0.0/py/lint/lint.whitelist rename to conformance-suites/2.0.0/py/lint/lint.allowlist diff --git a/conformance-suites/2.0.0/py/lint/lint.py b/conformance-suites/2.0.0/py/lint/lint.py index 2dea67b6cd..6f824616e9 100755 --- a/conformance-suites/2.0.0/py/lint/lint.py +++ b/conformance-suites/2.0.0/py/lint/lint.py @@ -62,7 +62,7 @@ def check_permission(path): return [] -def parse_whitelist_file(filename): +def parse_allowlist_file(filename): data = defaultdict(lambda:defaultdict(set)) with open(filename) as f: @@ -80,29 +80,29 @@ def parse_whitelist_file(filename): data[file_match][error_type].add(line_number) def inner(path, errors): - whitelisted = [False for item in xrange(len(errors))] + allowlisted = [False for item in xrange(len(errors))] - for file_match, whitelist_errors in data.iteritems(): + for file_match, allowlist_errors in data.iteritems(): if fnmatch.fnmatch(path, file_match): for i, (error_type, msg, line) in enumerate(errors): - if "*" in whitelist_errors: - whitelisted[i] = True - elif error_type in whitelist_errors: - allowed_lines = whitelist_errors[error_type] + if "*" in allowlist_errors: + allowlisted[i] = True + elif error_type in allowlist_errors: + allowed_lines = allowlist_errors[error_type] if None in allowed_lines or line in allowed_lines: - whitelisted[i] = True + allowlisted[i] = True - return [item for i, item in enumerate(errors) if not whitelisted[i]] + return [item for i, item in enumerate(errors) if not allowlisted[i]] return inner -_whitelist_fn = None -def whitelist_errors(path, errors): - global _whitelist_fn +_allowlist_fn = None +def allowlist_errors(path, errors): + global _allowlist_fn - if _whitelist_fn is None: - _whitelist_fn = parse_whitelist_file(os.path.join(lint_root, "lint.whitelist")) - return _whitelist_fn(path, errors) + if _allowlist_fn is None: + _allowlist_fn = parse_allowlist_file(os.path.join(lint_root, "lint.allowlist")) + return _allowlist_fn(path, errors) class Regexp(object): @@ -189,7 +189,7 @@ def main(): repo_root = repo_root.replace("WebGL/sdk/tests", options.repo) def run_lint(path, fn, *args): - errors = whitelist_errors(path, fn(path, *args)) + errors = allowlist_errors(path, fn(path, *args)) output_errors(errors) for error_type, error, line in errors: error_count[error_type] += 1 diff --git a/sdk/tests/py/lint/README.md b/sdk/tests/py/lint/README.md index b030932f83..fea854baf9 100644 --- a/sdk/tests/py/lint/README.md +++ b/sdk/tests/py/lint/README.md @@ -22,7 +22,7 @@ WebGL/sdk/tests working directory like this: You can use the lint tool to check submitted pull request and fix the errors reported by the tool. Reviewers will not merge branches with tests that have lint errors, so you must either [fix all lint errors](#fixing-lint-errors) or update -[white-list test files] (#updating-the-whitelist) to suppress the errors. +[allow-list test files] (#updating-the-allowlist) to suppress the errors. ## Usage of lint tool @@ -46,7 +46,7 @@ WebGL/sdk/tests:
You must fix any errors the lint tool reports, unless an error is for something essential to a certain test or that for some other exceptional reason shouldn't prevent the test from being merged. In those cases you can -update [white-list test files](#updating-the-whiteslist) to suppress the errors. +update [allow-list test files](#updating-the-allowlist) to suppress the errors. Otherwise, use the details in this section to fix all errors reported. * **CR AT EOL**: Test-file line ends with CR (U+000D) character; **fix**: @@ -65,32 +65,32 @@ Otherwise, use the details in this section to fix all errors reported. * **FILENAME WHITESPACE**: Test file name contains white space; **fix**: remove white space from test file name. -## Updating the whitelist +## Updating the allowlist Normally you must [fix all lint errors](#fixing-lint-errors). But in the unusual case of error reports for things essential to certain tests or that for other exceptional reasons shouldn't prevent a merge of a test, you can -update and commit the `lint.whitelist` file in the WebGL/sdk/tests/py/lint/ +update and commit the `lint.allowlist` file in the WebGL/sdk/tests/py/lint/ directory to suppress errors the lint tool would report for a test file. -To add a test file or directory to the whitelist, use the following format: +To add a test file or directory to the allowlist, use the following format: ``` ERROR TYPE:file/name/pattern ``` -For example, to whitelist the file `example/file.html` such that all +For example, to allowlist the file `example/file.html` such that all `TRAILING WHITESPACE` errors the lint tool would report for it are -suppressed, add the following line to the `lint.whitelist` file. +suppressed, add the following line to the `lint.allowlist` file. ``` TRAILING WHITESPACE:example/file.html ``` -To whitelist an entire directory rather than just one file, use the `*` -wildcard. For example, to whitelist the `example` directory such that all +To allowlist an entire directory rather than just one file, use the `*` +wildcard. For example, to allowlist the `example` directory such that all `TRAILING WHITESPACE` errors the lint tool would report for any files in it -are suppressed, add the following line to the `lint.whitelist` file. +are suppressed, add the following line to the `lint.allowlist` file. ``` TRAILING WHITESPACE:example/* @@ -100,15 +100,15 @@ If needed, you can also use the `*` wildcard to express other filename patterns or directory-name patterns (just as you would when, e.g., executing shell commands from the command line). -Finally, to whitelist just one line in a file, use the following format: +Finally, to allowlist just one line in a file, use the following format: ``` ERROR TYPE:file/name/pattern:line_number ``` -For example, to whitelist just line 128 of the file `example/file.html` +For example, to allowlist just line 128 of the file `example/file.html` such that any `TRAILING WHITESPACE` error the lint tool would report for -that line is suppressed, add the following to the `lint.whitelist` file. +that line is suppressed, add the following to the `lint.allowlist` file. ``` TRAILING WHITESPACE:example/file.html:128 diff --git a/sdk/tests/py/lint/lint.whitelist b/sdk/tests/py/lint/lint.allowlist similarity index 100% rename from sdk/tests/py/lint/lint.whitelist rename to sdk/tests/py/lint/lint.allowlist diff --git a/sdk/tests/py/lint/lint.py b/sdk/tests/py/lint/lint.py index 437ce3faa2..cc84f49bd2 100755 --- a/sdk/tests/py/lint/lint.py +++ b/sdk/tests/py/lint/lint.py @@ -61,7 +61,7 @@ def check_permission(path): return [] -def parse_whitelist_file(filename): +def parse_allowlist_file(filename): data = defaultdict(lambda:defaultdict(set)) with open(filename) as f: @@ -79,29 +79,29 @@ def parse_whitelist_file(filename): data[file_match][error_type].add(line_number) def inner(path, errors): - whitelisted = [False for item in range(len(errors))] + allowlisted = [False for item in range(len(errors))] - for file_match, whitelist_errors in data.items(): + for file_match, allowlist_errors in data.items(): if fnmatch.fnmatch(path, file_match): for i, (error_type, msg, line) in enumerate(errors): - if "*" in whitelist_errors: - whitelisted[i] = True - elif error_type in whitelist_errors: - allowed_lines = whitelist_errors[error_type] + if "*" in allowlist_errors: + allowlisted[i] = True + elif error_type in allowlist_errors: + allowed_lines = allowlist_errors[error_type] if None in allowed_lines or line in allowed_lines: - whitelisted[i] = True + allowlisted[i] = True - return [item for i, item in enumerate(errors) if not whitelisted[i]] + return [item for i, item in enumerate(errors) if not allowlisted[i]] return inner -_whitelist_fn = None -def whitelist_errors(path, errors): - global _whitelist_fn +_allowlist_fn = None +def allowlist_errors(path, errors): + global _allowlist_fn - if _whitelist_fn is None: - _whitelist_fn = parse_whitelist_file(os.path.join(lint_root, "lint.whitelist")) - return _whitelist_fn(path, errors) + if _allowlist_fn is None: + _allowlist_fn = parse_allowlist_file(os.path.join(lint_root, "lint.allowlist")) + return _allowlist_fn(path, errors) class Regexp(object): @@ -191,7 +191,7 @@ def main(): repo_root = repo_root.replace("WebGL/sdk/tests", options.repo) def run_lint(path, fn, *args): - errors = whitelist_errors(path, fn(path, *args)) + errors = allowlist_errors(path, fn(path, *args)) output_errors(errors) for error_type, error, line in errors: error_count[error_type] += 1