Skip to content

Commit 6fc673e

Browse files
committed
docs(lint): #34: update instructions for working with linters
1 parent 71b154f commit 6fc673e

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,27 @@ When the project configuration is finished, click Build to build the project.
3838
To launch the executable, click Launch in the CMake extension.
3939
<p style="text-align: center;"><img src="docs/images/cmakeLaunch.png" alt="cmakeLaunch" width="400"/></p>
4040

41-
## How to run clang-tidy static code analyzer
41+
## Linters
4242

43-
To run clang-tidy, run the following command:
44-
```
45-
find ./src -name "*.cpp" -not -path "*/build/*" -exec echo "Checking {}..." \; -exec clang-tidy --config-file=.clang-tidy {} -- -I./include -std=c++20 \;
46-
```
43+
The project includes the `clang-tidy` code analyzer and the `clang-format` formatter. Configuration files are located in the project root: `.clang-tidy` and `.clang-format`, respectively.
44+
45+
To use linters you need to install:
46+
- [VSCode](https://code.visualstudio.com/)
47+
- [C/C++ VSCode Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
48+
49+
### Clang-format
50+
51+
Clang-format code formatting occurs automatically when saving a file using the CodeAnalysis C/C++ extension.
52+
53+
To start manually, you need to run the command `find ./src -name "*.cpp" -o -name "*.h" | xargs clang-format --dry-run`, while in the root of the project.
54+
55+
To automatically fix errors, run `find ./src -name "*.cpp" -o -name "*.h" | xargs clang-format -i` from the project root.
56+
57+
### Clang-tidy
58+
59+
Clang-tidy code checking occurs in the background using the CodeAnalysis C/C++ extension.
60+
61+
To start manually, you need to run the command `find ./src -name "*.cpp" -o -name "*.h" | xargs clang-tidy -p ./build/Debug | grep "error:"`, while in the root of the project.
4762

4863
## Tests run
4964

0 commit comments

Comments
 (0)