-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #424 from Mic92/joerg-ci
modernize formatters
- Loading branch information
Showing
9 changed files
with
117 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ pkgs ? import <nixpkgs> { } }: | ||
{ | ||
pkgs ? import <nixpkgs> { }, | ||
}: | ||
|
||
with pkgs; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
{ config ? { }, system ? null } @ args: | ||
{ | ||
config ? { }, | ||
# deadnix: skip | ||
system ? null, | ||
}@args: | ||
let | ||
pkgs = | ||
import @NIXPKGS@ (args // { inherit config; | ||
}); | ||
in { | ||
pkg1 = pkgs.stdenv.mkDerivation { | ||
pkgs = import "@NIXPKGS@" (args // { inherit config; }); | ||
in | ||
{ | ||
pkg1 = pkgs.stdenv.mkDerivation { | ||
name = "pkg1"; | ||
dontUnpack = true; | ||
installPhase = '' | ||
install -D ${./pkg1.txt} $out/foo | ||
''; | ||
}; | ||
# hack to not break evaluation with nixpkgs_review/nix/*.nix | ||
inherit (pkgs) lib mkShell bashInteractive; | ||
} | ||
}; | ||
# hack to not break evaluation with nixpkgs_review/nix/*.nix | ||
inherit (pkgs) lib mkShell bashInteractive; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,32 @@ | ||
{ lib, inputs, ... }: { | ||
{ lib, inputs, ... }: | ||
{ | ||
imports = [ | ||
inputs.treefmt-nix.flakeModule | ||
]; | ||
|
||
perSystem = { pkgs, ... }: { | ||
treefmt = { | ||
# Used to find the project root | ||
projectRootFile = "flake.lock"; | ||
perSystem = | ||
{ pkgs, ... }: | ||
{ | ||
treefmt = { | ||
# Used to find the project root | ||
projectRootFile = "flake.lock"; | ||
|
||
programs.deno.enable = true; | ||
programs.mypy.enable = true; | ||
programs.mypy.directories = { | ||
"." = { | ||
directory = "."; | ||
extraPythonPackages = [ | ||
pkgs.python3.pkgs.pytest | ||
]; | ||
}; | ||
}; | ||
|
||
settings.formatter = { | ||
nix = { | ||
command = "sh"; | ||
options = [ | ||
"-eucx" | ||
'' | ||
# First deadnix | ||
${lib.getExe pkgs.deadnix} --edit "$@" | ||
# Then nixpkgs-fmt | ||
${lib.getExe pkgs.nixpkgs-fmt} "$@" | ||
'' | ||
"--" | ||
]; | ||
includes = [ "*.nix" ]; | ||
}; | ||
programs.deno.enable = | ||
pkgs.lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.deno && !pkgs.deno.meta.broken; | ||
programs.ruff.format = true; | ||
programs.ruff.check = true; | ||
programs.mypy.enable = true; | ||
programs.nixfmt.enable = pkgs.lib.meta.availableOn pkgs.stdenv.buildPlatform pkgs.nixfmt-rfc-style.compiler; | ||
programs.deadnix.enable = true; | ||
|
||
python = { | ||
command = "sh"; | ||
options = [ | ||
"-eucx" | ||
'' | ||
${lib.getExe pkgs.ruff} --fix "$@" | ||
${lib.getExe pkgs.ruff} format "$@" | ||
'' | ||
"--" # this argument is ignored by bash | ||
]; | ||
includes = [ "*.py" ]; | ||
programs.mypy.directories = { | ||
"." = { | ||
directory = "."; | ||
extraPythonPackages = [ | ||
pkgs.python3.pkgs.pytest | ||
]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |