Skip to content

Conversation

@danolivo
Copy link
Contributor

@danolivo danolivo commented Jan 7, 2026

No description provided.

The gen-typedefs.sh script accumulated duplicates on each run because
it only appended to typedefs.list. Fixed by:
- Uncommenting curl to fetch fresh PostgreSQL typedefs (overwrites file)
- Adding sort/uniq to remove any internal duplicates
- Cleaning up typedefs.list

Sorting allow us to stabilise the content in case a struct or enum
has been displaced.
This ensures repeated script runs produce consistent, deduplicated output.
spockctrl is a standalone CLI utility that doesn't follow PostgreSQL
coding conventions. Exclude it from typedef scanning and pgindent to
avoid processing errors.
@danolivo danolivo self-assigned this Jan 7, 2026
@danolivo danolivo added the bug Something isn't working label Jan 7, 2026
@danolivo danolivo force-pushed the pgindent-fix branch 4 times, most recently from 3cf50f5 to c305334 Compare January 7, 2026 10:33
Automatically validates code formatting on PRs to main branch using
pgindent. Builds pg_bsd_indent from PostgreSQL source, runs
gen-typedefs.sh, and fails if formatting issues are detected.
Better name reflects the script's actual purpose: running pgindent on
all source files. Updated README and GitHub workflow accordingly.
@danolivo danolivo force-pushed the pgindent-fix branch 3 times, most recently from c8cd510 to b71d42d Compare January 7, 2026 10:50
The workflow now ignores typedefs.list changes.

Note: Spock is used with different PostgreSQL versions, which can cause
different pgindent results due to varying typedef lists from the buildfarm.
This is inevitable - contributors should simply run run-pgindent.sh on
their current master branch to ensure consistency.
@danolivo danolivo requested review from mason-sharp and rasifr January 7, 2026 11:15
@mason-sharp mason-sharp changed the title Fix pgindent issues and shape this feature Fix pgindent issues and run check in Github Actions workflow Jan 7, 2026
Comment on lines 39 to 41
SPOCK_RESOLVE_FIRST_UPDATE_WINS
} SpockResolveOption;
} SpockResolveOption;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like typedefs.list is missing some names and that has disturbed the indentation.

Copy link
Member

@rasifr rasifr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though it’s a standalone CLI utility, Its still part of Spock repo and I would prefer to keep processing it, so the formatting stays consistent across the codebase.

- Name anonymous enums (SpockResolveOption, GroupProgressTupDescColumns)
- Change spock_conflict_resolver from int to SpockResolveOption type
- Remove duplicate extern declarations in spock_conflict.h
- Update pgindent typedefs list with new enum types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants