2022-09-30 11:47:45 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2023-02-02 18:25:31 +00:00
|
|
|
, installShellFiles
|
2022-09-30 11:47:45 +00:00
|
|
|
, stdenv
|
2022-12-28 21:21:41 +00:00
|
|
|
, darwin
|
2022-09-30 11:47:45 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "ruff";
|
2023-02-09 11:40:11 +00:00
|
|
|
version = "0.0.244";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "charliermarsh";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-02-09 11:40:11 +00:00
|
|
|
sha256 = "sha256-oQBNVs7hoiXNqz5lYq5YNKHfpQ/c8LZAvNvtFqpTM2E=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
cargoSha256 = "sha256-61kypAXWfUZLfTbSp+b0gCKwuWtxAYVtKIwfVOcJ2o8=";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
2022-12-28 21:21:41 +00:00
|
|
|
darwin.apple_sdk.frameworks.CoreServices
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
# building tests fails with `undefined symbols`
|
|
|
|
doCheck = false;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "An extremely fast Python linter";
|
|
|
|
homepage = "https://github.com/charliermarsh/ruff";
|
2022-11-21 17:40:18 +00:00
|
|
|
changelog = "https://github.com/charliermarsh/ruff/releases/tag/v${version}";
|
2022-09-30 11:47:45 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|