depot/third_party/nixpkgs/pkgs/development/tools/ruff/default.nix
Default email a0cb138ada Project import generated by Copybara.
GitOrigin-RevId: a100acd7bbf105915b0004427802286c37738fef
2023-02-02 18:25:31 +00:00

47 lines
1.1 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, stdenv
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "ruff";
version = "0.0.239";
src = fetchFromGitHub {
owner = "charliermarsh";
repo = pname;
rev = "v${version}";
sha256 = "sha256-ogAy1HrkoG7PWvDd4HlqTVNjrWpyWw2B+E9DANCoJNo=";
};
cargoSha256 = "sha256-C5ZOV2EUiV4W3J3jXS+aDyL3w+Rjx1YGTaE8ikqB2VQ=";
nativeBuildInputs = [
installShellFiles
];
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.CoreServices
];
# building tests fails with `undefined symbols`
doCheck = false;
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)
'';
meta = with lib; {
description = "An extremely fast Python linter";
homepage = "https://github.com/charliermarsh/ruff";
changelog = "https://github.com/charliermarsh/ruff/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ figsoda ];
};
}