mirror of
https://github.com/servo/servo.git
synced 2025-07-02 21:13:39 +01:00
Update web-platform-tests to revision b202bbb5aa0d235b22bac11fe902eab1094ef9d2
This commit is contained in:
parent
9a6c96808b
commit
e90dd8bc6b
43 changed files with 669 additions and 286 deletions
|
@ -9,7 +9,6 @@ import os
|
|||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
|
@ -135,28 +134,6 @@ def check_ahem_copy(repo_root, path):
|
|||
return []
|
||||
|
||||
|
||||
def check_git_ignore(repo_root, paths):
|
||||
errors = []
|
||||
with tempfile.TemporaryFile('w+') as f:
|
||||
f.write('\n'.join(paths))
|
||||
f.seek(0)
|
||||
try:
|
||||
matches = subprocess.check_output(
|
||||
["git", "check-ignore", "--verbose", "--no-index", "--stdin"], stdin=f)
|
||||
for match in matches.strip().split('\n'):
|
||||
match_filter, path = match.split()
|
||||
_, _, filter_string = match_filter.split(':')
|
||||
# If the matching filter reported by check-ignore is a special-case exception,
|
||||
# that's fine. Otherwise, it requires a new special-case exception.
|
||||
if filter_string != '!' + path:
|
||||
errors += [("IGNORED PATH", "%s matches an ignore filter in .gitignore - "
|
||||
"please add a .gitignore exception" % path, path, None)]
|
||||
except subprocess.CalledProcessError as e:
|
||||
# Nonzero return code means that no match exists.
|
||||
pass
|
||||
return errors
|
||||
|
||||
|
||||
drafts_csswg_re = re.compile(r"https?\:\/\/drafts\.csswg\.org\/([^/?#]+)")
|
||||
w3c_tr_re = re.compile(r"https?\:\/\/www\.w3c?\.org\/TR\/([^/?#]+)")
|
||||
w3c_dev_re = re.compile(r"https?\:\/\/dev\.w3c?\.org\/[^/?#]+\/([^/?#]+)")
|
||||
|
@ -301,9 +278,7 @@ def filter_whitelist_errors(data, errors):
|
|||
|
||||
for i, (error_type, msg, path, line) in enumerate(errors):
|
||||
normpath = os.path.normcase(path)
|
||||
# Allow whitelisting all lint errors except the IGNORED PATH lint,
|
||||
# which explains how to fix it correctly and shouldn't be ignored.
|
||||
if error_type in data and error_type != "IGNORED PATH":
|
||||
if error_type in data:
|
||||
wl_files = data[error_type]
|
||||
for file_match, allowed_lines in iteritems(wl_files):
|
||||
if None in allowed_lines or line in allowed_lines:
|
||||
|
@ -865,13 +840,6 @@ path_lints = [check_path_length, check_worker_collision, check_ahem_copy]
|
|||
all_paths_lints = [check_css_globally_unique]
|
||||
file_lints = [check_regexp_line, check_parsed, check_python_ast, check_script_metadata]
|
||||
|
||||
# Don't break users of the lint that don't have git installed.
|
||||
try:
|
||||
subprocess.check_output(["git", "--version"])
|
||||
all_paths_lints += [check_git_ignore]
|
||||
except subprocess.CalledProcessError:
|
||||
print('No git present; skipping .gitignore lint.')
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = create_parser().parse_args()
|
||||
error_count = main(**vars(args))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue