Added clang-tidy Makefile target
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -19,6 +19,7 @@ bin/
|
|||||||
/puml/
|
/puml/
|
||||||
/debug/
|
/debug/
|
||||||
/release/
|
/release/
|
||||||
|
/debug_tidy
|
||||||
/.cache
|
/.cache
|
||||||
docs/diagrams
|
docs/diagrams
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ Thanks for taking interest in `clang-uml`!
|
|||||||
make format
|
make format
|
||||||
git add . && git commit -m "Fixed formatting"
|
git add . && git commit -m "Fixed formatting"
|
||||||
```
|
```
|
||||||
|
* Make sure the code doesn't introduce any `clang-tidy` warnings:
|
||||||
|
```bash
|
||||||
|
make tidy
|
||||||
|
```
|
||||||
|
|
||||||
* Create a pull request from your branch to `master` branch
|
* Create a pull request from your branch to `master` branch
|
||||||
|
|
||||||
## If you would like to add a feature
|
## If you would like to add a feature
|
||||||
@@ -79,6 +84,7 @@ Thanks for taking interest in `clang-uml`!
|
|||||||
* 80-character line width
|
* 80-character line width
|
||||||
* snakes over camels
|
* snakes over camels
|
||||||
* use `make format` before submitting PR to ensure consistent formatting
|
* use `make format` before submitting PR to ensure consistent formatting
|
||||||
|
* use `make tidy` to check if your code doesn't introduce any `clang-tidy` warnings
|
||||||
* Add test case (or multiple test cases), which cover the new feature
|
* Add test case (or multiple test cases), which cover the new feature
|
||||||
* Finally, create a pull request!
|
* Finally, create a pull request!
|
||||||
|
|
||||||
|
|||||||
20
Makefile
20
Makefile
@@ -41,7 +41,7 @@ GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
|
|||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf debug release
|
rm -rf debug release debug_tidy
|
||||||
|
|
||||||
debug/CMakeLists.txt:
|
debug/CMakeLists.txt:
|
||||||
cmake -S . -B debug \
|
cmake -S . -B debug \
|
||||||
@@ -61,10 +61,24 @@ release/CMakeLists.txt:
|
|||||||
-DCMAKE_EXE_LINKER_FLAGS="$(CMAKE_EXE_LINKER_FLAGS)" \
|
-DCMAKE_EXE_LINKER_FLAGS="$(CMAKE_EXE_LINKER_FLAGS)" \
|
||||||
-DLLVM_VERSION=${LLVM_VERSION}
|
-DLLVM_VERSION=${LLVM_VERSION}
|
||||||
|
|
||||||
|
debug_tidy/CMakeLists.txt:
|
||||||
|
cmake -S . -B debug_tidy \
|
||||||
|
-DGIT_VERSION=$(GIT_VERSION) \
|
||||||
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
|
-DCMAKE_BUILD_TYPE=Debug \
|
||||||
|
-DBUILD_TESTS=OFF \
|
||||||
|
-DCMAKE_CXX_FLAGS="$(CMAKE_CXX_FLAGS)" \
|
||||||
|
-DCMAKE_EXE_LINKER_FLAGS="$(CMAKE_EXE_LINKER_FLAGS)" \
|
||||||
|
-DLLVM_VERSION=${LLVM_VERSION}
|
||||||
|
|
||||||
debug: debug/CMakeLists.txt
|
debug: debug/CMakeLists.txt
|
||||||
echo "Using ${NUMPROC} cores"
|
echo "Using ${NUMPROC} cores"
|
||||||
make -C debug -j$(NUMPROC)
|
make -C debug -j$(NUMPROC)
|
||||||
|
|
||||||
|
debug_tidy: debug_tidy/CMakeLists.txt
|
||||||
|
echo "Using ${NUMPROC} cores"
|
||||||
|
make -C debug_tidy -j$(NUMPROC)
|
||||||
|
|
||||||
release: release/CMakeLists.txt
|
release: release/CMakeLists.txt
|
||||||
make -C release -j$(NUMPROC)
|
make -C release -j$(NUMPROC)
|
||||||
|
|
||||||
@@ -106,6 +120,10 @@ clang-format:
|
|||||||
format:
|
format:
|
||||||
docker run --rm -v $(CURDIR):/root/sources bkryza/clang-format-check:1.3
|
docker run --rm -v $(CURDIR):/root/sources bkryza/clang-format-check:1.3
|
||||||
|
|
||||||
|
.PHONY: debug_tidy
|
||||||
|
tidy: debug_tidy
|
||||||
|
run-clang-tidy-12 -p debug_tidy ./src
|
||||||
|
|
||||||
.PHONY: check-formatting
|
.PHONY: check-formatting
|
||||||
check-formatting:
|
check-formatting:
|
||||||
./util/check_formatting.sh
|
./util/check_formatting.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user