tools: do not download build tools when linting Nix files · nodejs/node@441350a · GitHub
Skip to content

Commit 441350a

Browse files
committed
tools: do not download build tools when linting Nix files
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65961 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent f81a148 commit 441350a

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎.github/workflows/nix-changes.yml‎

Lines changed: 4 additions & 3 deletions

‎shell.nix‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ pkgs.mkShell {
167167
YAMLLINT = pkgs.lib.getExe yamllint;
168168
}
169169
)
170+
// (
171+
let
172+
treefmt = pkgs.lib.lists.findFirst (p: p.meta.mainProgram == "treefmt") null devTools;
173+
in
174+
pkgs.lib.optionalAttrs (treefmt != null) {
175+
NIX_LINTER = pkgs.lib.getExe treefmt;
176+
}
177+
)
170178
// pkgs.lib.optionalAttrs (!withSQLite) {
171179
NOSQLITE = "1";
172180
}

‎tools/nix/devTools.nix‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
pkgs.gh
88
pkgs.git
99
pkgs.jq
10+
pkgs.nixfmt-tree
1011
pkgs.ruff
1112
pkgs.shellcheck
1213
pkgs.yamllint

‎tools/nix/list-requisites.sh‎

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)