Skip to content

Commit dc90cba

Browse files
committed
chore: reduce clang ColumnLimit to 100
This for easier readability, lines are too long now.
1 parent 6dd1f15 commit dc90cba

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ AlwaysBreakAfterReturnType: None
1010
AlwaysBreakBeforeMultilineStrings: false
1111
BinPackArguments: true
1212
BinPackParameters: true
13-
ColumnLimit: 1000
13+
ColumnLimit: 100
1414
IndentPPDirectives: AfterHash
1515
MaxEmptyLinesToKeep: 1
1616
PointerAlignment: Right

src/pg_csv.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ Datum csv_agg_transfn(PG_FUNCTION_ARGS) {
5353
CsvAggState *state;
5454

5555
// first call when the accumulator is NULL
56-
// pretty standard stuff, for example see the jsonb_agg transition function https://github.com/postgres/postgres/blob/3c4e26a62c31ebe296e3aedb13ac51a7a35103bd/src/backend/utils/adt/jsonb.c#L1521
56+
// pretty standard stuff, for example see the jsonb_agg transition function
57+
// https://github.com/postgres/postgres/blob/3c4e26a62c31ebe296e3aedb13ac51a7a35103bd/src/backend/utils/adt/jsonb.c#L1521
5758
if (PG_ARGISNULL(0)) {
5859
MemoryContext aggctx, oldctx;
5960

60-
if (!AggCheckCallContext(fcinfo, &aggctx)) elog(ERROR, "csv_agg_transfn called in non‑aggregate context");
61+
if (!AggCheckCallContext(fcinfo, &aggctx))
62+
elog(ERROR, "csv_agg_transfn called in non‑aggregate context");
6163

6264
oldctx = MemoryContextSwitchTo(aggctx);
6365

@@ -77,11 +79,14 @@ Datum csv_agg_transfn(PG_FUNCTION_ARGS) {
7779

7880
char delim = PG_NARGS() >= 3 && !PG_ARGISNULL(2) ? PG_GETARG_CHAR(2) : ',';
7981

80-
if (is_reserved(delim)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("delimiter cannot be newline, carriage return or double quote")));
82+
if (is_reserved(delim))
83+
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
84+
errmsg("delimiter cannot be newline, carriage return or double quote")));
8185

8286
// build header and cache tupdesc once
8387
if (!state->header_done) {
84-
TupleDesc tdesc = lookup_rowtype_tupdesc(HeapTupleHeaderGetTypeId(next), HeapTupleHeaderGetTypMod(next));
88+
TupleDesc tdesc =
89+
lookup_rowtype_tupdesc(HeapTupleHeaderGetTypeId(next), HeapTupleHeaderGetTypMod(next));
8590

8691
// build header row
8792
for (int i = 0; i < tdesc->natts; i++) {

0 commit comments

Comments
 (0)