aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy.py
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2015-08-24 20:28:47 -0400
committerCorey Farwell <coreyf@rwell.org>2015-08-24 20:34:01 -0400
commit662b64ffe4509435dc7a0d9d0d9058663c73be15 (patch)
tree0b50e495afe851ad3a78f908c4dc3f6726d9be97 /python/tidy.py
parentc790c4d4cd7f6a1babb7f257cfa52e3cd31730fc (diff)
downloadservo-662b64ffe4509435dc7a0d9d0d9058663c73be15.tar.gz
servo-662b64ffe4509435dc7a0d9d0d9058663c73be15.zip
Make tidy search for files recursively again
In #7348 `os.walk` was replaced with `os.listdir`. The latter is not recursive, which results in only the root directory files getting linted The changes to `ignored_files` are needed because calling `os.walk(".")` results in `./` getting prefixed before each path
Diffstat (limited to 'python/tidy.py')
-rw-r--r--python/tidy.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/python/tidy.py b/python/tidy.py
index 4d039ca6e4d..88e86d68502 100644
--- a/python/tidy.py
+++ b/python/tidy.py
@@ -27,26 +27,26 @@ python_dependencies = [
ignored_files = [
# Upstream
- "support/*",
- "tests/wpt/*",
- "python/mach/*",
- "python/mozdebug/*",
- "python/mozinfo/*",
- "python/mozlog/*",
- "python/toml/*",
- "components/script/dom/bindings/codegen/parser/*",
- "components/script/dom/bindings/codegen/ply/*",
+ "./support/*",
+ "./tests/wpt/*",
+ "./python/mach/*",
+ "./python/mozdebug/*",
+ "./python/mozinfo/*",
+ "./python/mozlog/*",
+ "./python/toml/*",
+ "./components/script/dom/bindings/codegen/parser/*",
+ "./components/script/dom/bindings/codegen/ply/*",
# Generated and upstream code combined with our own. Could use cleanup
- "target/*",
- "ports/gonk/src/native_window_glue.cpp",
- "ports/cef/*",
+ "./target/*",
+ "./ports/gonk/src/native_window_glue.cpp",
+ "./ports/cef/*",
# MIT license
- "components/util/deque/mod.rs",
+ "./components/util/deque/mod.rs",
# Hidden files/directories
- ".*",
+ "./.*",
]
@@ -384,14 +384,14 @@ def check_reftest_html_files_in_basic_list(reftest_dir):
def scan():
sys.path += python_dependencies
- all_files = os.listdir(".")
+ all_files = (os.path.join(r, f) for r, _, files in os.walk(".") for f in files)
files_to_check = filter(should_check, all_files)
checking_functions = [check_license, check_by_line, check_flake8, check_toml,
check_rust, check_webidl_spec, check_spec]
errors = collect_errors_for_files(files_to_check, checking_functions)
- reftest_files = [os.path.join(reftest_dir, file) for file in os.listdir(reftest_dir)]
+ reftest_files = (os.path.join(r, f) for r, _, files in os.walk(reftest_dir) for f in files)
reftest_to_check = filter(should_check_reftest, reftest_files)
r_errors = check_reftest_order(reftest_to_check)
not_found_in_basic_list_errors = check_reftest_html_files_in_basic_list(reftest_dir)