Skip to content

Commit 4884c32

Browse files
TheMrAIerenon
authored andcommitted
Fix minor markdown omissions
Added types to fenced blocks, that were missing it. Replaced code block by indentation with regular fenced block. Replaced numbered list usage to use only 1s instead of hard-coded values. This makes it easier to add/remove list elements as markdown will handle the number increment internally during list rendering.
1 parent 575a312 commit 4884c32

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ git_repository(
2323
You can now compile using the default clang tidy configuration provided using
2424
the following command;
2525

26-
```
26+
```text
2727
bazel build //... \
2828
--aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect \
2929
--output_groups=report
@@ -55,11 +55,10 @@ bazel build //... \
5555

5656
: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.
5757

58-
5958
Now if you don't want to type this out every time, it is recommended that you
6059
add a config in your .bazelrc that matches this command line;
6160

62-
```
61+
```text
6362
# Required for bazel_clang_tidy to operate as expected
6463
build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
6564
build:clang-tidy --output_groups=report
@@ -75,9 +74,11 @@ bazel build //... --config clang-tidy
7574
```
7675

7776
### use a non-system clang-tidy
77+
7878
by default, bazel_clang_tidy uses the system provided clang-tidy.
7979
If you have a hermetic build, you can use your own clang-tidy target like this:
80-
```
80+
81+
```text
8182
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_executable=@local_config_cc//:clangtidy_bin
8283
```
8384

@@ -99,18 +100,22 @@ Edit `.clang-tidy` as needed.
99100

100101
To see the tool in action:
101102

102-
1. Clone the repository
103-
2. Run clang-tidy:
103+
1. Clone the repository
104+
1. Run clang-tidy:
104105

105-
bazel build //example --aspects clang_tidy/clang_tidy.bzl%clang_tidy_aspect --output_groups=report
106+
```sh
107+
bazel build //example --aspects clang_tidy/clang_tidy.bzl%clang_tidy_aspect --output_groups=report
108+
```
106109

107-
3. Check the error:
110+
1. Check the error:
108111

109-
lib.cpp:4:43: error: the parameter 'name' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] std::string lib_get_greet_for(std::string name)
110-
Aspect //clang_tidy:clang_tidy.bzl%clang_tidy_aspect of //example:app failed to build
112+
```text
113+
lib.cpp:4:43: error: the parameter 'name' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] std::string lib_get_greet_for(std::string name)
114+
Aspect //clang_tidy:clang_tidy.bzl%clang_tidy_aspect of //example:app failed to build
115+
```
111116

112-
4. Fix the error by changing `lib.cpp` only.
113-
5. Re-run clang-tidy with the same command. Observe that it does not run clang-tidy for `app.cpp`: the cached report is re-used.
117+
1. Fix the error by changing `lib.cpp` only.
118+
1. Re-run clang-tidy with the same command. Observe that it does not run clang-tidy for `app.cpp`: the cached report is re-used.
114119

115120
## Requirements
116121

0 commit comments

Comments
 (0)