mirror of
https://github.com/esphome/esphome.git
synced 2024-12-30 17:57:43 +01:00
22 lines
606 B
Plaintext
22 lines
606 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
if git diff-index --quiet HEAD --; then
|
||
|
echo "No changes detected, formatting is correct!"
|
||
|
exit 0
|
||
|
else
|
||
|
echo "========================================================="
|
||
|
echo "Your formatting is not correct, ESPHome uses clang-format to format"
|
||
|
echo "all source files in a unified way. Please apply the changes listed below"
|
||
|
echo
|
||
|
echo "The following files need to be changed:"
|
||
|
git diff HEAD --name-only | sed 's/^/ /'
|
||
|
echo
|
||
|
echo
|
||
|
echo "========================================================="
|
||
|
echo
|
||
|
git diff HEAD
|
||
|
exit 1
|
||
|
fi
|