fa5436e0a7
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
66 lines
1.4 KiB
Nix
66 lines
1.4 KiB
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, stdenv
|
|
, darwin
|
|
, rust-jemalloc-sys
|
|
, ruff-lsp
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "ruff";
|
|
version = "0.4.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "astral-sh";
|
|
repo = "ruff";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-1WQQpIdGFWEq6HzFFA5qRC3wnqtUvdzC/6VIkDY1pZI=";
|
|
};
|
|
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
outputHashes = {
|
|
"lsp-types-0.95.1" = "sha256-8Oh299exWXVi6A39pALOISNfp8XBya8z+KT/Z7suRxQ=";
|
|
};
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
];
|
|
|
|
buildInputs = [
|
|
rust-jemalloc-sys
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
darwin.apple_sdk.frameworks.CoreServices
|
|
];
|
|
|
|
# tests expect no colors
|
|
preCheck = ''
|
|
export NO_COLOR=1
|
|
'';
|
|
|
|
postInstall = ''
|
|
installShellCompletion --cmd ruff \
|
|
--bash <($out/bin/ruff generate-shell-completion bash) \
|
|
--fish <($out/bin/ruff generate-shell-completion fish) \
|
|
--zsh <($out/bin/ruff generate-shell-completion zsh)
|
|
'';
|
|
|
|
passthru.tests = {
|
|
inherit ruff-lsp;
|
|
};
|
|
|
|
meta = {
|
|
description = "An extremely fast Python linter";
|
|
homepage = "https://github.com/astral-sh/ruff";
|
|
changelog = "https://github.com/astral-sh/ruff/releases/tag/v${version}";
|
|
license = lib.licenses.mit;
|
|
mainProgram = "ruff";
|
|
maintainers = with lib.maintainers; [
|
|
figsoda
|
|
GaetanLepage
|
|
];
|
|
};
|
|
}
|