mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Issue #12421: tidy should also check .html files
This commit is contained in:
parent
5e83b3f83b
commit
1e60c915f9
85 changed files with 696 additions and 691 deletions
|
@ -27,7 +27,7 @@ MAX_LICENSE_LINESPAN = max(len(license.splitlines()) for license in licenses)
|
||||||
# File patterns to include in the non-WPT tidy check.
|
# File patterns to include in the non-WPT tidy check.
|
||||||
FILE_PATTERNS_TO_CHECK = ["*.rs", "*.rc", "*.cpp", "*.c",
|
FILE_PATTERNS_TO_CHECK = ["*.rs", "*.rc", "*.cpp", "*.c",
|
||||||
"*.h", "Cargo.lock", "*.py", "*.sh",
|
"*.h", "Cargo.lock", "*.py", "*.sh",
|
||||||
"*.toml", "*.webidl", "*.json"]
|
"*.toml", "*.webidl", "*.json", "*.html"]
|
||||||
|
|
||||||
# File patterns that are ignored for all tidy and lint checks.
|
# File patterns that are ignored for all tidy and lint checks.
|
||||||
FILE_PATTERNS_TO_IGNORE = ["*.#*", "*.pyc"]
|
FILE_PATTERNS_TO_IGNORE = ["*.#*", "*.pyc"]
|
||||||
|
@ -44,6 +44,11 @@ IGNORED_FILES = [
|
||||||
os.path.join(".", "tests", "wpt", "metadata-css", "MANIFEST.json"),
|
os.path.join(".", "tests", "wpt", "metadata-css", "MANIFEST.json"),
|
||||||
os.path.join(".", "components", "script", "dom", "webidls", "ForceTouchEvent.webidl"),
|
os.path.join(".", "components", "script", "dom", "webidls", "ForceTouchEvent.webidl"),
|
||||||
os.path.join(".", "support", "android", "openssl.sh"),
|
os.path.join(".", "support", "android", "openssl.sh"),
|
||||||
|
# Ignore those files since the issues reported are on purpose
|
||||||
|
os.path.join(".", "tests", "html", "bad-line-ends.html"),
|
||||||
|
os.path.join(".", "tests", "unit", "net", "parsable_mime", "text"),
|
||||||
|
os.path.join(".", "tests", "wpt", "mozilla", "tests", "css", "fonts"),
|
||||||
|
os.path.join(".", "tests", "wpt", "mozilla", "tests", "css", "pre_with_tab.html"),
|
||||||
# FIXME(pcwalton, #11679): This is a workaround for a tidy error on the quoted string
|
# FIXME(pcwalton, #11679): This is a workaround for a tidy error on the quoted string
|
||||||
# `"__TEXT,_info_plist"` inside an attribute.
|
# `"__TEXT,_info_plist"` inside an attribute.
|
||||||
os.path.join(".", "components", "servo", "platform", "macos", "mod.rs"),
|
os.path.join(".", "components", "servo", "platform", "macos", "mod.rs"),
|
||||||
|
@ -148,7 +153,7 @@ def filter_files(start_dir, only_changed_files, progress):
|
||||||
|
|
||||||
|
|
||||||
def check_license(file_name, lines):
|
def check_license(file_name, lines):
|
||||||
if any(file_name.endswith(ext) for ext in (".toml", ".lock", ".json")):
|
if any(file_name.endswith(ext) for ext in (".toml", ".lock", ".json", ".html")):
|
||||||
raise StopIteration
|
raise StopIteration
|
||||||
while lines and (lines[0].startswith(EMACS_HEADER) or lines[0].startswith(VIM_HEADER)):
|
while lines and (lines[0].startswith(EMACS_HEADER) or lines[0].startswith(VIM_HEADER)):
|
||||||
lines = lines[1:]
|
lines = lines[1:]
|
||||||
|
@ -168,7 +173,7 @@ def check_modeline(file_name, lines):
|
||||||
|
|
||||||
|
|
||||||
def check_length(file_name, idx, line):
|
def check_length(file_name, idx, line):
|
||||||
if file_name.endswith(".lock") or file_name.endswith(".json"):
|
if file_name.endswith(".lock") or file_name.endswith(".json") or file_name.endswith(".html"):
|
||||||
raise StopIteration
|
raise StopIteration
|
||||||
# Prefer shorter lines when shell scripting.
|
# Prefer shorter lines when shell scripting.
|
||||||
if file_name.endswith(".sh"):
|
if file_name.endswith(".sh"):
|
||||||
|
@ -672,7 +677,7 @@ def collect_errors_for_files(files_to_check, checking_functions, line_checking_f
|
||||||
|
|
||||||
|
|
||||||
def get_wpt_files(only_changed_files, progress):
|
def get_wpt_files(only_changed_files, progress):
|
||||||
wpt_dir = os.path.join(".", "tests", "wpt", "web-platform-tests" + os.sep)
|
wpt_dir = os.path.join(".", "tests", "wpt" + os.sep)
|
||||||
file_iter = get_file_list(os.path.join(wpt_dir), only_changed_files)
|
file_iter = get_file_list(os.path.join(wpt_dir), only_changed_files)
|
||||||
(has_element, file_iter) = is_iter_empty(file_iter)
|
(has_element, file_iter) = is_iter_empty(file_iter)
|
||||||
if not has_element:
|
if not has_element:
|
||||||
|
|
|
@ -25,7 +25,7 @@ destCtx.imageSmoothingEnabled = smoothingEnabled;
|
||||||
// The source Image doesn't have a src url defined
|
// The source Image doesn't have a src url defined
|
||||||
// It should throw an exception because the HTMLImageElement is
|
// It should throw an exception because the HTMLImageElement is
|
||||||
// in the broken state
|
// in the broken state
|
||||||
// https://html.spec.whatwg.org/multipage/scripting.html#check-the-usability-of-the-image-argument
|
// https://html.spec.whatwg.org/multipage/#check-the-usability-of-the-image-argument
|
||||||
try {
|
try {
|
||||||
destCtx.drawImage(sourceImg, 0, 0);
|
destCtx.drawImage(sourceImg, 0, 0);
|
||||||
// It makes the test fail if the exception is not thrown
|
// It makes the test fail if the exception is not thrown
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue