File tree 1 file changed +22
-14
lines changed
1 file changed +22
-14
lines changed Original file line number Diff line number Diff line change 40
40
description = "Integration with https://github.com/cachix/git-hooks.nix" ;
41
41
} ;
42
42
43
- config = lib . mkIf ( ( lib . filterAttrs ( id : value : value . enable ) cfg . hooks ) != { } ) {
44
- ci = [ cfg . run ] ;
45
- # Add the packages for any enabled hooks at the end to avoid overriding the language-defined packages.
46
- packages = lib . mkAfter ( [ packageBin ] ++ ( cfg . enabledPackages or [ ] ) ) ;
47
- tasks = {
48
- # TODO: split installation script into status + exec
49
- "devenv:git-hooks:install" = {
50
- exec = cfg . installationScript ;
51
- before = [ "devenv:enterShell" ] ;
43
+ config = lib . mkMerge [
44
+ # Always run installation script to keep .pre-commit-config.yaml in sync
45
+ {
46
+ tasks = {
47
+ # TODO: split installation script into status + exec
48
+ "devenv:git-hooks:install" = {
49
+ exec = cfg . installationScript ;
50
+ before = [ "devenv:enterShell" ] ;
51
+ } ;
52
52
} ;
53
- "devenv:git-hooks:run" = {
54
- exec = "pre-commit run -a" ;
55
- before = [ "devenv:enterTest" ] ;
53
+ }
54
+ ( lib . mkIf ( ( lib . filterAttrs ( id : value : value . enable ) cfg . hooks ) != { } ) {
55
+ ci = [ cfg . run ] ;
56
+ # Add the packages for any enabled hooks at the end to avoid overriding the language-defined packages.
57
+ packages = lib . mkAfter ( [ packageBin ] ++ ( cfg . enabledPackages or [ ] ) ) ;
58
+ tasks = {
59
+ "devenv:git-hooks:run" = {
60
+ exec = "pre-commit run -a" ;
61
+ before = [ "devenv:enterTest" ] ;
62
+ } ;
56
63
} ;
57
- } ;
58
- } ;
64
+ } )
65
+ ] ;
66
+
59
67
}
You can’t perform that action at this time.
0 commit comments