You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- repo: https://github.com/pocc/pre-commit-hooks
rev: master
hooks:
- id: clang-format
args: [-i]
- id: clang-tidy
# - id: oclint# - id: uncrustify# - id: cppcheck# - id: cpplint
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.
[WARNING] The 'rev' field of repo 'https://github.com/pocc/pre-commit-hooks' appears to be a mutablereference (moving tag / branch). Mutable references are never updated after first install and are not supported. See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details. Hint: `pre-commit autoupdate` often fixes this.
trim trailing whitespace.................................................Passed
check for added large files..............................................Passed
clang-format.............................................................Passed
clang-tidy...............................................................Failed
- hook id: clang-tidy
- exit code: 1
/Users/chendongsheng/github/cmake_test/app/main.cpp:1:10: error: 'lib1.h' file not found [clang-diagnostic-error]
#include"lib1.h"
^~~~~~~~
Error while trying to load a compilation database:
Could notauto-detect compilation database for file "lib1/aaa.cpp"
No compilation database found in /Users/chendongsheng/github/cmake_test/lib1 or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
Error while trying to load a compilation database:
Could notauto-detect compilation database for file "app/main.cpp"
No compilation database found in /Users/chendongsheng/github/cmake_test/app or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
1 error generated.
Error while processing /Users/chendongsheng/github/cmake_test/app/main.cpp.
Found compiler error(s).
The text was updated successfully, but these errors were encountered:
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.txtand cmake generate file named
compile_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:
The text was updated successfully, but these errors were encountered: