Skip to content

Commit

Permalink
[nfc] invoke check_clang_format only when clang_format is invoked (#2787
Browse files Browse the repository at this point in the history
)

I guess it will go away once clang_format is managed by bazel, but
right now it is a nuisanse since we've disable clang_format.
  • Loading branch information
mikea authored Sep 24, 2024
1 parent de462cb commit 89ab8b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/cross/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def run_bazel_tool(tool_name: str, args: list[str]) -> subprocess.CompletedProce


def clang_format(files: list[Path], check: bool = False) -> bool:
check_clang_format()
cmd = [CLANG_FORMAT]
if check:
cmd += ["--dry-run", "--Werror"]
Expand Down Expand Up @@ -258,7 +259,6 @@ def format(config: FormatConfig, files: list[Path], check: bool) -> tuple[bool,

def main() -> None:
options = parse_args()
check_clang_format()
if options.subcommand == "git":
files = git_get_modified_files(options.target, options.source, options.staged)
else:
Expand Down

0 comments on commit 89ab8b0

Please sign in to comment.