14 rustPlatform.buildRustPackage rec {
18 src = fetchFromGitHub {
21 rev = "refs/tags/${version}";
22 hash = "sha256-O8iRCVxHrchBSf9kLdkdT0+oMi+5fLCAF9CMEsPrHqw=";
26 lockFile = ./Cargo.lock;
28 "lsp-types-0.95.1" = "sha256-8Oh299exWXVi6A39pALOISNfp8XBya8z+KT/Z7suRxQ=";
29 "salsa-0.18.0" = "sha256-zHXLNK6SCiJ3MmT0PMIauA1eolyJ4wfVWxN6wcvmhts=";
33 nativeBuildInputs = [ installShellFiles ];
37 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.CoreServices ];
39 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
40 installShellCompletion --cmd ruff \
41 --bash <($out/bin/ruff generate-shell-completion bash) \
42 --fish <($out/bin/ruff generate-shell-completion fish) \
43 --zsh <($out/bin/ruff generate-shell-completion zsh)
50 updateScript = nix-update-script { };
53 # Failing on darwin for an unclear reason.
54 # According to the maintainers, those tests are from an experimental crate that isn't actually
55 # used by ruff currently and can thus be safely skipped.
56 checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
58 "--skip=changed_metadata"
59 "--skip=changed_versions_file"
61 "--skip=directory_deleted"
62 "--skip=directory_moved_to_trash"
63 "--skip=directory_moved_to_workspace"
64 "--skip=directory_renamed"
65 "--skip=hard_links_in_workspace"
66 "--skip=hard_links_to_target_outside_workspace"
67 "--skip=move_file_to_trash"
68 "--skip=move_file_to_workspace"
70 "--skip=new_ignored_file"
73 "--skip=unix::symlink_inside_workspace"
76 nativeInstallCheckInputs = [
79 versionCheckProgramArg = [ "--version" ];
80 doInstallCheck = true;
83 description = "Extremely fast Python linter";
84 homepage = "https://github.com/astral-sh/ruff";
85 changelog = "https://github.com/astral-sh/ruff/releases/tag/${version}";
86 license = lib.licenses.mit;
88 maintainers = with lib.maintainers; [