Skip to content

Commit

Permalink
scripts: rename run_tool to run_clang_tool
Browse files Browse the repository at this point in the history
Differentiate from the "run_tool_on_targets" function that will be introduced
in the next commit.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini authored and dcbaker committed Dec 19, 2024
1 parent ef61234 commit dafa6a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mesonbuild/scripts/clangformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
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
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions mesonbuild/scripts/clangtidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/scripts/run_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dafa6a7

Please sign in to comment.