Skip to content

Commit 36e4d4a

Browse files
author
Commitfest Bot
committed
[CF 6148] v2 - CI: Add task that runs pgindent
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/6148 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CAGECzQQJgGqwkgHWdH8TxVKg4Gdb-PjK_F0+PpzjB4JUL_87yA@mail.gmail.com Author(s): Jelte Fennema-Nio
2 parents 87a350e + 43032c4 commit 36e4d4a

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

.cirrus.star

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def compute_environment_vars():
9696

9797
operating_systems = [
9898
'compilerwarnings',
99+
'formattingcheck',
99100
'freebsd',
100101
'linux',
101102
'macos',

.cirrus.tasks.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,3 +1021,40 @@ task:
10211021
10221022
always:
10231023
upload_caches: ccache
1024+
1025+
1026+
# Check that code follows formatting standards
1027+
task:
1028+
name: FormattingCheck
1029+
1030+
env:
1031+
CPUS: 2
1032+
IMAGE_FAMILY: pg-ci-bookworm
1033+
1034+
<<: *linux_task_template
1035+
1036+
depends_on: SanityCheck
1037+
only_if: $CI_FORMATTINGCHECK_ENABLED
1038+
allow_failures: true
1039+
1040+
create_user_script: |
1041+
useradd -m postgres
1042+
chown -R postgres:postgres .
1043+
1044+
# Configure and build pg_bsd_indent
1045+
configure_script: |
1046+
su postgres <<-EOF
1047+
meson setup --auto-features=disabled build
1048+
EOF
1049+
1050+
build_pg_bsd_indent_script: |
1051+
su postgres <<-EOF
1052+
ninja -C build src/tools/pg_bsd_indent/pg_bsd_indent
1053+
EOF
1054+
1055+
# Check C code formatting with pgindent
1056+
check_pgindent_script: |
1057+
su postgres <<-EOF
1058+
export PATH="$(pwd)/build/src/tools/pg_bsd_indent:\$PATH"
1059+
src/tools/pgindent/pgindent --check --diff src contrib
1060+
EOF

src/backend/tcop/postgres.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5218,8 +5218,8 @@ enable_statement_timeout(void)
52185218
if (StatementTimeout > 0
52195219
&& (StatementTimeout < TransactionTimeout || TransactionTimeout == 0))
52205220
{
5221-
if (!get_timeout_active(STATEMENT_TIMEOUT))
5222-
enable_timeout_after(STATEMENT_TIMEOUT, StatementTimeout);
5221+
if (!get_timeout_active(STATEMENT_TIMEOUT))
5222+
enable_timeout_after(STATEMENT_TIMEOUT, StatementTimeout);
52235223
}
52245224
else
52255225
{

0 commit comments

Comments
 (0)