Skip to content

Commit 31d62bf

Browse files
adrianimbodenerenon
authored andcommitted
add instructions for hermetic build
Sorry, I did forget to update the documentation in my previous PR. I also did run into a problem with where the .clang-tidy file lies. I also added that to the doc.
1 parent b8c0567 commit 31d62bf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ bazel build //... \
5353
--@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config
5454
```
5555

56+
:exclamation: the config-file will not be forced by adding it to the clang-tidy command line. Therefore it must be in one of the parents of all source files. It is recommended to put it in the root directly besides the WORKSPACE file.
57+
58+
5659
Now if you don't want to type this out every time, it is recommended that you
5760
add a config in your .bazelrc that matches this command line;
5861

@@ -71,6 +74,13 @@ Now from the command line this is a lot nicer to use;
7174
bazel build //... --config clang-tidy
7275
```
7376

77+
### use a non-system clang-tidy
78+
by default, bazel_clang_tidy uses the system provided clang-tidy.
79+
If you have a hermetic build, you can use your own clang-tidy target like this:
80+
```
81+
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_executable=@local_config_cc//:clangtidy_bin
82+
```
83+
7484
## Features
7585

7686
- Run clang-tidy on any C++ target
@@ -102,4 +112,3 @@ To see the tool in action:
102112
## Requirements
103113

104114
- Bazel 4.0 or newer (might work with older versions)
105-
- clang-tidy on $PATH. (if not, edit `run_clang_tidy.sh`)

0 commit comments

Comments
 (0)