Skip to content

Fix trigger return type casing. - #422

Open
CRISvsGAME wants to merge 1 commit into
darold:masterfrom
CRISvsGAME:fix-trigger-return-type-case
Open

CRISvsGAME wants to merge 1 commit into
darold:masterfrom
CRISvsGAME:fix-trigger-return-type-case

Conversation

@CRISvsGAME

Copy link
Copy Markdown

Fix formatting of TRIGGER when used as a function return type.

By default, pgFormatter uppercases SQL keywords and lowercases data types. However, RETURNS TRIGGER was formatted using keyword case even though trigger is a PostgreSQL pseudo-type.

The fix recognizes TRIGGER as a type in the RETURNS context and applies the configured type case without affecting keyword formatting elsewhere, such as CREATE TRIGGER.

Regression coverage includes:

  • Default lowercase type formatting for RETURNS trigger
  • Preserving mixed-case tRiGgEr with --type-case 0
  • Preserving keyword formatting for CREATE TRIGGER
  • Updated existing regression fixtures to reflect the corrected output

Validation:

  • prove -Ilib t/*.t — 97 tests passed
  • perl t/regress_test.pl — passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant