Open srid opened 2 years ago
This is now possible using "github:srid/treefmt/withConfig-stable"
treefmt.buildInputs = [
(inputs'.treefmt.legacyPackages.default.withConfig {
projectRootFile = "flake.nix";
settings = {
formatter = {
nix = {
command = lib.getExe pkgs.nixpkgs-fmt;
includes = [ "*.nix" ];
};
purescript = {
command = lib.getExe pkgs.nodePackages.purs-tidy;
options = [ "format-in-place" ];
# Note that given how purs-tidy is designed (takes glob, rather than explicit
# list of files), these patters inevitably slow down purs-tidy (thus treefmt)
# during the initial run.
includes = [
"src/**/*.purs"
"core/**/*.purs"
"lib/**/*.purs"
"src/**/*.purs"
"domain/**/*.purs"
"infrastructure/**/*.purs"
"ui-guide/**/*.purs"
"test/**/*.purs"
];
};
};
};
})
];
May as well retire this repo right away by moving it to upstream repo after https://github.com/numtide/treefmt/pull/169 gets merged to master
.
We want to nixify
treefmt.toml
, and have it directly use the nix packages, in addition to havingtreefmt
in nix shell run with the nixified configuration.We can use https://github.com/numtide/treefmt/pull/169 but the main blocker is the lack of
PRJ_ROOT
(see comments).