add deadnix to formatter

This commit is contained in:
Jörg Thalheim 2023-07-21 11:23:10 +02:00
parent 22849366d8
commit 3ab90e6785
9 changed files with 18 additions and 11 deletions

View File

@ -9,8 +9,21 @@
treefmt.projectRootFile = "flake.nix";
treefmt.flakeCheck = true;
treefmt.flakeFormatter = true;
treefmt.programs.nixpkgs-fmt.enable = true;
treefmt.programs.shellcheck.enable = true;
treefmt.settings.formatter.nix = {
command = "sh";
options = [
"-eucx"
''
# First deadnix
${lib.getExe pkgs.deadnix} --edit "$@"
# Then nixpkgs-fmt
${lib.getExe pkgs.nixpkgs-fmt} "$@"
''
"--" # this argument is ignored by bash
];
includes = [ "*.nix" ];
};
treefmt.settings.formatter.python = {
command = "sh";
options = [

View File

@ -1,4 +1,4 @@
{ self, ... }: {
{ ... }: {
pre-commit.settings.hooks.alejandra.enable = true;
pre-commit.settings.hooks.shellcheck.enable = true;
}

View File

@ -14,7 +14,6 @@
outputs = inputs @ { flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ lib
, config
, self
, ...
}: {
systems = lib.systems.flakeExposed;

View File

@ -1,5 +1,4 @@
{ config
, lib
{ lib
, pkgs
, ...
}: {

View File

@ -51,7 +51,7 @@ let
'';
};
checkPython = python3.withPackages (ps: devDependencies ++ dependencies);
checkPython = python3.withPackages (_ps: devDependencies ++ dependencies);
check = runCommand "${name}-check" { } ''
cp -r ${src} ./src

View File

@ -1,5 +1,4 @@
{ pkgs ? import <nixpkgs> { }
, system ? builtins.currentSystem
,
}:
let

View File

@ -42,7 +42,7 @@ let
passthru.devDependencies = devDependencies;
};
checkPython = python3.withPackages (ps: devDependencies ++ dependencies);
checkPython = python3.withPackages (_ps: devDependencies ++ dependencies);
check = runCommand "${name}-check" { } ''
cp -r ${src} ./src

View File

@ -1,8 +1,6 @@
{
perSystem = { pkgs, ... }:
let
pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml);
name = pyproject.project.name;
package = pkgs.callPackage ./default.nix { };
in
{

View File

@ -1,5 +1,4 @@
{ pkgs ? import <nixpkgs> { }
, system ? builtins.currentSystem
,
}:
let