Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1249371

Browse files
committed
Improve exclude pattern file processing in pgindent
This makes two small changes that will improve pgindent's usefulness ina git hook. First, it looks for the exclude file relative to the currentdirectory. And second, it applies the filters to filenames given on thecommand line as well as those found in a directory sweep.It might prove necessary to make further efforts to find the excludefile, and even to allow multiple exclude files, but for now this shouldbe enough for most purposes.Reviewed by Jelte Fennema
1 parentf1358ca commit1249371

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/tools/pgindent/pgindent

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ $code_base ||= '.' unless @ARGV;
6363
$excludes ||="$code_base/src/tools/pgindent/exclude_file_patterns"
6464
if$code_base &&-f"$code_base/src/tools/pgindent/exclude_file_patterns";
6565

66+
# also look under the current directory for the exclude patterns file
67+
$excludes ||="src/tools/pgindent/exclude_file_patterns"
68+
if-f"src/tools/pgindent/exclude_file_patterns";
69+
6670
# The typedef list that's mechanically extracted by the buildfarm may omit
6771
# some names we want to treat like typedefs, e.g. "bool" (which is a macro
6872
# according to <stdbool.h>), and may include some names we don't want
@@ -421,15 +425,16 @@ File::Find::find(
421425
},
422426
$code_base)if$code_base;
423427

424-
process_exclude();
425-
426428
$filtered_typedefs_fh = load_typedefs();
427429

428430
check_indent();
429431

430432
# any non-option arguments are files to be processed
431433
push(@files,@ARGV);
432434

435+
# the exclude list applies to command line arguments as well as found files
436+
process_exclude();
437+
433438
foreachmy$source_filename (@files)
434439
{
435440
# ignore anything that's not a .c or .h file

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp