From b114bb9395e834b566d6f7924f6ab3f538055812 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 2 Jun 2026 10:35:59 +0200 Subject: [PATCH] nix: replace silver-searcher with fd The former has been removed from Nixpkgs and won't be available on the next bump. --- .fdignore | 1 + .gitignore | 2 ++ nix/tools/devTools.nix | 4 ++-- nix/tools/style.nix | 10 ++++------ 4 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 .fdignore diff --git a/.fdignore b/.fdignore new file mode 100644 index 000000000..6b8710a71 --- /dev/null +++ b/.fdignore @@ -0,0 +1 @@ +.git diff --git a/.gitignore b/.gitignore index 230716db7..5f16c95f9 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ loadtest gen_targets.http gen_jwk.json gen_private.json +.pytest_cache +.ruff_cache diff --git a/nix/tools/devTools.nix b/nix/tools/devTools.nix index 1fd2be431..039c0bfd5 100644 --- a/nix/tools/devTools.nix +++ b/nix/tools/devTools.nix @@ -5,11 +5,11 @@ , curl , devCabalOptions , entr +, fd , git , graphviz , hsie , nix -, silver-searcher , stdenv , style , tests @@ -41,7 +41,7 @@ let } '' while true; do - (! ${silver-searcher}/bin/ag -l . | ${entr}/bin/entr -dr "$_arg_command" "''${_arg_leftovers[@]}") + (! ${fd}/bin/fd -H | ${entr}/bin/entr -dr "$_arg_command" "''${_arg_leftovers[@]}") done ''; diff --git a/nix/tools/style.nix b/nix/tools/style.nix index f9c92afb3..20c237ebe 100644 --- a/nix/tools/style.nix +++ b/nix/tools/style.nix @@ -3,13 +3,13 @@ , buildToolbox , checkedShellScript , deadnix +, fd , git , hlint , hsie , nixpkgs-fmt , python3Packages , ruff -, silver-searcher , statix , stylish-haskell , writeText @@ -28,8 +28,7 @@ let ${nixpkgs-fmt}/bin/nixpkgs-fmt . > /dev/null 2> /dev/null # Format Haskell files - # --vimgrep fixes a bug in ag: https://github.com/ggreer/the_silver_searcher/issues/753 - ${silver-searcher}/bin/ag -l --vimgrep -g '\.l?hs$' . \ + ${fd}/bin/fd '\.l?hs$' \ | xargs ${stylish-haskell}/bin/stylish-haskell -i # Format Python files @@ -82,7 +81,7 @@ let # ruff has gaps in scanning for unused code, so we use vulture echo "Scanning python files for unused code..." - ${silver-searcher}/bin/ag -l --vimgrep -g '\.l?py$' . \ + ${fd}/bin/fd '\.l?py$' \ | xargs ${python3Packages.vulture}/bin/vulture --exclude docs/conf.py --min-confidence 80 echo "Linting python files..." @@ -92,8 +91,7 @@ let ${hsie} check-aliases main src echo "Linting Haskell files..." - # --vimgrep fixes a bug in ag: https://github.com/ggreer/the_silver_searcher/issues/753 - ${silver-searcher}/bin/ag -l --vimgrep -g '\.l?hs$' . \ + ${fd}/bin/fd '\.l?hs$' \ | xargs ${hlint}/bin/hlint --hint=${hlintConfig} '';