From e2e2d414058263e9c85d43fc6943619774379218 Mon Sep 17 00:00:00 2001 From: Jake Mercer Date: Sun, 20 Oct 2019 00:58:21 +0100 Subject: [PATCH] MAKEFILE - FORMAT - Trailing Whitespace `make format` now additionally removes trailing whitespace. Also now ignores .bit files. Signed-off-by: Jake Mercer --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d8f35aab..cdc174ed 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ test-cpp: # Auto formatting of code. # ------------------------ -FORMAT_EXCLUDE = $(foreach x,$(ALL_EXCLUDE),-and -not -path './$(x)/*') +FORMAT_EXCLUDE = $(foreach x,$(ALL_EXCLUDE),-and -not -path './$(x)/*') -and -not -name *.bit CLANG_FORMAT ?= clang-format-5.0 format-cpp: @@ -76,10 +76,13 @@ TCL_FORMAT ?= utils//tcl-reformat.sh format-tcl: find . -name \*.tcl $(FORMAT_EXCLUDE) -print0 | xargs -0 -P $$(nproc) -n 1 $(TCL_FORMAT) -format: format-cpp format-docs format-py format-tcl +format-trailing-ws: + find . -type f $(FORMAT_EXCLUDE) | xargs sed -i 's@\s\+$$@@g' + +format: format-cpp format-docs format-py format-tcl format-trailing-ws @true -.PHONY: format format-cpp format-py format-tcl +.PHONY: format format-cpp format-py format-tcl format-trailing-ws # Targets related to Project X-Ray databases # ------------------------