Closed Pagghiu closed 9 months ago
We should really add a GitHub pipeline that fails if the code is not formatted with clang-format.
clang-format
The script should be along these lines:
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) ROOT_DIR="${SCRIPT_DIR}/.." SOURCE_DIR="${ROOT_DIR}/../SC" HOST_TOOLS="${ROOT_DIR}/_Build/HostTools" CLANG_FORMAT="$HOST_TOOLS/clang/bin/clang-format" cd "${SOURCE_DIR}" && find . \( -iname \*.h -o -iname \*.cpp -o -iname \*.mm -o -iname \*.m -o -iname \*.inl \) -not \( -path "*/Dependencies/*" -o -path "*/Build/Windows/resource.h" \) | xargs "${CLANG_FORMAT}" -i
This is actually now being done by the linux CI job see
https://github.com/Pagghiu/SaneCppLibraries/blob/main/.github/workflows/linux.yml#L20
We should really add a GitHub pipeline that fails if the code is not formatted with
clang-format
.The script should be along these lines: