servo: Merge #13955 - Don't check untracked file in tidy (from shinglyu:tidy-untrack); r=Wafflespeanut
<!-- Please describe your changes on the following line: --> As discussed in #13938, disabling tidy check on untracked file to reduce noise --- <!-- 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 #13938 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because mocking `git` calls for the unit test is probably not worth the effort. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: afa55dcf5573d6b535a8e9681d42fe51e1ff01d1
This commit is contained in:
@@ -830,14 +830,11 @@ def check_dep_license_errors(filenames, progress=True):
|
||||
|
||||
def get_file_list(directory, only_changed_files=False, exclude_dirs=[]):
|
||||
if only_changed_files:
|
||||
# only check the files that have been changed since the last merge
|
||||
# only check tracked files that have been changed since the last merge
|
||||
args = ["git", "log", "-n1", "--author=bors-servo", "--format=%H"]
|
||||
last_merge = subprocess.check_output(args).strip()
|
||||
args = ["git", "diff", "--name-only", last_merge, directory]
|
||||
file_list = subprocess.check_output(args)
|
||||
# also check untracked files
|
||||
args = ["git", "ls-files", "--others", "--exclude-standard", directory]
|
||||
file_list += subprocess.check_output(args)
|
||||
for f in file_list.splitlines():
|
||||
f = os.path.join(*f.split("/")) if sys.platform == "win32" else f
|
||||
if not any(os.path.join('.', os.path.dirname(f)).startswith(path) for path in exclude_dirs):
|
||||
|
||||
Reference in New Issue
Block a user