Skip to content

Commit

Permalink
more reliable check if formatters are available
Browse files Browse the repository at this point in the history
Co-authored-by: Sandro <[email protected]>
  • Loading branch information
Mic92 and SuperSandro2000 committed Nov 9, 2024
1 parent d88a9bb commit 66bc6c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pkgs.python3.pkgs.buildPythonApplication {
pname = "nix-update";
version = "1.5.2";
src = ./.;
format = "pyproject";
pyproject = true;
buildInputs = [ pkgs.makeWrapper ];
nativeBuildInputs = [ pkgs.python3.pkgs.setuptools ];
nativeCheckInputs = [
Expand Down
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).success;
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).success;
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).success;
programs.shfmt.enable = true;
settings.formatter.shfmt.includes = [ "*.envrc" ];
};
Expand Down

0 comments on commit 66bc6c9

Please sign in to comment.