feat: replace githooks with lefthook
This commit is contained in:
3
template/.gitignore
vendored
3
template/.gitignore
vendored
@@ -1,8 +1,9 @@
|
||||
.direnv/
|
||||
.pre-commit-config.yaml
|
||||
lefthook.yml
|
||||
|
||||
bazel-*
|
||||
build/
|
||||
dist/
|
||||
|
||||
node_modules/
|
||||
node_modules/
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
};
|
||||
|
||||
formatting = {
|
||||
# nixfmt is enabled by default and wired into lefthook.
|
||||
programs = {
|
||||
# shfmt.enable = true;
|
||||
# gofmt.enable = true;
|
||||
@@ -50,14 +51,31 @@
|
||||
};
|
||||
};
|
||||
|
||||
checks.tests = {
|
||||
command = "echo 'No tests defined yet.'";
|
||||
stage = "pre-push";
|
||||
passFilenames = false;
|
||||
# These checks become lefthook commands in the generated `lefthook.yml`.
|
||||
# repo-lib runs `pre-commit` and `pre-push` hook commands in parallel.
|
||||
checks = {
|
||||
tests = {
|
||||
command = "echo 'No tests defined yet.'";
|
||||
stage = "pre-push";
|
||||
passFilenames = false;
|
||||
};
|
||||
|
||||
# fmt = {
|
||||
# command = "nix fmt";
|
||||
# stage = "pre-commit";
|
||||
# passFilenames = false;
|
||||
# };
|
||||
};
|
||||
|
||||
# repo-lib also installs built-in hooks for:
|
||||
# - treefmt / nixfmt on `pre-commit`
|
||||
# - gitleaks on `pre-commit`
|
||||
# - gitlint on `commit-msg`
|
||||
|
||||
# release = null;
|
||||
release = {
|
||||
steps = [
|
||||
# Write a generated version file during release.
|
||||
# {
|
||||
# writeFile = {
|
||||
# path = "src/version.ts";
|
||||
@@ -66,6 +84,8 @@
|
||||
# '';
|
||||
# };
|
||||
# }
|
||||
|
||||
# Replace a version string while preserving surrounding captures.
|
||||
# {
|
||||
# replace = {
|
||||
# path = "README.md";
|
||||
@@ -73,6 +93,16 @@
|
||||
# replacement = ''\1$FULL_VERSION\2'';
|
||||
# };
|
||||
# }
|
||||
|
||||
# Run any extra release step with declared runtime inputs.
|
||||
# {
|
||||
# run = {
|
||||
# runtimeInputs = [ pkgs.git ];
|
||||
# script = ''
|
||||
# git status --short
|
||||
# '';
|
||||
# };
|
||||
# }
|
||||
];
|
||||
};
|
||||
};
|
||||
@@ -113,9 +143,16 @@
|
||||
];
|
||||
|
||||
# checks.lint = {
|
||||
# command = "go test ./...";
|
||||
# command = "bun test";
|
||||
# stage = "pre-push";
|
||||
# runtimeInputs = [ pkgs.go ];
|
||||
# passFilenames = false;
|
||||
# runtimeInputs = [ pkgs.bun ];
|
||||
# };
|
||||
|
||||
# checks.generated = {
|
||||
# command = "git diff --exit-code";
|
||||
# stage = "pre-commit";
|
||||
# passFilenames = false;
|
||||
# };
|
||||
|
||||
# packages.my-tool = pkgs.writeShellApplication {
|
||||
|
||||
Reference in New Issue
Block a user