Commit Graph
21 Commits
Author SHA1 Message Date
warkanum c8030247f2 chore: more work done and planning with AI.
CI / Test (push) Failing after 25s
CI / Build (push) Has been skipped
2026-06-30 22:43:25 +02:00
warkanum a58b081cae fix(release): update package manager before RPM build
CI / Test (push) Successful in 34s
CI / Build (push) Successful in 26s
2026-06-29 16:40:29 +02:00
warkanum 995760c4da chore(release): bump version to 0.0.2
CI / Test (push) Successful in 34s
CI / Build (push) Successful in 28s
Release / Release (push) Successful in 33s
Release / AUR package (push) Successful in 1m15s
Release / Test (push) Successful in 35s
Release / RPM package (push) Failing after 31s
Release / Debian packages (push) Successful in 46s
Release / VSCode Extension (push) Successful in 41s
Release / DataGrip Plugin (push) Successful in 2m37s
2026-06-29 16:35:53 +02:00
warkanumandClaude Sonnet 4.6 53f136b18d fix(release): build RPM from pre-compiled binary with injected version
CI / Test (push) Successful in 27s
CI / Build (push) Successful in 33s
rpmbuild's %build shell cannot reliably access the Go toolchain or
module cache, risking a 'dev' version string. Build the binary on the
runner (where setup-go is active) with the correct -X main.version
ldflags, then package it via rpmbuild as a binary-install RPM.

Spec changes: Source0/1 are now the binary and LICENSE; %install copies
them directly; removed %prep/%build; -bb instead of -ba (no source RPM).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 16:17:59 +02:00
warkanumandClaude Sonnet 4.6 cd710a3e63 fix(release): build RPM directly on ubuntu runner without Docker
CI / Test (push) Successful in 27s
CI / Build (push) Successful in 25s
Docker volume mounts in Gitea CI don't expose the runner workspace
correctly, leaving /build empty inside the container. Since the pgtidy
binary is statically linked Go with no shared-lib deps, rpmbuild runs
fine on ubuntu-latest with the rpm package. Drops Docker entirely from
the RPM job.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:53:39 +02:00
warkanumandClaude Sonnet 4.6 b159f1bfb3 fix(release): mount host Go into RPM container instead of downloading
CI / Test (push) Successful in 33s
CI / Build (push) Successful in 28s
go.mod specifies 'go 1.26' (no patch), making the download URL
go1.26.linux-amd64.tar.gz which 404s. Use actions/setup-go on the
runner and bind-mount GOROOT into the rockylinux container read-only,
removing the curl+tar download entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:47:58 +02:00
warkanumandClaude Sonnet 4.6 e6ebb013d2 fix(release): produce linux tarballs matching PKGBUILD source URLs
CI / Test (push) Successful in 29s
CI / Build (push) Successful in 31s
PKGBUILD expects pgtidy_${pkgver}_linux_{amd64,arm64}.tar.gz containing
the binary and LICENSE. The release job was only uploading plain binaries
(pgtidy-linux-amd64). Now creates tarballs alongside the plain binaries,
uploads both, and updates AUR SHA256 computation to use the tarballs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:46:53 +02:00
warkanumandClaude Sonnet 4.6 27c2b9c002 fix(release): bump Node to 22 for pnpm v11 compatibility
CI / Test (push) Successful in 29s
CI / Build (push) Successful in 35s
pnpm v11 (latest) requires Node >= 22.13; Node 20 caused
ERR_UNKNOWN_BUILTIN_MODULE: node:sqlite on install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:37:54 +02:00
warkanumandClaude Sonnet 4.6 05106ec368 fix(release): publish release immediately so AUR job can curl binaries
Draft releases return 404 on asset downloads, which breaks the AUR
SHA256 computation in pkg-aur. Remove draft:true so assets are publicly
accessible when downstream jobs run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:37:10 +02:00
warkanumandClaude Sonnet 4.6 749b01bfa2 fix(release): guard PREV_TAG with rev-parse before using in log range
CI / Test (push) Successful in 28s
CI / Build (push) Successful in 25s
If PREV_TAG is a malformed or non-reachable tag name, git log fails
with exit 128 under set -e. Validate with git rev-parse --verify first
and fall back to a full log if it doesn't resolve.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:27:06 +02:00
warkanumandClaude Sonnet 4.6 249f1694ef fix(release): fix VSCode pnpm, RPM docker mount, and AUR empty repo
CI / Test (push) Successful in 27s
CI / Build (push) Successful in 25s
- VSCode: switch from npm ci to pnpm (project uses pnpm-lock.yaml)
- RPM: replace docker create+cp with docker run --rm -v mount to avoid
  missing /build directory in rockylinux:9
