Closed ivaigult closed 3 years ago
Usually compile_commands.json is created by the build system at the build or generation time. It is never stored in a repo.
compile_commands.json
Is it possible to add extra option so the database is generated automatically somehow? I can think of this syntax:
repos: - repo: https://github.com/pocc/pre-commit-hooks rev: python hooks: - id: clang-tidy args: [-p __compdb/compile_commands.json] generate_compile_commands: ["mkdir __compdb", "cd __compdb", "cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON"]
Is something like this available? Would it make sense?
It's not possible to change the syntax of pre-commit-hooks with a generate_compile_commands option.
generate_compile_commands
There are a couple ways to go about this:
Usually
compile_commands.json
is created by the build system at the build or generation time. It is never stored in a repo.Is it possible to add extra option so the database is generated automatically somehow? I can think of this syntax:
Is something like this available? Would it make sense?