Enforce clang-format on commit for core files

enforce-clang-format
skullY 5 years ago
parent 5ef7c7fef3
commit 8616cfa542

@ -17,6 +17,7 @@ if grep ID /etc/os-release | grep -qE "fedora"; then
avr-gcc \ avr-gcc \
avr-libc \ avr-libc \
binutils-avr32-linux-gnu \ binutils-avr32-linux-gnu \
clang \
dfu-util \ dfu-util \
dfu-programmer \ dfu-programmer \
diffutils \ diffutils \
@ -42,6 +43,7 @@ elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
avr-libc \ avr-libc \
binutils-arm-none-eabi \ binutils-arm-none-eabi \
binutils-avr \ binutils-avr \
clang-format \
dfu-programmer \ dfu-programmer \
dfu-util \ dfu-util \
diffutils \ diffutils \
@ -66,6 +68,7 @@ elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
avr-libc \ avr-libc \
avr-gcc \ avr-gcc \
base-devel \ base-devel \
clang \
dfu-util \ dfu-util \
diffutils \ diffutils \
gcc \ gcc \
@ -94,6 +97,7 @@ elif grep ID /etc/os-release | grep -q gentoo; then
dev-embedded/avrdude \ dev-embedded/avrdude \
dev-lang/python:3.5 \ dev-lang/python:3.5 \
net-misc/wget \ net-misc/wget \
sys-devel/clang \
sys-devel/gcc \ sys-devel/gcc \
sys-devel/crossdev sys-devel/crossdev
sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
@ -110,6 +114,7 @@ elif grep ID /etc/os-release | grep -q sabayon; then
dev-embedded/avrdude \ dev-embedded/avrdude \
dev-lang/python \ dev-lang/python \
net-misc/wget \ net-misc/wget \
sys-devel/clang \
sys-devel/gcc \ sys-devel/gcc \
sys-devel/crossdev sys-devel/crossdev
sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
@ -124,6 +129,7 @@ elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
fi fi
sudo zypper install \ sudo zypper install \
avr-libc \ avr-libc \
clang \
$CROSS_AVR_GCC \ $CROSS_AVR_GCC \
$CROSS_ARM_GCC \ $CROSS_ARM_GCC \
cross-avr-binutils \ cross-avr-binutils \

@ -22,5 +22,5 @@ fi
brew tap osx-cross/avr brew tap osx-cross/avr
brew tap PX4/homebrew-px4 brew tap PX4/homebrew-px4
brew update brew update
brew install avr-gcc@8 gcc-arm-none-eabi dfu-programmer avrdude dfu-util python3 brew install avr-gcc@8 gcc-arm-none-eabi dfu-programmer avrdude clang-format dfu-util python3
brew link --force avr-gcc@8 brew link --force avr-gcc@8

@ -7,7 +7,7 @@ armtools=gcc-arm-none-eabi
installflip=false installflip=false
echo "Installing dependencies needed for the installation (quazip)" echo "Installing dependencies needed for the installation (quazip)"
pacman --needed -S base-devel mingw-w64-x86_64-toolchain msys/git msys/p7zip msys/python3 msys/unzip pacman --needed -S base-devel mingw-w64-x86_64-toolchain msys/clang msys/git msys/p7zip msys/python3 msys/unzip
source "$dir/win_shared_install.sh" source "$dir/win_shared_install.sh"

@ -9,9 +9,10 @@ echo "Using git hash ${rev}"
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
# convert to unix line-endings # fix formatting
git checkout master git checkout master
git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 dos2unix git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 dos2unix
git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | grep -e '^drivers' -e '^tmk_core' -e '^quantum' | xargs -0 clang-format
git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add
git commit -m "convert to unix line-endings [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master git commit -m "convert to unix line-endings [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master

Loading…
Cancel
Save