Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
58 lines
1.6 KiB
Nix
58 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
rustPlatform,
|
|
fetchFromGitHub,
|
|
stdenv,
|
|
nix-update-script,
|
|
versionCheckHook,
|
|
}:
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "sqruff";
|
|
version = "0.29.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "quarylabs";
|
|
repo = "sqruff";
|
|
tag = "v${version}";
|
|
hash = "sha256-bJmkHOACjdSXHE56okrIFERs1wK00XeyipdIFbRjIFI=";
|
|
};
|
|
|
|
cargoHash = "sha256-TxADMtapo6Pc4Z0MUkzkzUIrLnGa1DdZFzfTq4buF4g=";
|
|
|
|
# Disable the `python` feature which doesn't work on Nix yet
|
|
buildNoDefaultFeatures = true;
|
|
buildAndTestSubdir = "crates/cli";
|
|
|
|
# Patch the tests to find the sqruff binary
|
|
postPatch = ''
|
|
substituteInPlace \
|
|
crates/cli/tests/config_not_found.rs \
|
|
crates/cli/tests/configure_rule.rs \
|
|
crates/cli/tests/fix_parse_errors.rs \
|
|
crates/cli/tests/fix_return_code.rs \
|
|
crates/cli/tests/ui_github.rs \
|
|
crates/cli/tests/ui_json.rs \
|
|
crates/cli/tests/ui.rs \
|
|
--replace-fail \
|
|
'sqruff_path.push(format!("../../target/{}/sqruff", profile));' \
|
|
'sqruff_path.push(format!("../../target/${stdenv.hostPlatform.rust.cargoShortTarget}/{}/sqruff", profile));'
|
|
'';
|
|
|
|
nativeCheckInputs = [ versionCheckHook ];
|
|
versionCheckProgramArg = "--version";
|
|
doInstallCheck = true;
|
|
|
|
passthru = {
|
|
updateScript = nix-update-script { };
|
|
};
|
|
|
|
meta = {
|
|
description = "Fast SQL formatter/linter";
|
|
homepage = "https://github.com/quarylabs/sqruff";
|
|
changelog = "https://github.com/quarylabs/sqruff/releases/tag/${version}";
|
|
license = lib.licenses.asl20;
|
|
mainProgram = "sqruff";
|
|
maintainers = with lib.maintainers; [ hasnep ];
|
|
};
|
|
}
|