feat: split treefmt into format and lint modules
This commit is contained in:
@@ -31,15 +31,17 @@
|
||||
|
||||
perSystem = {system, ...}: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
treefmtEval = treefmt-nix.lib.evalModule pkgs ./nix/formatting/treefmt.nix;
|
||||
treefmtFormatEval = treefmt-nix.lib.evalModule pkgs ./nix/formatting/treefmt-format.nix;
|
||||
treefmtLintEval = treefmt-nix.lib.evalModule pkgs ./nix/formatting/treefmt-lint.nix;
|
||||
in {
|
||||
checks =
|
||||
{
|
||||
formatting = treefmtEval.config.build.check inputs.self;
|
||||
formatting = treefmtFormatEval.config.build.check inputs.self;
|
||||
linting = treefmtLintEval.config.build.check inputs.self;
|
||||
}
|
||||
// import ./nix/tests/integration {inherit pkgs;};
|
||||
|
||||
formatter = treefmtEval.config.build.wrapper;
|
||||
formatter = treefmtFormatEval.config.build.wrapper;
|
||||
|
||||
packages = let
|
||||
package = import ./nix/package.nix {
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
projectRootFile = "flake.nix";
|
||||
|
||||
programs = {
|
||||
deadnix = {
|
||||
enable = true;
|
||||
priority = 10;
|
||||
};
|
||||
|
||||
statix = {
|
||||
enable = true;
|
||||
priority = 20;
|
||||
};
|
||||
|
||||
alejandra = {
|
||||
enable = true;
|
||||
priority = 30;
|
||||
};
|
||||
|
||||
black = {
|
||||
prettier = {
|
||||
enable = true;
|
||||
includes = [
|
||||
"*.py"
|
||||
];
|
||||
priority = 80;
|
||||
};
|
||||
|
||||
deadnix = {
|
||||
enable = true;
|
||||
priority = 10;
|
||||
priority = 50;
|
||||
settings.editorconfig = true;
|
||||
};
|
||||
|
||||
deno = {
|
||||
@@ -42,15 +44,12 @@
|
||||
profile = "black";
|
||||
};
|
||||
|
||||
prettier = {
|
||||
black = {
|
||||
enable = true;
|
||||
priority = 50;
|
||||
settings.editorconfig = true;
|
||||
};
|
||||
|
||||
statix = {
|
||||
enable = true;
|
||||
priority = 20;
|
||||
includes = [
|
||||
"*.py"
|
||||
];
|
||||
priority = 80;
|
||||
};
|
||||
};
|
||||
|
||||
10
nix/formatting/treefmt-lint.nix
Normal file
10
nix/formatting/treefmt-lint.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
_: {
|
||||
projectRootFile = "flake.nix";
|
||||
|
||||
programs = {
|
||||
nixf-diagnose = {
|
||||
enable = true;
|
||||
priority = 10;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user