Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a longstanding issue in the
scripts/clang-tidy.sh
script. Previously if the build failed it would leave behind an emptybuild/compile_commands.json
. Then - when you went to run thetidy
target again - the script logic would see thatbuild/compile_commands.json
existed andwould avoid running the build again, leading clang-tidy to spuriously report nothing.
This change improves the script to avoid the possibility that it will write an empty
build/compile_commands.json
Context: The
scripts/generate_compile_commands.py
is needed to reformat the build out into this specific format (https://clang.llvm.org/docs/JSONCompilationDatabase.html). Some build systems can do this automatically (like cmake https://cmake.org/cmake/help/v3.5/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html) but here we use gyp, which cannot. So thescripts/generate_compile_commands.py
is my attempt to bolt this functionality onto gyp./cc @AllieOop for final PR. This PR is a subset created via https://github.com/mapbox/node-cpp-skel/pull/118/files#diff-297d66ab0c294f76d1a7ab83006a7383