Files
prplMesh/clang-format.sh
Raphaël Mélotte f41b8b7ee9 tools: clang-format: run only on tracked files
When running clang-format (both in docker and natively), it would
segfault under certain circumstances which made it impossible to run
it locally (it never failed this way in CI).

After a short investigation, it turns out it would always segfault on
the same (generated) file:
CMakeFiles/3.15.5/CompilerIdC/CMakeCCompilerId.c

We could adapt the find command used in the top-level clang-format to
exclude CMakeFiles directories. However, it would still potentially
run on many other generated files, while we're really only interested
in formatting the files we track with git.

Use git-ls-files to get the list of tracked files, filter it to keep
only the file extensions we're interested in, and run clang-format on
them.

Since the prplmesh-runner image does not include git, we have to adapt
tools/docker/clang-format.sh to run with the prplmesh-builder
image. Note that the clang-format job that runs in CI was already
using the prplmesh-builder image.

While we're at it, fix shellcheck issues in both clang-format.sh
scripts.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
2020-03-24 15:20:05 +00:00

483 B
Executable File