Fix pgindent issues and run check in Github Actions workflow#305
Open
Fix pgindent issues and run check in Github Actions workflow#305
Conversation
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.
3cf50f5 to
c305334
Compare
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.
c8cd510 to
b71d42d
Compare
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.
rasifr
reviewed
Jan 9, 2026
Comment on lines
39
to
41
| SPOCK_RESOLVE_FIRST_UPDATE_WINS | ||
| } SpockResolveOption; | ||
| } SpockResolveOption; | ||
|
|
Member
There was a problem hiding this comment.
It looks like typedefs.list is missing some names and that has disturbed the indentation.
rasifr
reviewed
Jan 9, 2026
rasifr
reviewed
Jan 9, 2026
Member
rasifr
left a comment
There was a problem hiding this comment.
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
Contributor
|
Need rebase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.