diff --git a/CHANGELOG.md b/CHANGELOG.md index 82a4b032..fee73404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,90 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## v2.50.0 - 2026-05-01 + +### Added + +- linter: new rule: prefer-repack (#1105) + + `repack` isn't out yet, coming in PG19, but when it's out: + + ```sql + -- instead of + cluster foo; + -- or + vacuum full foo; + -- use + repack (concurrently) foo; + ``` + +- linter: new rule: require-concurrent-reindex (#1104) + + ```sql + -- instead of + reindex table foo; + -- use + reindex table concurrently foo; + ``` + +- linter: new rule: require-concurrent-partition-detach (#1103) + + ```sql + -- instead of + alter table t detach partition p; + -- use + alter table t detach partition p concurrently; + ``` + +- linter: new rule: identifier-too-long (#1102) + + Postgres truncates identifiers that are too long, we now warn about this. + + ```sql + create table table_very_long_very_long_very_long_very_long_very_long_very_long (c bigint); + ``` + + ``` + warning[identifier-too-long]: `table_very_long_very_long_very_long_very_long_very_long_very_long` is too long and will be truncated to 63 bytes. + ╭▸ stdin:1:14 + │ + 1 │ create table table_very_long_very_long_very_long_very_long_very_long_very_long (c bigint); + │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ╭╴ + 1 - create table table_very_long_very_long_very_long_very_long_very_long_very_long (c bigint); + 1 + create table table_very_long_very_long_very_long_very_long_very_long_very_lo (c bigint); + ╰╴ + ``` + + Thanks @subnix for coming up with this idea! + +- linter: parallel file checking (#1099) + + We now check files in parallel using rayon, which gives a nice speed up of + 22-55%. + +- lexer/ide: fix lexing of non-ascii + fix case folding in goto def (#1101) + + Previously we case folding all of the characters in our unquoted identifiers + including unicode. This differed from Postgres behavior which only folded ascii. + + Now we correctly error instead of resolving in the following: + + ```sql + with t as (select 1 Äpfel) + select äpfel from t; + -- ^ goto def no longer resolves + ``` + + Additionally fixed a bug in the lexer where we weren't lexing unicode identifiers. + + For example, the following now lexes: + + ```sql + with t as (select 1 🦀) + select 🦀 from t; + ``` + ## v2.49.0 - 2026-04-27 ### Added diff --git a/Cargo.lock b/Cargo.lock index ba760651..62d9725d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2385,7 +2385,7 @@ dependencies = [ [[package]] name = "squawk" -version = "2.49.0" +version = "2.50.0" dependencies = [ "annotate-snippets", "anyhow", @@ -2416,7 +2416,7 @@ dependencies = [ [[package]] name = "squawk-fmt" -version = "2.49.0" +version = "2.50.0" dependencies = [ "anyhow", "camino", @@ -2432,7 +2432,7 @@ dependencies = [ [[package]] name = "squawk-github" -version = "2.49.0" +version = "2.50.0" dependencies = [ "jsonwebtoken", "log", @@ -2443,7 +2443,7 @@ dependencies = [ [[package]] name = "squawk-ide" -version = "2.49.0" +version = "2.50.0" dependencies = [ "annotate-snippets", "etcetera", @@ -2465,14 +2465,14 @@ dependencies = [ [[package]] name = "squawk-lexer" -version = "2.49.0" +version = "2.50.0" dependencies = [ "insta", ] [[package]] name = "squawk-linter" -version = "2.49.0" +version = "2.50.0" dependencies = [ "annotate-snippets", "enum-iterator", @@ -2487,7 +2487,7 @@ dependencies = [ [[package]] name = "squawk-parser" -version = "2.49.0" +version = "2.50.0" dependencies = [ "annotate-snippets", "camino", @@ -2500,7 +2500,7 @@ dependencies = [ [[package]] name = "squawk-server" -version = "2.49.0" +version = "2.50.0" dependencies = [ "anyhow", "crossbeam-channel", @@ -2526,7 +2526,7 @@ dependencies = [ [[package]] name = "squawk-syntax" -version = "2.49.0" +version = "2.50.0" dependencies = [ "annotate-snippets", "camino", @@ -2540,7 +2540,7 @@ dependencies = [ [[package]] name = "squawk-thread" -version = "2.49.0" +version = "2.50.0" dependencies = [ "crossbeam-channel", "crossbeam-utils", @@ -2552,7 +2552,7 @@ dependencies = [ [[package]] name = "squawk-wasm" -version = "2.49.0" +version = "2.50.0" dependencies = [ "console_error_panic_hook", "console_log", @@ -3428,7 +3428,7 @@ checksum = "32ac00cd3f8ec9c1d33fb3e7958a82df6989c42d747bd326c822b1d625283547" [[package]] name = "xtask" -version = "2.49.0" +version = "2.50.0" dependencies = [ "anyhow", "camino", diff --git a/Cargo.toml b/Cargo.toml index b0a5ecdb..9e3a5d36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["crates/*"] resolver = "2" [workspace.package] -version = "2.49.0" +version = "2.50.0" edition = "2024" rust-version = "1.94" authors = ["Squawk Team & Contributors"] @@ -78,14 +78,14 @@ rustc-hash = "2.1.1" # local # we have to make the versions explicit otherwise `cargo publish` won't work -squawk-github = { path = "./crates/squawk_github", version = "2.49.0" } -squawk-ide = { path = "./crates/squawk_ide", version = "2.49.0" } -squawk-lexer = { path = "./crates/squawk_lexer", version = "2.49.0" } -squawk-parser = { path = "./crates/squawk_parser", version = "2.49.0" } -squawk-syntax = { path = "./crates/squawk_syntax", version = "2.49.0" } -squawk-linter = { path = "./crates/squawk_linter", version = "2.49.0" } -squawk-server = { path = "./crates/squawk_server", version = "2.49.0" } -squawk-thread = { path = "./crates/squawk_thread", version = "2.49.0" } +squawk-github = { path = "./crates/squawk_github", version = "2.50.0" } +squawk-ide = { path = "./crates/squawk_ide", version = "2.50.0" } +squawk-lexer = { path = "./crates/squawk_lexer", version = "2.50.0" } +squawk-parser = { path = "./crates/squawk_parser", version = "2.50.0" } +squawk-syntax = { path = "./crates/squawk_syntax", version = "2.50.0" } +squawk-linter = { path = "./crates/squawk_linter", version = "2.50.0" } +squawk-server = { path = "./crates/squawk_server", version = "2.50.0" } +squawk-thread = { path = "./crates/squawk_thread", version = "2.50.0" } [workspace.lints.clippy] collapsible_else_if = "allow" diff --git a/README.md b/README.md index c3dc7711..7ee163b5 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ to your project's `.pre-commit-config.yaml`: ```yaml repos: - repo: https://github.com/sbdchd/squawk - rev: 2.49.0 + rev: 2.50.0 hooks: - id: squawk files: path/to/postgres/migrations/written/in/sql diff --git a/crates/squawk_github/src/app.rs b/crates/squawk_github/src/app.rs index 4dd7ea40..9c4c8292 100644 --- a/crates/squawk_github/src/app.rs +++ b/crates/squawk_github/src/app.rs @@ -11,7 +11,7 @@ use serde_json::Value; use std::time::Duration; use std::time::{SystemTime, UNIX_EPOCH}; -pub(crate) const SQUAWK_USER_AGENT: &str = "squawk/2.49.0"; +pub(crate) const SQUAWK_USER_AGENT: &str = "squawk/2.50.0"; #[derive(Debug, Serialize)] struct CommentBody { diff --git a/flake.nix b/flake.nix index cd8f99e7..f7f4bed5 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ { squawk = final.rustPlatform.buildRustPackage { pname = "squawk"; - version = "2.49.0"; + version = "2.50.0"; cargoLock = { lockFile = ./Cargo.lock; diff --git a/package.json b/package.json index f1ef6f92..2737cde4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "squawk-cli", - "version": "2.49.0", + "version": "2.50.0", "description": "linter for PostgreSQL, focused on migrations", "repository": "git@github.com:sbdchd/squawk.git", "author": "Squawk Team & Contributors", diff --git a/squawk-vscode/package.json b/squawk-vscode/package.json index a46390f6..2b0845d0 100644 --- a/squawk-vscode/package.json +++ b/squawk-vscode/package.json @@ -12,7 +12,7 @@ "icon": "icon.png", "author": "Squawk Team & Contributors", "license": "(Apache-2.0 OR MIT)", - "version": "2.49.0", + "version": "2.50.0", "engines": { "vscode": "^1.101.0" },