Skip to content

Commit

Permalink
chore(configs.lefthook): pre-commits-hook -> git-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Apr 27, 2024
1 parent 3630302 commit a8fac43
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 72 deletions.
2 changes: 1 addition & 1 deletion local/cells/dev/pops.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ in
configs = inputs.omnibus.pops.configs {
inputs = {
inputs = {
inherit (inputs') nixfmt nur pre-commit-hooks;
inherit (inputs') nixfmt git-hooks;
inherit (inputs) std;
inherit nixpkgs;
};
Expand Down
108 changes: 54 additions & 54 deletions local/lock/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions local/lock/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
nixago.inputs.nixpkgs.follows = "nixpkgs";
nixago.inputs.nixago-exts.follows = "";

pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
pre-commit-hooks.inputs.flake-utils.follows = "flake-utils";
pre-commit-hooks.inputs.flake-compat.follows = "";
git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
git-hooks.inputs.flake-utils.follows = "flake-utils";
git-hooks.inputs.flake-compat.follows = "";

fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
Expand Down
1 change: 1 addition & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default.extend-ignore-re = ["(?Rm)^.*#\\s*spellchecker:disable-line$"]
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ let
inherit
(omnibus.errors.requiredInputsLazily inputs "omnibus.pops.configs" [
"nixpkgs"
"pre-commit-hooks"
"git-hooks"
])
nixpkgs
pre-commit-hooks
git-hooks
;
inherit (nixpkgs) lib;
builtinStuff = {
tools = pre-commit-hooks.packages;
tools = git-hooks.packages;
};
gitignore-nix-src = pre-commit-hooks.inputs.gitignore;
gitignore-nix-src = git-hooks.inputs.gitignore;
in
{
src,
Expand All @@ -30,7 +30,7 @@ in
let
project = lib.evalModules {
modules = [
(pre-commit-hooks + /modules/all-modules.nix)
(git-hooks + /modules/all-modules.nix)
{
config =
{
Expand Down
16 changes: 8 additions & 8 deletions units/configs/lefthook.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ let
(omnibus.errors.requiredInputsLazily inputs "omnibus.pops.configs" [
"nixpkgs"
"nur"
"pre-commit-hooks"
"git-hooks"
])
nixpkgs
nur
pre-commit-hooks
git-hooks
;
languagetool-code-comments =
(nixpkgs.extend nur.overlay)
.nur.repos.dustinblackman.languagetool-code-comments;

hooksFn =
cfg:
(super.pre-commit-hooks {
(super.git-hooks {
src = ./.;
settings = cfg;
}).hooks;
in
{
pre-commit-hooks = {
git-hooks = {
__functor = _: settings: hooksFn settings;
typos =
(hooksFn {
Expand All @@ -46,8 +46,8 @@ in
default = {
packages =
[ nixpkgs.jq ]
++ (map (x: pre-commit-hooks.packages.${x}) (
lib.attrNames (removeAttrs self.pre-commit-hooks [ "__functor" ])
++ (map (x: git-hooks.packages.${x}) (
lib.attrNames (removeAttrs self.git-hooks [ "__functor" ])
));
data = {
commit-msg = {
Expand All @@ -70,15 +70,15 @@ in
run = "${
(nixpkgs.hunspellWithDicts [ nixpkgs.hunspellDicts.en-us ])
}/bin/hunspell -l {staged_files}";
glob = "*.{txt,md,html,xml,rst,tex,odf,org}";
glob = "*.{txt,md,html,xml,rst,tex,odf,org}"; # spellchecker:disable-line
skip = [
"merge"
"rebase"
];
};
typos = {
# run = "typos --format brief {staged_files}";
run = self.pre-commit-hooks.typos.entry + " {staged_files}";
run = self.git-hooks.typos.entry + " {staged_files}";
skip = [
"merge"
"rebase"
Expand Down

0 comments on commit a8fac43

Please sign in to comment.