Skip to content

Commit

Permalink
Makefile: Add build-time check for files with initial tabs.
Browse files Browse the repository at this point in the history
This should make it harder to reintroduce inappropriate indentation.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Justin Pettit <[email protected]>
  • Loading branch information
blp committed Jun 11, 2018
1 parent 5a0e4ae commit 7717d23
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,21 @@ check-echo-n:
fi
.PHONY: check-echo-n

ALL_LOCAL += check-tabs
check-tabs:
@cd $(srcdir); \
if test -e .git && (git --version) >/dev/null 2>&1 && \
grep -ln "^ " \
`git ls-files \
| grep -v -f build-aux/initial-tab-whitelist` /dev/null \
| $(EGREP) -v ':[ ]*/?\*'; \
then \
echo "See above for files that use tabs for indentation."; \
echo "Please use spaces instead."; \
exit 1; \
fi
.PHONY: check-tabs

ALL_LOCAL += thread-safety-check
thread-safety-check:
@cd $(srcdir); \
Expand Down
1 change: 1 addition & 0 deletions build-aux/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ EXTRA_DIST += \
build-aux/dist-docs \
build-aux/dpdkstrip.py \
build-aux/generate-dhparams-c \
build-aux/initial-tab-whitelist \
build-aux/sodepends.py \
build-aux/soexpand.py \
build-aux/text2c \
Expand Down
16 changes: 16 additions & 0 deletions build-aux/initial-tab-whitelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
\.am$
\.m4$
\.mk$
\.png$
\.sln$
^datapath/
^include/linux/
^include/windows/
^lib/sflow
^lib/getopt_long\.c$
^lib/strsep\.c$
^third-party/
^windows/
^xenserver/
^debian/rules.modules$
^debian/rules$

0 comments on commit 7717d23

Please sign in to comment.