ci: Include pre-build style check

This commit is contained in:
Dorota Czaplejewicz
2021-12-08 19:42:58 +00:00
parent f986f14220
commit 7a07f1616d
5 changed files with 38 additions and 3 deletions

View File

@ -1,13 +1,15 @@
#!/bin/sh
# Enforces style check for the C parts of the project.
if [ -z "$1" ]; then
echo "Please pass directory to check."
echo "Please pass build directory to check."
exit 1
fi
cd "$1"
clang-tidy --checks=-clang-diagnostic-missing-braces,readability-braces-around-statements, \
--warnings-as-errors=readability-braces-around-statements \
-extra-arg=-Wno-unknown-warning-option \
../src/*.c ../eek/*.c ../eekboard/*.c

12
tools/style-check_source Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Enforces style check for the project.
THIS=$(realpath $0)
TOOLS=$(dirname $THIS)
cd $TOOLS/..
# The CI file seems to be touched regularly, and causing problems often,
# unlike layout files.
./tools/yamlfmt ./.gitlab-ci.yml $1