build: fix syntax-check rules broken by test-added .sh/pl suffixes
[coreutils.git] / cfg.mk
blob44a43f844859cbe7dac637b52a64a62cb139f945
1 # Customize maint.mk -*- makefile -*-
2 # Copyright (C) 2003-2012 Free Software Foundation, Inc.
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Used in maint.mk's web-manual rule
18 manual_title = Core GNU utilities
20 # Use the direct link. This is guaranteed to work immediately, while
21 # it can take a while for the faster mirror links to become usable.
22 url_dir_list = http://ftp.gnu.org/gnu/$(PACKAGE)
24 # Tests not to run as part of "make distcheck".
25 local-checks-to-skip =
27 # Tools used to bootstrap this package, used for "announcement".
28 bootstrap-tools = autoconf,automake,gnulib,bison
30 # Now that we have better tests, make this the default.
31 export VERBOSE = yes
33 # Comparing tarball sizes compressed using different xz presets, we see that
34 # an -8e-compressed tarball is only 9KiB larger than the -9e-compressed one.
35 # Using -8e is preferred, since that lets the decompression process use half
36 # the memory (32MiB rather than 64MiB).
37 # $ for i in {7,8,9}{e,}; do \
38 # (n=$(xz -$i < coreutils-8.15*.tar|wc -c);echo $n $i) & done |sort -nr
39 # 5129388 7
40 # 5036524 7e
41 # 5017476 8
42 # 5010604 9
43 # 4923016 8e
44 # 4914152 9e
45 export XZ_OPT = -8e
47 old_NEWS_hash = a99128b9985b2e76bdcabf3e5d95ca1a
49 # Add an exemption for sc_makefile_at_at_check.
50 _makefile_at_at_check_exceptions = ' && !/^cu_install_program =/'
52 # Our help-version script is in a slightly different location.
53 _hv_file ?= $(srcdir)/tests/misc/help-version
55 # Ensure that the list of O_ symbols used to compute O_FULLBLOCK is complete.
56 dd = $(srcdir)/src/dd.c
57 sc_dd_O_FLAGS:
58 @rm -f $@.1 $@.2
59 @{ echo O_FULLBLOCK; echo O_NOCACHE; \
60 perl -nle '/^ +\| (O_\w*)$$/ and print $$1' $(dd); } | sort > $@.1
61 @{ echo O_NOFOLLOW; perl -nle '/{"[a-z]+",\s*(O_\w+)},/ and print $$1' \
62 $(dd); } | sort > $@.2
63 @diff -u $@.1 $@.2 || diff=1 || diff=; \
64 rm -f $@.1 $@.2; \
65 test "$$diff" \
66 && { echo '$(ME): $(dd) has inconsistent O_ flag lists'>&2; \
67 exit 1; } || :
69 # Ensure that dd's definition of LONGEST_SYMBOL stays in sync
70 # with the strings from the two affected variables.
71 dd_c = $(srcdir)/src/dd.c
72 sc_dd_max_sym_length:
73 ifneq ($(wildcard $(dd_c)),)
74 @len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
75 sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
76 |sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
77 | wc --max-line-length); \
78 max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
79 |tr -d '"' | wc --max-line-length); \
80 if test "$$len" = "$$max"; then :; else \
81 echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
82 exit 1; \
84 endif
86 # Many m4 macros names once began with 'jm_'.
87 # On 2004-04-13, they were all changed to start with gl_ instead.
88 # Make sure that none are inadvertently reintroduced.
89 sc_prohibit_jm_in_m4:
90 @grep -nE 'jm_[A-Z]' \
91 $$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \
92 { echo '$(ME): do not use jm_ in m4 macro names' \
93 1>&2; exit 1; } || :
95 # Ensure that each root-requiring test is run via the "check-root" rule.
96 sc_root_tests:
97 @if test -d tests \
98 && grep check-root tests/Makefile.am>/dev/null 2>&1; then \
99 t1=sc-root.expected; t2=sc-root.actual; \
100 grep -nl '^ *require_root_$$' \
101 $$($(VC_LIST) tests) |sed s,tests/,, |sort > $$t1; \
102 sed -n '/^root_tests =[ ]*\\$$/,/[^\]$$/p' \
103 $(srcdir)/tests/Makefile.am \
104 | sed 's/^ *//;/^root_tests =/d' \
105 | tr -s '\012\\' ' ' | fmt -1 | sort > $$t2; \
106 diff -u $$t1 $$t2 || diff=1 || diff=; \
107 rm -f $$t1 $$t2; \
108 test "$$diff" \
109 && { echo 'tests/Makefile.am: missing check-root action'>&2; \
110 exit 1; } || :; \
113 # Create a list of regular expressions matching the names
114 # of files included from system.h. Exclude a couple.
115 .re-list:
116 @sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
117 | grep -Ev 'sys/(param|file)\.h' \
118 | sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
119 > $@-t
120 @mv $@-t $@
122 define gl_trap_
123 Exit () { set +e; (exit $$1); exit $$1; }; \
124 for sig in 1 2 3 13 15; do \
125 eval "trap 'Exit $$(expr $$sig + 128)' $$sig"; \
126 done
127 endef
129 # Files in src/ should not include directly any of
130 # the headers already included via system.h.
131 sc_system_h_headers: .re-list
132 @if test -f $(srcdir)/src/system.h; then \
133 trap 'rc=$$?; rm -f .re-list; exit $$rc' 0; \
134 $(gl_trap_); \
135 grep -nE -f .re-list \
136 $$($(VC_LIST_EXCEPT) | grep '^\($(srcdir)/\)\?src/') \
137 && { echo '$(ME): the above are already included via system.h'\
138 1>&2; exit 1; } || :; \
141 sc_sun_os_names:
142 @grep -nEi \
143 'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
144 $$($(VC_LIST_EXCEPT)) && \
145 { echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
146 exit 1; } || :
148 ALL_RECURSIVE_TARGETS += sc_check-AUTHORS
149 sc_check-AUTHORS:
150 @$(MAKE) -s -C src _sc_check-AUTHORS
152 # Look for lines longer than 80 characters, except omit:
153 # - program-generated long lines in diff headers,
154 # - tests involving long checksum lines, and
155 # - the 'pr' test cases.
156 LINE_LEN_MAX = 80
157 FILTER_LONG_LINES = \
158 /^[^:]*\.diff:[^:]*:@@ / d; \
159 \|^[^:]*tests/misc/sha[0-9]*sum.*\.pl[-:]| d; \
160 \|^[^:]*tests/pr/|{ \|^[^:]*tests/pr/pr-tests:| !d; };
161 sc_long_lines:
162 @files=$$($(VC_LIST_EXCEPT)) \
163 halt='line(s) with more than $(LINE_LEN_MAX) characters; reindent'; \
164 for file in $$files; do \
165 expand $$file | grep -nE '^.{$(LINE_LEN_MAX)}.' | \
166 sed -e "s|^|$$file:|" -e '$(FILTER_LONG_LINES)'; \
167 done | grep . && { msg="$$halt" $(_sc_say_and_exit) } || :
169 # Option descriptions should not start with a capital letter.
170 # One could grep source directly as follows:
171 # grep -E " {2,6}-.*[^.] [A-Z][a-z]" $$($(VC_LIST_EXCEPT) | grep '\.c$$')
172 # but that would miss descriptions not on the same line as the -option.
173 ALL_RECURSIVE_TARGETS += sc_option_desc_uppercase
174 .PHONY: sc_option_desc_uppercase
175 sc_option_desc_uppercase:
176 @grep '^\\fB\\-' -A1 *.1 | LC_ALL=C grep '\.1.[A-Z][a-z]' && \
177 { echo 1>&2 '$@: found initial capitals in --help'; \
178 exit 1; } || :;
179 sc_option_desc_uppercase: $(dist_man1_MANS) \
180 $(patsubst %,man/%.1,$(NO_INSTALL_PROGS_DEFAULT)) \
181 all_programs
183 # Ensure all man/*.[1x] files are present.
184 ALL_RECURSIVE_TARGETS += sc_man_file_correlation
185 .PHONY: sc_man_file_correlation
186 sc_man_file_correlation: check-x-vs-1 check-programs-vs-x
188 # Ensure that for each .x file in the 'man/' subdirectory, there is a
189 # corresponding .1 file in the definition of $(dist_man1_MANS).
190 # But since that expansion usually lacks programs like arch and hostname,
191 # add them here manually.
192 .PHONY: check-x-vs-1
193 check-x-vs-1:
194 @PATH=./src$(PATH_SEPARATOR)$$PATH; export PATH; \
195 t=$@-t; \
196 (cd $(srcdir)/man && ls -1 *.x) \
197 | sed 's/\.x$$//' | $(ASSORT) > $$t; \
198 (echo $(patsubst man/%,%,$(dist_man1_MANS)) \
199 $(NO_INSTALL_PROGS_DEFAULT) \
200 | tr -s ' ' '\n' | sed 's/\.1$$//') \
201 | $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; }; \
202 rm $$t
204 all_programs = \
205 (cd ./src && MAKEFLAGS= $(MAKE) -s all_programs.list) \
206 | grep -v '\['
208 # Ensure that for each .x file in the 'man/' subdirectory, there is a
209 # corresponding coreutils program.
210 .PHONY: check-programs-vs-x
211 check-programs-vs-x: all_programs
212 @status=0; \
213 for p in dummy `$(all_programs)`; do \
214 test $$p = dummy && continue; \
215 test $$p = ginstall && p=install || : ; \
216 test -f $(srcdir)/man/$$p.x \
217 || { echo missing $$p.x 1>&2; status=1; }; \
218 done; \
219 exit $$status
221 # Ensure that the end of each release's section is marked by two empty lines.
222 sc_NEWS_two_empty_lines:
223 @sed -n 4,/Noteworthy/p $(srcdir)/NEWS \
224 | perl -n0e '/(^|\n)\n\n\* Noteworthy/ or exit 1' \
225 || { echo '$(ME): use two empty lines to separate NEWS sections' \
226 1>&2; exit 1; } || :
228 # Perl-based tests used to exec perl from a #!/bin/sh script.
229 # Now they all start with #!/usr/bin/perl and the portability
230 # infrastructure is in tests/Makefile.am. Make sure no old-style
231 # script sneaks back in.
232 sc_no_exec_perl_coreutils:
233 @if test -f $(srcdir)/tests/Coreutils.pm; then \
234 grep '^exec *\$$PERL.*MCoreutils' $$($(VC_LIST) tests) && \
235 { echo 1>&2 '$(ME): found anachronistic Perl-based tests'; \
236 exit 1; } || :; \
239 # With split lines, don't leave an operator at end of line.
240 # Instead, put it on the following line, where it is more apparent.
241 # Don't bother checking for "*" at end of line, since it provokes
242 # far too many false positives, matching constructs like "TYPE *".
243 # Similarly, omit "=" (initializers).
244 binop_re_ ?= [-/+^!<>]|[-/+*^!<>=]=|&&?|\|\|?|<<=?|>>=?
245 sc_prohibit_operator_at_end_of_line:
246 @prohibit='. ($(binop_re_))$$' \
247 in_vc_files='\.[chly]$$' \
248 halt='found operator at end of line' \
249 $(_sc_search_regexp)
251 # Don't use "readlink" or "readlinkat" directly
252 sc_prohibit_readlink:
253 @prohibit='\<readlink(at)? \(' \
254 halt='do not use readlink(at); use via xreadlink or areadlink*' \
255 $(_sc_search_regexp)
257 # Don't use address of "stat" or "lstat" functions
258 sc_prohibit_stat_macro_address:
259 @prohibit='\<l?stat '':|&l?stat\>' \
260 halt='stat() and lstat() may be function-like macros' \
261 $(_sc_search_regexp)
263 # Ensure that date's --help output stays in sync with the info
264 # documentation for GNU strftime. The only exception is %N,
265 # which date accepts but GNU strftime does not.
266 extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
267 sc_strftime_check:
268 @if test -f $(srcdir)/src/date.c; then \
269 grep '^ %. ' $(srcdir)/src/date.c | sort \
270 | $(extract_char) > $@-src; \
271 { echo N; \
272 info libc date calendar format 2>/dev/null|grep '^ `%.'\'\
273 | $(extract_char); } | sort > $@-info; \
274 if test $$(stat --format %s $@-info) != 2; then \
275 diff -u $@-src $@-info || exit 1; \
276 else \
277 echo '$(ME): skipping $@: libc info not installed' 1>&2; \
278 fi; \
279 rm -f $@-src $@-info; \
282 # Indent only with spaces.
283 sc_prohibit_tab_based_indentation:
284 @prohibit='^ * ' \
285 halt='TAB in indentation; use only spaces' \
286 $(_sc_search_regexp)
288 # The SEE ALSO section of a man page should not be terminated with
289 # a period. Check the first line after each "SEE ALSO" line in man/*.x:
290 sc_prohibit_man_see_also_period:
291 @grep -nB1 '\.$$' $$($(VC_LIST_EXCEPT) | grep 'man/.*\.x$$') \
292 | grep -A1 -e '-\[SEE ALSO\]' | grep '\.$$' && \
293 { echo '$(ME): do not end "SEE ALSO" section with a period' \
294 1>&2; exit 1; } || :
296 # Don't use "indent-tabs-mode: nil" anymore. No longer needed.
297 sc_prohibit_emacs__indent_tabs_mode__setting:
298 @prohibit='^( *[*#] *)?indent-tabs-mode:' \
299 halt='use of emacs indent-tabs-mode: setting' \
300 $(_sc_search_regexp)
302 # Ensure that tests don't include a redundant fail=0.
303 sc_prohibit_fail_0:
304 @prohibit='\<fail=0\>' \
305 halt='fail=0 initialization' \
306 $(_sc_search_regexp)
308 # The mode part of a setfacl -m option argument must be three bytes long.
309 # I.e., an argument of user:bin:rw or user:bin:r will make Solaris 10's
310 # setfacl reject it with: "Unrecognized character found in mode field".
311 # Use hyphens to give it a length of 3: "...:rw-" or "...:r--".
312 sc_prohibit_short_facl_mode_spec:
313 @prohibit='\<setfacl .*-m.*:.*:[rwx-]{1,2} ' \
314 halt='setfacl mode string length < 3; extend with hyphen(s)' \
315 $(_sc_search_regexp)
317 # Ensure that "stdio--.h" is used where appropriate.
318 sc_require_stdio_safer:
319 @if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then \
320 files=$$(grep -l '\bfreopen \?(' $$($(VC_LIST_EXCEPT) \
321 | grep '\.[ch]$$')); \
322 test -n "$$files" && grep -LE 'include "stdio--.h"' $$files \
323 | grep . && \
324 { echo '$(ME): the above files should use "stdio--.h"' \
325 1>&2; exit 1; } || :; \
326 else :; \
329 sc_prohibit_perl_hash_quotes:
330 @prohibit="\{'[A-Z_]+' *[=}]" \
331 halt="in Perl code, write \$$hash{KEY}, not \$$hash{'K''EY'}" \
332 $(_sc_search_regexp)
334 # Prefer xnanosleep over other less-precise sleep methods
335 sc_prohibit_sleep:
336 @prohibit='\<(nano|u)?sleep \(' \
337 halt='prefer xnanosleep over other sleep interfaces' \
338 $(_sc_search_regexp)
340 # Use print_ver_ (from init.cfg), not open-coded $VERBOSE check.
341 sc_prohibit_verbose_version:
342 @prohibit='test "\$$VERBOSE" = yes && .* --version' \
343 halt='use the print_ver_ function instead...' \
344 $(_sc_search_regexp)
346 # Use framework_failure_, not the old name without the trailing underscore.
347 sc_prohibit_framework_failure:
348 @prohibit='\<framework_''failure\>' \
349 halt='use framework_failure_ instead' \
350 $(_sc_search_regexp)
352 # Prohibit the use of `...` in tests/. Use $(...) instead.
353 sc_prohibit_test_backticks:
354 @prohibit='`' in_vc_files='^tests/' \
355 halt='use $$(...), not `...` in tests/' \
356 $(_sc_search_regexp)
358 # Programs like sort, ls, expr use PROG_FAILURE in place of EXIT_FAILURE.
359 # Others, use the EXIT_CANCELED, EXIT_ENOENT, etc. macros defined in system.h.
360 # In those programs, ensure that EXIT_FAILURE is not used by mistake.
361 sc_some_programs_must_avoid_exit_failure:
362 @grep -nw EXIT_FAILURE \
363 $$(git grep -El '[^T]_FAILURE|EXIT_CANCELED' src) \
364 | grep -vE '= EXIT_FAILURE|exit \(.* \?' | grep . \
365 && { echo '$(ME): do not use EXIT_FAILURE in the above' \
366 1>&2; exit 1; } || :
368 # Ensure that tests call the print_ver_ function for programs which are
369 # actually used in that test.
370 sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
371 @git grep -w print_ver_ tests \
372 | sed 's#:print_ver_##' \
373 | { fail=0; \
374 while read file name; do \
375 for i in $$name; do \
376 case "$$i" in install) i=ginstall;; esac; \
377 grep -w "$$i" $$file|grep -vw print_ver_|grep -q . \
378 || { fail=1; \
379 echo "*** Test: $$file, offending: $$i." 1>&2; };\
380 done; \
381 done; \
382 test $$fail = 0 || exit 1; \
383 } || { echo "$(ME): the above test(s) call print_ver_ for" \
384 "program(s) they don't use" 1>&2; exit 1; }
386 # Exempt the contents of any usage function from the following.
387 _continued_string_col_1 = \
388 s/^usage .*?\n}//ms;/\\\n\w/ and print ("$$ARGV\n"),$$e=1;END{$$e||=0;exit $$e}
389 # Ding any source file that has a continued string with an alphabetic in the
390 # first column of the following line. We prohibit them because they usually
391 # trigger false positives in tools that try to map an arbitrary line number
392 # to the enclosing function name. Of course, very many strings do precisely
393 # this, *when they are part of the usage function*. That is why we exempt
394 # the contents of any function named "usage".
395 sc_prohibit_continued_string_alpha_in_column_1:
396 @perl -0777 -ne '$(_continued_string_col_1)' \
397 $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$') \
398 || { echo '$(ME): continued string with word in first column' \
399 1>&2; exit 1; } || :
400 # Use this to list offending lines:
401 # git ls-files |grep '\.[ch]$' | xargs \
402 # perl -n -0777 -e 's/^usage.*?\n}//ms;/\\\n\w/ and print "$ARGV\n"' \
403 # | xargs grep -A1 '\\$'|grep '\.[ch][:-][_a-zA-Z]'
406 ###########################################################
407 _p0 = \([^"'/]\|"\([^\"]\|[\].\)*"\|'\([^\']\|[\].\)*'
408 _pre = $(_p0)\|[/][^"'/*]\|[/]"\([^\"]\|[\].\)*"\|[/]'\([^\']\|[\].\)*'\)*
409 _pre_anchored = ^\($(_pre)\)
410 _comment_and_close = [^*]\|[*][^/*]\)*[*][*]*/
411 # help font-lock mode: '
413 # A sed expression that removes ANSI C and ISO C99 comments.
414 # Derived from the one in GNU gettext's 'moopp' preprocessor.
415 _sed_remove_comments = \
416 /[/][/*]/{ \
417 ta; \
418 :a; \
419 s,$(_pre_anchored)//.*,\1,; \
420 te; \
421 s,$(_pre_anchored)/[*]\($(_comment_and_close),\1 ,; \
422 ta; \
423 /^$(_pre)[/][*]/{ \
424 s,$(_pre_anchored)/[*].*,\1 ,; \
425 tu; \
426 :u; \
427 n; \
428 s,^\($(_comment_and_close),,; \
429 tv; \
430 s,^.*$$,,; \
431 bu; \
432 :v; \
433 }; \
434 :e; \
436 # Quote all single quotes.
437 _sed_rm_comments_q = $(subst ','\'',$(_sed_remove_comments))
438 # help font-lock mode: '
440 _space_before_paren_exempt =? \\n\\$$
441 _space_before_paren_exempt = \
442 (^ *\#|\\n\\$$|%s\(to %s|(date|group|character)\(s\))
443 # Ensure that there is a space before each open parenthesis in C code.
444 sc_space_before_open_paren:
445 @if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then \
446 fail=0; \
447 for c in $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$'); do \
448 sed '$(_sed_rm_comments_q)' $$c 2>/dev/null \
449 | grep -i '[[:alnum:]](' \
450 | grep -vE '$(_space_before_paren_exempt)' \
451 | grep . && { fail=1; echo "*** $$c"; }; \
452 done; \
453 test $$fail = 1 && \
454 { echo '$(ME): the above files lack a space-before-open-paren' \
455 1>&2; exit 1; } || :; \
456 else :; \
459 # Similar to the gnulib maint.mk rule for sc_prohibit_strcmp
460 # Use STREQ_LEN or STRPREFIX rather than comparing strncmp == 0, or != 0.
461 sc_prohibit_strncmp:
462 @grep -nE '! *str''ncmp *\(|\<str''ncmp *\(.+\) *[!=]=' \
463 $$($(VC_LIST_EXCEPT)) \
464 | grep -vE ':# *define STR(N?EQ_LEN|PREFIX)\(' && \
465 { echo '$(ME): use STREQ_LEN or STRPREFIX instead of str''ncmp' \
466 1>&2; exit 1; } || :
468 # Enforce recommended preprocessor indentation style.
469 sc_preprocessor_indentation:
470 @if cppi --version >/dev/null 2>&1; then \
471 $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
472 || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
473 exit 1; }; \
474 else \
475 echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
478 # THANKS.in is a list of name/email pairs for people who are mentioned in
479 # commit logs (and generated ChangeLog), but who are not also listed as an
480 # author of a commit. Name/email pairs of commit authors are automatically
481 # extracted from the repository. As a very minor factorization, when
482 # someone who was initially listed only in THANKS.in later authors a commit,
483 # this rule detects that their pair may now be removed from THANKS.in.
484 sc_THANKS_in_duplicates:
485 @{ git log --pretty=format:%aN | sort -u; \
486 cut -b-36 THANKS.in | sed '/^$$/d;s/ *$$//'; } \
487 | sort | uniq -d | grep . \
488 && { echo '$(ME): remove the above names from THANKS.in' \
489 1>&2; exit 1; } || :
491 # Override the default Cc: used in generating an announcement.
492 announcement_Cc_ = $(translation_project_), \
493 coreutils@gnu.org, coreutils-announce@gnu.org
495 -include $(srcdir)/dist-check.mk
497 update-copyright-env = \
498 UPDATE_COPYRIGHT_FORCE=1 \
499 UPDATE_COPYRIGHT_USE_INTERVALS=2 \
500 UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
502 # List syntax-check exemptions.
503 exclude_file_name_regexp--sc_space_tab = \
504 ^(tests/pr/|tests/misc/nl\.sh$$|gl/.*\.diff$$)
505 exclude_file_name_regexp--sc_bindtextdomain = ^(gl/.*|lib/euidaccess-stat)\.c$$
506 exclude_file_name_regexp--sc_unmarked_diagnostics = ^build-aux/cvsu$$
507 exclude_file_name_regexp--sc_error_message_uppercase = ^build-aux/cvsu$$
508 exclude_file_name_regexp--sc_trailing_blank = ^tests/pr/
509 exclude_file_name_regexp--sc_system_h_headers = \
510 ^src/((system|copy)\.h|libstdbuf\.c)$$
512 _src = (false|lbracket|ls-(dir|ls|vdir)|tac-pipe|uname-(arch|uname))
513 exclude_file_name_regexp--sc_require_config_h_first = \
514 (^lib/buffer-lcm\.c|src/$(_src)\.c)$$
515 exclude_file_name_regexp--sc_require_config_h = \
516 $(exclude_file_name_regexp--sc_require_config_h_first)
518 exclude_file_name_regexp--sc_po_check = ^gl/
519 exclude_file_name_regexp--sc_prohibit_always-defined_macros = \
520 ^src/(seq|remove)\.c$$
521 exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/pr/
522 exclude_file_name_regexp--sc_program_name = ^(gl/.*|lib/euidaccess-stat)\.c$$
523 exclude_file_name_regexp--sc_file_system = \
524 NEWS|^(tests/init\.cfg|src/df\.c|tests/df/df-P\.sh)$$
525 exclude_file_name_regexp--sc_prohibit_always_true_header_tests = \
526 ^m4/stat-prog\.m4$$
527 exclude_file_name_regexp--sc_prohibit_fail_0 = \
528 (^.*/git-hooks/commit-msg|^tests/init\.sh|Makefile\.am|\.mk|.*\.texi)$$
529 exclude_file_name_regexp--sc_prohibit_atoi_atof = ^lib/euidaccess-stat\.c$$
531 tbi_1 = ^tests/pr/|(^gl/lib/reg.*\.c\.diff|Makefile(\.am)?|\.mk|^man/help2man)$$
532 tbi_2 = ^scripts/git-hooks/(pre-commit|pre-applypatch|applypatch-msg)$$
533 exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
534 $(tbi_1)|$(tbi_2)
536 exclude_file_name_regexp--sc_preprocessor_indentation = \
537 ^(gl/lib/rand-isaac\.[ch]|gl/tests/test-rand-isaac\.c)$$
538 exclude_file_name_regexp--sc_prohibit_stat_st_blocks = \
539 ^(src/system\.h|tests/du/2g\.sh)$$
541 exclude_file_name_regexp--sc_prohibit_continued_string_alpha_in_column_1 = \
542 ^src/(system\.h|od\.c|printf\.c)$$
544 exclude_file_name_regexp--sc_prohibit_test_backticks = \
545 ^tests/(init\.sh|Makefile\.am|misc/stdbuf\.sh)$$
547 # Exempt test.c, since it's nominally shared, and relatively static.
548 exclude_file_name_regexp--sc_prohibit_operator_at_end_of_line = \
549 ^src/(ptx|test|head)\.c$$