Ajoute pre-commit
This commit is contained in:
parent
4606dbe9c2
commit
a3de7cfc1e
2 changed files with 15 additions and 0 deletions
1
.pre-commit-config.yaml
Symbolic link
1
.pre-commit-config.yaml
Symbolic link
|
@ -0,0 +1 @@
|
|||
/nix/store/dgy2h0brl87k6f8vsn5y15nvb383kj39-pre-commit-config.json
|
14
shell.nix
14
shell.nix
|
@ -1,6 +1,16 @@
|
|||
{ pkgs ? import <nixpkgs> { }, ... }:
|
||||
|
||||
let
|
||||
nix-pre-commit-hooks = import (builtins.fetchTarball "https://github.com/cachix/pre-commit-hooks.nix/tarball/master");
|
||||
pre-commit-check = nix-pre-commit-hooks.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
black.enable = true;
|
||||
isort.enable = true;
|
||||
flake8.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
mkSetup = self: super: pkg: super.${pkg}.overridePythonAttrs (old: { buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools ]; });
|
||||
|
||||
poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
|
||||
|
@ -21,4 +31,8 @@ pkgs.mkShell {
|
|||
pkgs.poetry
|
||||
poetryEnv
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
${pre-commit-check.shellHook}
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue