From 14bb87e7136ae8ae22df2175e37c4ef54f40c523 Mon Sep 17 00:00:00 2001 From: jgraham Date: Thu, 18 Apr 2019 11:17:30 +0000 Subject: [PATCH] Bug 1541545 [wpt PR 15952] - Consolidate .gitignore files under the root., a=testonly Automatic update from web-platform-tests Consolidate .gitignore files under the root (#15952) Multiple .gitignores aren't supported by the manifest update code when running against the filesystem, so put all the rules in the root file instead. This also adds a lint to check for extra .gitignore files. -- wpt-commits: 46712a196fbac08bac95203f4d0861d25268ea7f wpt-pr: 15952 --- testing/web-platform/tests/.gitignore | 32 ++++++++++++++----- .../annotation-model/annotations/.gitignore | 0 .../annotations/bodiesTargets/.gitignore | 0 .../annotation-model/collections/.gitignore | 0 .../annotation-model/definitions/.gitignore | 0 .../annotation-protocol/server/.gitignore | 0 .../tests/annotation-vocab/tools/.gitignore | 0 .../tests/conformance-checkers/.gitignore | 1 - .../tests/cors/resources/.gitignore | 1 - testing/web-platform/tests/css/.gitignore | 15 --------- .../css-rhythm/tools/generators/.gitignore | 1 - .../tools/generators/.gitignore | 1 - .../web-platform/tests/resources/.gitignore | 3 -- testing/web-platform/tests/tools/lint/lint.py | 24 +++++++++++++- .../web-platform/tests/webaudio/.gitignore | 1 - 15 files changed, 47 insertions(+), 32 deletions(-) delete mode 100644 testing/web-platform/tests/annotation-model/annotations/.gitignore delete mode 100644 testing/web-platform/tests/annotation-model/annotations/bodiesTargets/.gitignore delete mode 100644 testing/web-platform/tests/annotation-model/collections/.gitignore delete mode 100644 testing/web-platform/tests/annotation-model/definitions/.gitignore delete mode 100644 testing/web-platform/tests/annotation-protocol/server/.gitignore delete mode 100644 testing/web-platform/tests/annotation-vocab/tools/.gitignore delete mode 100644 testing/web-platform/tests/conformance-checkers/.gitignore delete mode 100644 testing/web-platform/tests/cors/resources/.gitignore delete mode 100644 testing/web-platform/tests/css/.gitignore delete mode 100644 testing/web-platform/tests/css/css-rhythm/tools/generators/.gitignore delete mode 100644 testing/web-platform/tests/css/css-writing-modes/tools/generators/.gitignore delete mode 100644 testing/web-platform/tests/resources/.gitignore delete mode 100644 testing/web-platform/tests/webaudio/.gitignore diff --git a/testing/web-platform/tests/.gitignore b/testing/web-platform/tests/.gitignore index 8e3a85183ef9..cc4bd700eeae 100644 --- a/testing/web-platform/tests/.gitignore +++ b/testing/web-platform/tests/.gitignore @@ -1,18 +1,20 @@ # Python *.py[co] -.virtualenv/ -_venv/ .cache/ +.coverage* .pytest_cache/ .tox/ -.coverage* +.virtualenv/ +_venv/ +_virtualenv/ # Node node_modules/ # WPT repo stuff -/MANIFEST.json .wptcache/ +/MANIFEST.json +/_certs /config.json # Files generated when regenerating pre-generated certs @@ -22,11 +24,25 @@ node_modules/ # Various OS/editor specific files *# +*.orig +*.rej +*.svn *.sw[po] +*.xcodeproj +*Thumbs.db *~ -\#* -scratch +.DS_Store +.directory* .idea/ .vscode/ -.DS_Store -*.rej +\#* +scratch + +# Testsuite-specific rules +/conformance-checkers/vnu.jar +/cors/resources/log.txt +/css/build-temp +/css/dist +/css/dist_last +/css/tools/cache +/webaudio/idl/* diff --git a/testing/web-platform/tests/annotation-model/annotations/.gitignore b/testing/web-platform/tests/annotation-model/annotations/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/testing/web-platform/tests/annotation-model/annotations/bodiesTargets/.gitignore b/testing/web-platform/tests/annotation-model/annotations/bodiesTargets/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/testing/web-platform/tests/annotation-model/collections/.gitignore b/testing/web-platform/tests/annotation-model/collections/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/testing/web-platform/tests/annotation-model/definitions/.gitignore b/testing/web-platform/tests/annotation-model/definitions/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/testing/web-platform/tests/annotation-protocol/server/.gitignore b/testing/web-platform/tests/annotation-protocol/server/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/testing/web-platform/tests/annotation-vocab/tools/.gitignore b/testing/web-platform/tests/annotation-vocab/tools/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/testing/web-platform/tests/conformance-checkers/.gitignore b/testing/web-platform/tests/conformance-checkers/.gitignore deleted file mode 100644 index 3837fedbba66..000000000000 --- a/testing/web-platform/tests/conformance-checkers/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vnu.jar diff --git a/testing/web-platform/tests/cors/resources/.gitignore b/testing/web-platform/tests/cors/resources/.gitignore deleted file mode 100644 index 7b987d03655f..000000000000 --- a/testing/web-platform/tests/cors/resources/.gitignore +++ /dev/null @@ -1 +0,0 @@ -logs.txt diff --git a/testing/web-platform/tests/css/.gitignore b/testing/web-platform/tests/css/.gitignore deleted file mode 100644 index 7b1bd439b774..000000000000 --- a/testing/web-platform/tests/css/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -/dist -/dist_last -/build-temp -/tools/cache -/tools/_virtualenv -*.xcodeproj -*.DS_Store -*.pyc -*.svn -.directory* -*~ -*.orig -*Thumbs.db -/_certs -/config.json diff --git a/testing/web-platform/tests/css/css-rhythm/tools/generators/.gitignore b/testing/web-platform/tests/css/css-rhythm/tools/generators/.gitignore deleted file mode 100644 index 3c3629e647f5..000000000000 --- a/testing/web-platform/tests/css/css-rhythm/tools/generators/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/testing/web-platform/tests/css/css-writing-modes/tools/generators/.gitignore b/testing/web-platform/tests/css/css-writing-modes/tools/generators/.gitignore deleted file mode 100644 index 3c3629e647f5..000000000000 --- a/testing/web-platform/tests/css/css-writing-modes/tools/generators/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/testing/web-platform/tests/resources/.gitignore b/testing/web-platform/tests/resources/.gitignore deleted file mode 100644 index 04fdeda1cc4e..000000000000 --- a/testing/web-platform/tests/resources/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -ROBIN-TODO.txt -scratch -node_modules diff --git a/testing/web-platform/tests/tools/lint/lint.py b/testing/web-platform/tests/tools/lint/lint.py index 9976314c8fb2..b07dbcbeb929 100644 --- a/testing/web-platform/tests/tools/lint/lint.py +++ b/testing/web-platform/tests/tools/lint/lint.py @@ -134,6 +134,28 @@ def check_worker_collision(repo_root, path): return [] +def check_gitignore_file(repo_root, path): + if not path.endswith(".gitignore"): + return [] + + path_parts = path.split(os.path.sep) + if len(path_parts) == 1: + return [] + + if path_parts[-1] != ".gitignore": + return [] + + if (path_parts[0] in ["tools", "docs"] or + path_parts[:2] == ["resources", "webidl2"] or + path_parts[:3] == ["css", "tools", "apiclient"]): + return [] + + return [("GITIGNORE", + ".gitignore found outside the root", + path, + None)] + + def check_ahem_copy(repo_root, path): lpath = path.lower() if "ahem" in lpath and lpath.endswith(".ttf"): @@ -908,7 +930,7 @@ def lint(repo_root, paths, output_format): logger.info(line) return sum(itervalues(error_count)) -path_lints = [check_path_length, check_worker_collision, check_ahem_copy] +path_lints = [check_path_length, check_worker_collision, check_ahem_copy, check_gitignore_file] all_paths_lints = [check_css_globally_unique] file_lints = [check_regexp_line, check_parsed, check_python_ast, check_script_metadata] diff --git a/testing/web-platform/tests/webaudio/.gitignore b/testing/web-platform/tests/webaudio/.gitignore deleted file mode 100644 index 068fd1ef0665..000000000000 --- a/testing/web-platform/tests/webaudio/.gitignore +++ /dev/null @@ -1 +0,0 @@ -idl/* \ No newline at end of file