Merge pull request #214481 from MercuryTechnologies/andrewsmith/squawk

squawk: init at 0.20.0
This commit is contained in:
Mario Rodas 2023-02-13 21:32:01 -05:00 committed by GitHub
commit 2cb1b56668
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 101 additions and 0 deletions

View file

@ -932,6 +932,12 @@
githubId = 106511;
name = "Andrew Kelley";
};
andrewsmith = {
email = "andrew@velvet.software";
github = "andrewsmith";
githubId = 29887;
name = "Andrew Smith";
};
andsild = {
email = "andsild@gmail.com";
github = "andsild";

View file

@ -0,0 +1,13 @@
diff --git a/Cargo.lock b/Cargo.lock
index d5803a8..384224d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1585,7 +1585,7 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]]
name = "squawk"
-version = "0.19.0"
+version = "0.20.0"
dependencies = [
"atty",
"base64 0.12.3",

View file

@ -0,0 +1,67 @@
{ darwin
, fetchFromGitHub
, lib
, libiconv
, libpg_query
, openssl
, pkg-config
, rustPlatform
, stdenv
}:
let
# The query parser produces a slightly different AST between major versions
# and Squawk is not capable of handling >=14 correctly yet.
libpg_query13 = libpg_query.overrideAttrs (_: rec {
version = "13-2.2.0";
src = fetchFromGitHub {
owner = "pganalyze";
repo = "libpg_query";
rev = version;
hash = "sha256-gEkcv/j8ySUYmM9lx1hRF/SmuQMYVHwZAIYOaCQWAFs=";
};
});
in
rustPlatform.buildRustPackage rec {
pname = "squawk";
version = "0.20.0";
src = fetchFromGitHub {
owner = "sbdchd";
repo = pname;
rev = "v${version}";
hash = "sha256-v9F+HfscX4dIExIP1YvxOldZPPtmxh8lO3SREu6M+C0=";
};
cargoHash = "sha256-kSaQxqom8LSCOQBoIZ1iv+q2+Ih8l61L97xXv5c4a0k=";
cargoPatches = [
./correct-Cargo.lock.patch
];
patches = [
./fix-postgresql-version-in-snapshot-test.patch
];
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = lib.optionals (!stdenv.isDarwin) [
libiconv
openssl
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
CoreFoundation
Security
]);
LIBPG_QUERY_PATH = libpg_query13;
meta = with lib; {
description = "Linter for PostgreSQL, focused on migrations";
homepage = "https://squawkhq.com/";
changelog = "https://github.com/sbdchd/squawk/blob/v${version}/CHANGELOG.md";
license = licenses.gpl3Only;
maintainers = with lib.maintainers; [ andrewsmith ];
};
}

View file

@ -0,0 +1,13 @@
diff --git a/parser/src/snapshots/squawk_parser__parse__tests__parse_sql_query_json.snap b/parser/src/snapshots/squawk_parser__parse__tests__parse_sql_query_json.snap
index 7273b74..ae94927 100644
--- a/parser/src/snapshots/squawk_parser__parse__tests__parse_sql_query_json.snap
+++ b/parser/src/snapshots/squawk_parser__parse__tests__parse_sql_query_json.snap
@@ -133,7 +133,7 @@ Ok(
}),
]),
"version": Number(
- 130003,
+ 130008,
),
}),
)

View file

@ -5664,6 +5664,8 @@ with pkgs;
sqlint = callPackage ../development/tools/sqlint { };
squawk = callPackage ../development/tools/squawk { };
antibody = callPackage ../shells/zsh/antibody { };
antigen = callPackage ../shells/zsh/antigen { };