+2011-03-16 Jim Meyering <meyering@redhat.com>
+
+ maint.mk: allow fine-grained syntax-check exclusion via Make variables
+ Before, you would have had to create one .x-sc_ file per rule in order
+ to exempt offending files. Now, you may instead use a Make variable --
+ usually defined in cfg.mk -- whose name identifies the affected rule.
+ * top/maint.mk (_sc_excl): Define.
+ (VC_LIST_EXCEPT): Use it to exclude names on a per-rule basis.
+ (_sc_search_regexp): When not using VC_LIST_EXCEPT, exclude here, too.
+
2011-03-13 Bruno Haible <bruno@clisp.org>
ignore-value tests: Avoid warnings.
# In order to be able to consistently filter "."-relative names,
# (i.e., with no $(srcdir) prefix), this definition is careful to
# remove any $(srcdir) prefix, and to restore what it removes.
+_sc_excl = \
+ $(if $(exclude_file_name_regexp--$@),$(exclude_file_name_regexp--$@),^$$)
VC_LIST_EXCEPT = \
$(VC_LIST) | sed 's|^$(_dot_escaped_srcdir)/||' \
| if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
- | grep -Ev -e '$(VC_LIST_ALWAYS_EXCLUDE_REGEX)' \
+ | grep -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
$(_prepend_srcdir_prefix)
ifeq ($(origin prev_version_file), undefined)
# halt
#
# Message to display before to halting execution.
+#
+# Finally, you may exempt files based on an ERE matching file names.
+# For example, to exempt from the sc_space_tab check all files with the
+# .diff suffix, set this Make variable:
+#
+# exclude_file_name_regexp--sc_space_tab = \.diff$
+#
+# Note that while this functionality is mostly inherited via VC_LIST_EXCEPT,
+# when filtering by name via in_files, we explicitly filter out matching
+# names here as well.
# By default, _sc_search_regexp does not ignore case.
export ignore_case =
\
: Filter by file name; \
if test -n "$$in_files"; then \
- files=$$(find $(srcdir) | grep -E "$$in_files"); \
+ files=$$(find $(srcdir) | grep -E "$$in_files" \
+ | grep -Ev '$(exclude_file_name_regexp--$@)'); \
else \
files=$$($(VC_LIST_EXCEPT)); \
if test -n "$$in_vc_files"; then \