Files
system76-embedded-controller/scripts/clang-format.sh
Tim Crawford 04df6ae311 Add .clang-format
Most options are configured to keep most of the current style.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-03-22 12:52:47 -06:00

17 lines
317 B
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-only
FILES=($(git ls-files '*.[ch]'))
FMT_OPTS=(
"-style=file"
"--fallback-style=none"
"--Werror"
)
if [[ "$1" = "apply" ]]; then
clang-format "${FMT_OPTS[@]}" -i "${FILES[@]}"
else
clang-format "${FMT_OPTS[@]}" --dry-run "${FILES[@]}"
fi