Add pre-commit hooks.

This commit is contained in:
CronyAkatsuki 2024-03-19 14:07:26 +01:00
parent c7cc18a5b4
commit eff96a6f7b
4 changed files with 183 additions and 16 deletions

View file

@ -1,14 +1,17 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
{ pkgs ? import <nixpkgs> { }, pre-commit-hooks }:
let
pre-commit-check = pre-commit-hooks.lib.${pkgs.system}.run {
src = ./.;
hooks = {
gofmt.enable = true;
isort.enable = true;
black.enable = true;
};
};
in pkgs.mkShell {
inherit (pre-commit-check) shellHook;
name = "hb-downloader";
buildInputs = [
(pkgs.python3.withPackages ( pyPkgs: with pyPkgs; [
requests
mypy
]))
];
nativeBuildInputs = [
pkgs.aria2
];
buildInputs =
[ (pkgs.python3.withPackages (pyPkgs: with pyPkgs; [ requests mypy ])) ];
nativeBuildInputs = [ pkgs.aria2 ];
}