diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-07-07 19:16:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-07 19:16:31 -0700 |
commit | 9c00331634c2c753637a873f600b9804e6145e62 (patch) | |
tree | 0ede736924511b054e22bfa425bbd6e02d6b376e /python/tidy/servo_tidy | |
parent | a8fd13bac33bc55f0815883cce687def1cb69b01 (diff) | |
parent | 6c6bfdb523f5068a13422f91ed0766e6dc4575d5 (diff) | |
download | servo-9c00331634c2c753637a873f600b9804e6145e62.tar.gz servo-9c00331634c2c753637a873f600b9804e6145e62.zip |
Auto merge of #12313 - cynicaldevil:tidy-test, r=Wafflespeanut
test-tidy command now ignores files in subdirectories of ignored dirs
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12225 .
I did not add a test for this, instead I added a directory with an empty file inside the ignored directory, and checked whether this file was being ignored or not.
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12313)
<!-- Reviewable:end -->
Diffstat (limited to 'python/tidy/servo_tidy')
-rw-r--r-- | python/tidy/servo_tidy/tidy.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index fa0708d403a..234c50727d5 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -636,7 +636,7 @@ def get_file_list(directory, only_changed_files=False, exclude_dirs=[]): args = ["git", "ls-files", "--others", "--exclude-standard", directory] file_list += subprocess.check_output(args) for f in file_list.splitlines(): - if os.path.join('.', os.path.dirname(f)) not in exclude_dirs: + if not any(os.path.join('.', os.path.dirname(f)).startswith(path) for path in exclude_dirs): yield os.path.join('.', f) elif exclude_dirs: for root, dirs, files in os.walk(directory, topdown=True): |