Skip to content

Commit

Permalink
avoid creating symlink to clang format config (#16)
Browse files Browse the repository at this point in the history
resolves #14

Change-Id: I1ac2d54dee77c9d9ecd93bdd3b38a6b0856caf0f
  • Loading branch information
oliverlee authored Jun 28, 2024
1 parent bf274e2 commit fac6585
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 1 addition & 3 deletions defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit fac6585

Please sign in to comment.