Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce clang-format #6293

Merged
merged 2 commits into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions util/linux_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if grep ID /etc/os-release | grep -qE "fedora"; then
avr-gcc \
avr-libc \
binutils-avr32-linux-gnu \
clang \
dfu-util \
dfu-programmer \
diffutils \
Expand All @@ -42,6 +43,7 @@ elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
avr-libc \
binutils-arm-none-eabi \
binutils-avr \
clang-format \
dfu-programmer \
dfu-util \
diffutils \
Expand All @@ -66,6 +68,7 @@ elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
avr-libc \
avr-gcc \
base-devel \
clang \
dfu-util \
diffutils \
gcc \
Expand Down Expand Up @@ -94,6 +97,7 @@ elif grep ID /etc/os-release | grep -q gentoo; then
dev-embedded/avrdude \
dev-lang/python:3.5 \
net-misc/wget \
sys-devel/clang \
sys-devel/gcc \
sys-devel/crossdev
sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
Expand All @@ -110,6 +114,7 @@ elif grep ID /etc/os-release | grep -q sabayon; then
dev-embedded/avrdude \
dev-lang/python \
net-misc/wget \
sys-devel/clang \
sys-devel/gcc \
sys-devel/crossdev
sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
Expand All @@ -124,6 +129,7 @@ elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
fi
sudo zypper install \
avr-libc \
clang \
$CROSS_AVR_GCC \
$CROSS_ARM_GCC \
cross-avr-binutils \
Expand Down
2 changes: 1 addition & 1 deletion util/macos_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ fi
brew tap osx-cross/avr
brew tap PX4/homebrew-px4
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
2 changes: 1 addition & 1 deletion util/msys2_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ armtools=gcc-arm-none-eabi
installflip=false

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"

Expand Down
3 changes: 2 additions & 1 deletion util/travis_compiled_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ echo "Using git hash ${rev}"

if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then

# convert to unix line-endings
# fix formatting
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} | grep -e '^drivers' -e '^quantum' -e '^tests' -e '^tmk_core' | xargs -0 clang-format
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be mistaken about when this will run, but near as I can tell this will only run clang-format on files that are modified, but not on new files that are added to the relevant directories, which would require --diff-filter=AM (added and modified).

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 [email protected]:qmk/qmk_firmware.git master

Expand Down