From 7764e9d137d83b7b5f3bd9301ca8447e20751c44 Mon Sep 17 00:00:00 2001 From: Oliver Lee Date: Fri, 28 Jun 2024 13:56:36 -0700 Subject: [PATCH] avoid creating symlink to clang format config resolves #14 Change-Id: I1ac2d54dee77c9d9ecd93bdd3b38a6b0856caf0f --- README.md | 2 +- defs.bzl | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8d17407..bf2ffbb 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ build:clang-format-base --@bazel_clang_format//:ignore=//:clang-format-ignore ## Requirements - Bazel ??? -- clang-format ??? +- ClangFormat 14 I'm not sure what the minimum versions are but please let me know if you are using a version that doesn't work. diff --git a/defs.bzl b/defs.bzl index b9ff02d..3b8d012 100644 --- a/defs.bzl +++ b/defs.bzl @@ -25,13 +25,11 @@ def _do_format(ctx, f, format_options, execution_reqs): command = """ set -euo pipefail -test -e .clang-format || ln -s -f {config} .clang-format - # https://github.com/llvm/llvm-project/issues/46336 # although newer versions of clang-format (e.g. 18.1.4) *do* appear to work # with symlinks # -{binary} {format_options} $(readlink --canonicalize {infile}) +{binary} -style=file:{config} {format_options} $(readlink --canonicalize {infile}) touch {outfile} """.format(