Bug 1438566 - pass clang-format from ~/mozbuild/clang-tools to clang-format-diff. r=sylvestre

MozReview-Commit-ID: HgHOv1k7I5p

--HG--
extra : rebase_source : 122d8ab3985033cfada63daa357a30b7074a56a2
This commit is contained in:
Andi-Bogdan Postelnicu 2018-02-15 19:21:35 +02:00
Родитель 230d90353f
Коммит a6d739ef29
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -1727,7 +1727,8 @@ class StaticAnalysis(MachCommandBase):
return rc
if path is None:
return self._run_clang_format_diff(self._clang_format_diff, show)
return self._run_clang_format_diff(self._clang_format_diff,
self._clang_format_path, show)
else:
return self._run_clang_format_path(self._clang_format_path, show, path)
@ -1936,13 +1937,14 @@ class StaticAnalysis(MachCommandBase):
args += [':({0}){1}'.format(','.join(magics), pattern)]
return args
def _run_clang_format_diff(self, clang_format_diff, show):
def _run_clang_format_diff(self, clang_format_diff, clang_format, show):
# Run clang-format on the diff
# Note that this will potentially miss a lot things
from subprocess import Popen, PIPE, check_output, CalledProcessError
diff_process = Popen(self._get_clang_format_diff_command(), stdout=PIPE)
args = [sys.executable, clang_format_diff, "-p1"]
args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
if not show:
args.append("-i")
try: