From 8fad6be03e8eca44e5e771cfbb907d3840a8e01e Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sun, 20 Nov 2011 21:08:24 +0700 Subject: syntax-check: fix violations and implement sc_useless_braces_in_variable_derefs. Until now, libtool sources have used braced variable names seemingly at random! Almost always the braces are just noise, so remove all the unnecessary ones. * cfg.mk (sc_useless_braces_in_variable_derefs): New syntax check rule to ensure we only reintroduce braced variable dereferences if they are followed by a valid variable name character. build-aux/general.m4sh, build-aux/git-hooks/commit-msg, build-aux/ltmain.m4sh, build-aux/options-parser, configure.ac, libltdl/configure.ac, m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, tests/defs.m4sh, tests/demo-nopic.test, tests/depdemo/configure.ac, tests/flags.at, tests/link.test, tests/objectlist.test, tests/quote.test, tests/static.at: Remove spurious braces. Signed-off-by: Gary V. Vaughan --- cfg.mk | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cfg.mk') diff --git a/cfg.mk b/cfg.mk index 3c366bde..0338f6cb 100644 --- a/cfg.mk +++ b/cfg.mk @@ -190,6 +190,12 @@ define _sc_search_regexp_or_exclude fi || :; endef +exclude_file_name_regexp--sc_useless_braces_in_variable_derefs = /cvsu$$ +sc_useless_braces_in_variable_derefs: + @prohibit='\$${[0-9A-Za-z_]+}[^0-9A-Za-z_]' \ + halt='found spurious braces around variable dereference' \ + $(_sc_search_regexp) + sc_useless_quotes_in_assignment: @prohibit='^[ ]*[A-Za-z_][A-Za-z0-9_]*="[^ !#&()*;<>?@~^{|}]*"$$' \ halt='found spurious quotes around assignment value' \ -- cgit v1.2.1