Open dshengChen opened 1 year ago
(openai) ➜ cmake_test git:(master) ✗ pre-commit --version
pre-commit 3.2.1
(openai) ➜ cmake_test git:(master) ✗ clang-tidy --version
Homebrew LLVM version 16.0.6
Optimized build.
My workSpace look like:
(openai) ➜ cmake_test git:(master) ✗ tree -L 1
.
├── CMakeLists.txt
├── aaa.plist
├── app
├── build
├── defaults.cfg
├── lib1
├── lib2
├── readme.md
└── tmp
and compile_commands.json
is under folder build
.
when I copy ./build/compiler_commands.json
into ./lib1/
and ./lib2/
folder.
The problem is fixed.
so I thinkd it's shoudle because the pre-commit can't find the file compiler_commands.json
.
how coulde other peopel not see this problem? Is I miss something setting?
my pre-commit file look like:
and it's a cmake c++ projects and I added
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
on my cmakelist.txt and cmake generate file namedcompile_commands.json
and it`s contain the file c++ src file path.but when i try to run
pre-commit run --all-files
I got error like: