Add pre-commit hooks.
This commit is contained in:
parent
c7cc18a5b4
commit
eff96a6f7b
4 changed files with 183 additions and 16 deletions
27
shell.nix
27
shell.nix
|
@ -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 ];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue