Commit 937229214a00

Vincent Demeester <vincent@sbr.pm>
2020-05-23 13:51:51
Makefile: use pre-commit target for pre-commit
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent c0ab62f
Changed files (2)
.githooks/pre-commit
@@ -1,5 +1,5 @@
 #!/bin/sh
 unset NIX_BUILD_SHELL
 export NIX_BUILD_SHELL
-nix-shell -p gnumake --run 'make update-docs'
+nix-shell -p gnumake --run 'make pre-commit'
 git add README.md docs
Makefile
@@ -52,13 +52,19 @@ nixos-dry-build: assets setup
 switch: assets setup
 	home-manager switch
 
+.PHONY: nixos-switch
 .PHONY: nixos-switch
 nixos-switch: assets setup
 	nixos-rebuild switch
 
+.PHONY: install-hooks
 install-hooks:
 	if [ -e .git ]; then nix-shell -p git --run 'git config core.hooksPath .githooks'; fi
 
+.PHONY: pre-commit
+pre-commit: README.md fmt update-docs
+
+.PHONY: fmt
 fmt:
 	nixpkgs-fmt *.nix lib machines modules overlays/*.nix overlays/emacs pkgs tmp tools
 
@@ -79,7 +85,7 @@ clean-www:
 
 # Documentation build and publishing
 .PHONY: update-docs
-update-docs: README.md
+update-docs:
 	@echo "Updating docs references…"
 	$(EMACS) --batch --directory $(DOTEMACS)/lisp/ \
 		--load lib/lisp/docs.el \