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 -->
This commit is contained in:
bors-servo 2016-07-07 19:16:31 -07:00 committed by GitHub
commit 9c00331634
2 changed files with 1 additions and 1 deletions

View file

@ -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):