Skip to content

Commit

Permalink
more reliable check if formatters are available
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Oct 10, 2024
1 parent d88a9bb commit 716e8ca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions treefmt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
# Used to find the project root
projectRootFile = "flake.lock";

programs.deno.enable =
pkgs.lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.deno && !pkgs.deno.meta.broken;
programs.deno.enable = builtins.tryEval (pkgs.deno) != null;
programs.mypy.enable = true;

programs.yamlfmt.enable = true;

programs.nixfmt.enable = pkgs.lib.meta.availableOn pkgs.stdenv.buildPlatform pkgs.nixfmt-rfc-style.compiler;
programs.nixfmt.enable = builtins.tryEval (pkgs.nixfmt-rfc-style) != null;
programs.deadnix.enable = true;
programs.ruff.format = true;
programs.ruff.check = true;

programs.shellcheck.enable = pkgs.lib.meta.availableOn pkgs.stdenv.buildPlatform pkgs.shellcheck.compiler;
programs.shellcheck.enable = builtins.tryEval (pkgs.shellcheck) != null;
programs.shfmt.enable = true;
settings.formatter.shfmt.includes = [ "*.envrc" ];
};
Expand Down

0 comments on commit 716e8ca

Please sign in to comment.