CI / Test (push) Successful in 23s
CI / Build (push) Canceled after 33s
Release / Test (push) Successful in 23s
Release / Release (push) Successful in 1m24s
Release / RPM package (push) Successful in 1m8s
Release / Windows installer (push) Successful in 1m16s
Release / AUR package (pgtidy-bin) (push) Successful in 58s
Release / AUR package (pgtidy-src) (push) Successful in 1m8s
Release / VSCode Extension (push) Successful in 39s
Release / DataGrip Plugin (push) Successful in 2m55s
Release / Debian packages (push) Failing after 43s
PgTidy — DataGrip / JetBrains Plugin
Formats SQL files in DataGrip (and any JetBrains IDE) by shelling out to the pgtidy binary.
Requirements
pgtidybinary onPATH— download from releases or build withgo install git.warky.dev/wdevs/pgtidy/cmd/pgtidy@latest- DataGrip 2024.3+ (or any JetBrains IDE 2024.3+)
Install the plugin
- Build:
./gradlew buildPlugin(output inbuild/distributions/) - In DataGrip: Settings → Plugins → ⚙ → Install Plugin from Disk… → select the
.zip - Restart the IDE
Features
- Formatting —
Format with PgTidy(Ctrl+Alt+Shift+Por right-click in the editor) formats the current SQL file viapgtidy fmt - Version check —
Tools → Show PgTidy Versionand the status bar widget show the installedpgtidyversion - Diagnostics — lint findings (MIG001–MIG003, COR001–003, NAM001–003) are shown inline as editor annotations, via a native
ExternalAnnotatorthat runspgtidy lint --json - Quick fixes — intention actions for MIG001 (add
CONCURRENTLY) and MIG003 (addNOT VALID)
Troubleshooting
"Cannot start pgtidy" error: the pgtidy binary isn't on PATH for the IDE process. Install it or restart the IDE after adding it to PATH.
No diagnostics showing: diagnostics only run on files with a .sql or .pgsql extension; check pgtidy lint --json runs cleanly on the file from a terminal with the same PATH as the IDE.