Skip to content

Commit 9da000e

Browse files
committed
[#26651] YSQL: Exclude elog.c from bad_variable_declaration_spacing
Summary: elog.c contains postgres owned code that violates bad_variable_declaration_spacing. Instruct linter to ignore this rule for file elog.c. Jira: DB-16028 Test Plan: Jenkins: compile only Reviewers: jason Reviewed By: jason Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D42978
1 parent cc07f3e commit 9da000e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/lint/postgres.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,9 @@ grep -nE '^\w+(\s+\w+)+\(' "$1" \
400400
# alignment. '(' is needed for cases such as
401401
#
402402
# void\t\t(*startup_fn) (Node *clause, PredIterInfo info);
403-
grep -nE '^\s+\w+(\s\s+|'$'\t'')[_[:alpha:]*(]' "$1" \
404-
| perl -ne 'print unless /^\d+:\s+'\
403+
if ! [[ "$1" == src/postgres/src/backend/utils/error/elog.c ]]; then
404+
grep -nE '^\s+\w+(\s\s+|'$'\t'')[_[:alpha:]*(]' "$1" \
405+
| perl -ne 'print unless /^\d+:\s+'\
405406
'(\w{1}(\t\t| {7})'\
406407
'|\w{2}(\t\t| {6})'\
407408
'|\w{3}(\t\t| {5})'\
@@ -418,8 +419,9 @@ grep -nE '^\s+\w+(\s\s+|'$'\t'')[_[:alpha:]*(]' "$1" \
418419
'|\w{2}(\t| {2})'\
419420
'|\w{3}\t))'\
420421
'[\w(]/' \
421-
| sed 's/^/error:bad_variable_declaration_spacing:'\
422+
| sed 's/^/error:bad_variable_declaration_spacing:'\
422423
'Variable declarations should align variable names to the 12 column mark:/'
424+
fi
423425

424426
# Braces
425427
grep -nE '(\)|else)\s+{$' "$1" \

0 commit comments

Comments
 (0)