1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-18 12:24:04 +03:00
esp8266/tests/restyle.sh
Max Prokhorov be3035c853
CI - clang-format-18 (#9225)
* Fix shell variable comparison without $CI present

+ '[' = true ']'
./tests/restyle.sh: line 16: [: =: unary operator expected

vs.

+ '[' '' = true ']'

* Update to clang-format-18

new opt to skip overly eager macro formatting
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#skipmacrodefinitionbody

minor changes between 15 and 18 for ide examples

reference arduino-ide format is still stuck with 15, though
https://github.com/arduino/clang-static-binaries/releases

* Pin clang-format in CI recipe not the script itself

* style
2025-01-24 09:40:22 +03:00

21 lines
571 B
Bash
Executable File

#!/bin/sh
# requires python3, git, and runnable clang-format (specified below)
set -e -x
root=$(git rev-parse --show-toplevel)
test -d ${root}/cores/esp8266
test -d ${root}/libraries
# allow `env CLANG_FORMAT=clang-format-N`, or some other version
CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
cd $root
python $root/tests/restyle.py format --clang-format=$CLANG_FORMAT preset --include core --include arduino
if [ "$CI" = "true" ] ; then
python $root/tests/restyle.py assert --with-summary --with-errors
else
python $root/tests/restyle.py assert --with-diff
fi