servo: Merge #13955 - Don't check untracked file in tidy (from shinglyu:tidy-untrack); r=Wafflespeanut
authorShing Lyu <shing.lyu@gmail.com>
Thu, 27 Oct 2016 23:07:53 -0500
changeset 340000 5715901eb610b1886795e567c9320bb8e36a415c
parent 339999 b57e3657949c211e6c840f58a997d501f89d393a
child 340001 105cb99de7a81db4f287aae43efaa86fd93755c6
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWafflespeanut
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
servo/python/tidy/servo_tidy/tidy.py
--- a/servo/python/tidy/servo_tidy/tidy.py
+++ b/servo/python/tidy/servo_tidy/tidy.py
@@ -825,24 +825,21 @@ def check_dep_license_errors(filenames, 
                 for license_line in licenses_dep_toml:
                     ok_licensed |= (license_line in line)
             if not ok_licensed:
                 yield (filename, 0, "dependency should contain a valid license.")
 
 
 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):
                 yield os.path.join('.', f)
     elif exclude_dirs:
         for root, dirs, files in os.walk(directory, topdown=True):
             # modify 'dirs' in-place so that we don't do unwanted traversals in excluded directories
             dirs[:] = [d for d in dirs if not any(os.path.join(root, d).startswith(name) for name in exclude_dirs)]