-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the module system, delegate activation to project.nix core
New - Selectively enable tools (#2) - Make choice of tool versions overridable - User-definable hooks - Input validation at the Nix level Fixes - Stop installing files all over the place when doing nix-shell ../some-project to borrow a tool - Lorri support Cleanup - Get rid of installation code
- Loading branch information
Showing
6 changed files
with
488 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
repos: | ||
- repo: .pre-commit-hooks/ | ||
rev: master | ||
hooks: | ||
- id: shellcheck | ||
- id: canonix | ||
# DO NOT MODIFY | ||
# This file was generated by project.nix | ||
{ | ||
"repos": [ | ||
{ | ||
"hooks": [ | ||
{ | ||
"id": "canonix" | ||
}, | ||
{ | ||
"id": "shellcheck" | ||
} | ||
], | ||
"repo": ".pre-commit-hooks/", | ||
"rev": "master" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ config, lib, pkgs, ... }: | ||
let | ||
inherit (config.pre-commit) tools; | ||
in { | ||
config.pre-commit.hooks = | ||
{ | ||
hlint = | ||
{ | ||
name = "hlint"; | ||
description = | ||
"HLint gives suggestions on how to improve your source code."; | ||
entry = "${tools.hlint}/bin/hlint"; | ||
files = "\\.l?hs$"; | ||
}; | ||
ormolu = | ||
{ | ||
name = "ormolu"; | ||
description = "Haskell code prettifier."; | ||
entry = "${tools.ormolu}/bin/ormolu --mode inplace"; | ||
files = "\\.l?hs$"; | ||
}; | ||
hindent = | ||
{ | ||
name = "hindent"; | ||
description = "Haskell code prettifier."; | ||
entry = "${tools.hindent}/bin/hindent"; | ||
files = "\\.l?hs$"; | ||
}; | ||
cabal-fmt = | ||
{ | ||
name = "cabal-fmt"; | ||
description = "Format Cabal files"; | ||
entry = "${tools.cabal-fmt}/bin/cabal-fmt --inplace"; | ||
files = "\\.cabal$"; | ||
}; | ||
canonix = | ||
{ | ||
name = "canonix"; | ||
description = "Nix code prettifier."; | ||
entry = "${tools.canonix}/bin/canonix"; | ||
files = "\\.nix$"; | ||
}; | ||
nixfmt = | ||
{ | ||
name = "nixfmt"; | ||
description = "Nix code prettifier."; | ||
entry = "${tools.nixfmt}/bin/nixfmt"; | ||
files = "\\.nix$"; | ||
}; | ||
nixpkgs-fmt = | ||
{ | ||
name = "nixpkgs-fmt"; | ||
description = "Nix code prettifier."; | ||
entry = "${tools.nixpkgs-fmt}/bin/nixpkgs-fmt -i"; | ||
files = "\\.nix$"; | ||
}; | ||
elm-format = | ||
{ | ||
name = "elm-format"; | ||
description = "Format Elm files"; | ||
entry = | ||
"${tools.elm-format}/bin/elm-format --yes --elm-version=0.19"; | ||
files = "\\.elm$"; | ||
}; | ||
shellcheck = | ||
{ | ||
name = "shellcheck"; | ||
description = "Format shell files"; | ||
types = | ||
[ | ||
"bash" | ||
]; | ||
entry = "${tools.shellcheck}/bin/shellcheck"; | ||
}; | ||
terraform-format = | ||
{ | ||
name = "terraform-format"; | ||
description = "Format terraform (.tf) files"; | ||
entry = "${tools.terraform-fmt}/bin/terraform-fmt"; | ||
files = "\\.tf$"; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.