scripts: rename run_tool to run_clang_tool
Differentiate from the "run_tool_on_targets" function that will be introduced in the next commit. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
ef612343d9
commit
dafa6a7ac1
|
@ -8,7 +8,7 @@ import subprocess
|
|||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
from .run_tool import run_tool
|
||||
from .run_tool import run_clang_tool
|
||||
from ..environment import detect_clangformat
|
||||
from ..mesonlib import version_compare
|
||||
from ..programs import ExternalProgram
|
||||
|
@ -57,4 +57,4 @@ def run(args: T.List[str]) -> int:
|
|||
else:
|
||||
cformat_ver = None
|
||||
|
||||
return run_tool('clang-format', srcdir, builddir, run_clang_format, exelist, options, cformat_ver)
|
||||
return run_clang_tool('clang-format', srcdir, builddir, run_clang_format, exelist, options, cformat_ver)
|
||||
|
|
|
@ -11,7 +11,7 @@ import os
|
|||
import shutil
|
||||
import sys
|
||||
|
||||
from .run_tool import run_tool
|
||||
from .run_tool import run_clang_tool
|
||||
from ..environment import detect_clangtidy, detect_clangapply
|
||||
import typing as T
|
||||
|
||||
|
@ -56,7 +56,7 @@ def run(args: T.List[str]) -> int:
|
|||
fixesdir.unlink()
|
||||
fixesdir.mkdir(parents=True)
|
||||
|
||||
tidyret = run_tool('clang-tidy', srcdir, builddir, run_clang_tidy, tidyexe, builddir, fixesdir)
|
||||
tidyret = run_clang_tool('clang-tidy', srcdir, builddir, run_clang_tidy, tidyexe, builddir, fixesdir)
|
||||
if fixesdir is not None:
|
||||
print('Applying fix-its...')
|
||||
applyret = subprocess.run(applyexe + ['-format', '-style=file', '-ignore-insert-conflict', fixesdir]).returncode
|
||||
|
|
|
@ -27,7 +27,7 @@ def parse_pattern_file(fname: Path) -> T.List[str]:
|
|||
pass
|
||||
return patterns
|
||||
|
||||
def run_tool(name: str, srcdir: Path, builddir: Path, fn: T.Callable[..., subprocess.CompletedProcess], *args: T.Any) -> int:
|
||||
def run_clang_tool(name: str, srcdir: Path, builddir: Path, fn: T.Callable[..., subprocess.CompletedProcess], *args: T.Any) -> int:
|
||||
patterns = parse_pattern_file(srcdir / f'.{name}-include')
|
||||
globs: T.Union[T.List[T.List[Path]], T.List[T.Generator[Path, None, None]]]
|
||||
if patterns:
|
||||
|
|
Loading…
Reference in New Issue