File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,27 @@ dist_check_SCRIPTS = \
147147 test/run.sh
148148endif
149149
150+ compliant :
151+ @git diff --quiet --exit-code include src; ret=$$? ; \
152+ if [ $$ ret -eq 1 ]; then \
153+ echo " Error: can only check code style when include/ and src/ are clean." ; \
154+ echo " Stash or commit your changes and try again." ; \
155+ exit $$ ret; \
156+ elif [ $$ ret -gt 1 ]; then \
157+ exit $$ ret; \
158+ fi ; \
159+ clang-format -i -style=file include/* .h src/* .c; ret=$$? ; \
160+ if [ $$ ret -ne 0 ]; then \
161+ exit $$ ret; \
162+ fi ; \
163+ git diff --quiet --exit-code include src; ret=$$? ; \
164+ if [ $$ ret -eq 1 ]; then \
165+ echo " Code style issues found. Run 'git diff' to view issues." ; \
166+ elif [ $$ ret -eq 0 ]; then \
167+ echo " No code style issues found." ; \
168+ fi ; \
169+ exit $$ ret
170+
150171release :
151172 @git rev-parse v$(PACKAGE_VERSION ) & > /dev/null; \
152173 if [ " $$ ?" -eq 0 ]; then \
You can’t perform that action at this time.
0 commit comments