- AUR: guard PKGBUILD reads with -f check so first publish to an empty
  AUR repo defaults pkgrel to 1 instead of crashing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:17:18 +02:00
warkanum 9243c281a6 docs: update README with installation and usage instructions
CI / Test (push) Successful in 23s
CI / Build snapshot (push) Failing after 49s
2026-06-28 18:08:41 +02:00
warkanum d1150a7eea feat(lsp): add textDocument/rangeFormatting support
CI / Test (push) Successful in 50s
CI / Build snapshot (push) Failing after 1m12s
Advertise DocumentRangeFormattingProvider in server capabilities and
implement rangeFormat: formats the complete document, then returns an
edit covering only the minimal changed-line region that overlaps the
client's selection. Also includes gofmt alignment fixes across lint
and format packages.
2026-06-28 16:28:27 +02:00
warkanum a98dee1877 feat(dml): implement DML statement formatting and tests
CI / Test (push) Failing after 45s
CI / Build snapshot (push) Has been skipped
* Add formatDML function for formatting top-level DML statements
* Introduce tests for various DML scenarios including SELECT, INSERT, UPDATE, and DELETE
* Enhance printer to handle DML statements correctly
2026-06-28 16:20:37 +02:00
warkanum f378bf4a18 feat(datagrip): add PgTidy formatting action for SQL files
CI / Test (push) Failing after 39s
CI / Build snapshot (push) Has been skipped
* Implement PgTidyFormatAction to format SQL using pgtidy
* Register action in plugin.xml with keyboard shortcut
* Update dependencies for bundled plugins
* Modify build configuration for Gradle wrapper
2026-06-28 15:24:08 +02:00
warkanum e88d32f281 feat: add LSP server, VSCode + DataGrip extensions, release infra, autofix
CI / Test (push) Failing after 47s
CI / Build snapshot (push) Has been skipped
- pkg/lsp: JSON-RPC 2.0 LSP server (formatting, diagnostics, codeAction quick-fixes)
- cmd/pgtidy: lsp and config subcommands
- pkg/diagnostics: TextFix struct for byte-range autofixes
- pkg/lint: MIG001/MIG003 autofixes, ApplyFixes helper, --fix flag on lint command
- editors/vscode: TypeScript extension with LanguageClient, showVersion/showConfig/formatDocument commands, logo
- editors/datagrip: Gradle JetBrains plugin via LSP4IJ, pluginIcon
- .goreleaser.yaml, .github/workflows: CI + release pipeline
- Makefile: snapshot, release, vscode-compile, vscode-package targets
- go.mod + all imports: module path updated to git.warky.dev/wdevs/pgtidy
- assets: logo files (256px, 128px, 1024px, ico)
2026-06-28 12:48:28 +02:00
warkanum 7fb76bae3d feat(lint): add linter rules for migration and naming conventions
* Implement migration safety rules:
  - MIG001: Warn on CREATE INDEX without CONCURRENT.
  - MIG002: Warn on ALTER TABLE ADD COLUMN NOT NULL without DEFAULT.
  - MIG003: Warn on ALTER TABLE ADD CONSTRAINT without NOT VALID.
* Implement naming conventions rules:
  - NAM001: Warn on non-snake_case table names.
  - NAM002: Warn on non-snake_case column names in CREATE TABLE.
  - NAM003: Warn on non-snake_case function names.
* Add test fixtures for all new rules.
2026-06-27 22:15:02 +02:00
warkanum 932c83dbad feat(cmd): add unified diff output option for formatting
* Implemented `-d`/`--diff` flag to print unified diffs.
* Added `unifiedDiff` function for generating diffs.
* Config discovery now merges fields from `.pgtidy.yaml`.
2026-06-27 19:32:57 +02:00
warkanum d4e6102932 feat(format): add PL/pgSQL body formatting and tests
* Implemented formatting for BEGIN...END blocks in PL/pgSQL.
* Added logic to handle indentation and blank lines.
* Introduced tests for broken formatting cases.
2026-06-27 19:10:02 +02:00
warkanum 6492ab35b7 feat(format): implement PL/pgSQL body formatting
* add formatBody and formatBodyInner functions for DECLARE section
* update needSpace to handle LBracket correctly
* enhance semanticallyEqual to compare dollar-quoted bodies
* add test data for broken layout scenarios
2026-06-23 21:15:27 +02:00
warkanum 90fe1a448b Initial commit 2026-06-23 11:50:55 +00:00