From af42d8df3d19d93d84f90f46b10e94418b633ff5 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 23 Feb 2017 00:38:44 +0100 Subject: [PATCH] Add initial style check to enforce space between binary operators --- posix.mak | 3 +++ 1 file changed, 3 insertions(+) diff --git a/posix.mak b/posix.mak index 51ea4d668..7c1ac40a8 100644 --- a/posix.mak +++ b/posix.mak @@ -522,6 +522,9 @@ style: ../dscanner/dsc @echo "Enforce space between a .. b" grep -nrE '[[:alnum:]][.][.][[:alnum:]]|[[:alnum:]] [.][.][[:alnum:]]|[[:alnum:]][.][.] [[:alnum:]]' $$(find . -name '*.d' | grep -vE 'std/string.d|std/uni.d') ; test $$? -eq 1 + @echo "Enforce space between binary operators" + grep -nrE "[[:alnum:]](==|!=|<=|<<|>>|>>>|^^)[[:alnum:]]|[[:alnum:]] (==|!=|<=|<<|>>|>>>|^^)[[:alnum:]]|[[:alnum:]](==|!=|<=|<<|>>|>>>|^^) [[:alnum:]]" $$(find . -name '*.d'); test $$? -eq 1 + # at the moment libdparse has problems to parse some modules (->excludes) @echo "Running DScanner" ../dscanner/dsc --config .dscanner.ini --styleCheck $$(find etc std -type f -name '*.d' | grep -vE 'std/traits.d|std/typecons.d') -I.