diff options
author | Simon Martin <simartin@users.sourceforge.net> | 2016-07-23 15:29:46 +0200 |
---|---|---|
committer | Simon Martin <simartin@users.sourceforge.net> | 2016-08-09 22:04:57 +0200 |
commit | 1e60c915f947444d524185ffed761f17a274226b (patch) | |
tree | 2fc3dd14430b45d094e170cb162c6c08997847e2 /python/tidy/servo_tidy | |
parent | 5e83b3f83bfcf48d0096442bdf5c9bf753623970 (diff) | |
download | servo-1e60c915f947444d524185ffed761f17a274226b.tar.gz servo-1e60c915f947444d524185ffed761f17a274226b.zip |
Issue #12421: tidy should also check .html files
Diffstat (limited to 'python/tidy/servo_tidy')
-rw-r--r-- | python/tidy/servo_tidy/tidy.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index 81c360aa190..61251983e19 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -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_CHECK = ["*.rs", "*.rc", "*.cpp", "*.c", "*.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_TO_IGNORE = ["*.#*", "*.pyc"] @@ -44,6 +44,11 @@ IGNORED_FILES = [ os.path.join(".", "tests", "wpt", "metadata-css", "MANIFEST.json"), os.path.join(".", "components", "script", "dom", "webidls", "ForceTouchEvent.webidl"), 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 # `"__TEXT,_info_plist"` inside an attribute. 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): - 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 while lines and (lines[0].startswith(EMACS_HEADER) or lines[0].startswith(VIM_HEADER)): lines = lines[1:] @@ -168,7 +173,7 @@ def check_modeline(file_name, lines): 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 # Prefer shorter lines when shell scripting. 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): - 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) (has_element, file_iter) = is_iter_empty(file_iter) if not has_element: |