File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed
Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 3030 - name : Install clang-format
3131 run : sudo apt-get install -y clang-format
3232
33- - name : Check formatting
34- run : |
35- find . -name '*.[ch]' -not -path './vendor/*' | xargs clang-format -i
36- git diff --exit-code || (echo "❌ Code formatting check failed! Run clang-format locally and commit changes." && exit 1)
33+ - name : Lint
34+ run : bin/lint
Original file line number Diff line number Diff line change @@ -48,3 +48,9 @@ test: $(test_objects) $(non_main_objects)
4848clean :
4949 rm -f $(exec ) $(test_exec ) $(lib_name ) $(ruby_extension )
5050 rm -rf src/* .o test/* .o lib/erbx/* .bundle tmp
51+
52+ format :
53+ clang-format -i $(wildcard src/* .c) $(wildcard src/** /* .c) $(wildcard src/* .h) $(wildcard src/** /* .h) $(wildcard ext/** /* .c) $(wildcard ext/** /* .h)
54+
55+ lint :
56+ clang-format --dry-run --Werror $(wildcard src/* .c) $(wildcard src/** /* .c) $(wildcard src/* .h) $(wildcard src/** /* .h) $(wildcard ext/** /* .c) $(wildcard ext/** /* .h)
Original file line number Diff line number Diff line change 22
33set -e # Exit on error
44
5- clang-format -i src/ * .c src/ ** / * .c src/ * .h src/ ** / * .h ext/ ** / * .c ext/ ** / * .h
5+ make format
66
77echo " Formatting complete!"
Original file line number Diff line number Diff line change 22
33set -e # Exit on error
44
5- clang-format --dry-run --Werror src/ * .c src/ ** / * .c src/ * .h src/ ** / * .h ext/ ** / * .c ext/ ** / * .h
5+ make lint
66
77echo " Linting complete!"
You can’t perform that action at this time.
0 commit comments