mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-12-01 18:16:14 +02:00
5b36ee4c95
I've added the new local.mk to the package sources. While this should not be needed for the build, it is the simplest solution, and won't cause many extra rebuilds, because the file won't change very often.
15 lines
505 B
Makefile
15 lines
505 B
Makefile
|
|
.PHONY: format
|
|
print-top-help += echo ' format: Format source code'
|
|
|
|
# This uses the cached .pre-commit-hooks.yaml file
|
|
format:
|
|
@if ! type -p pre-commit &>/dev/null; then \
|
|
echo "make format: pre-commit not found. Please use \`nix develop\`."; \
|
|
exit 1; \
|
|
fi; \
|
|
if test -z "$$_NIX_PRE_COMMIT_HOOKS_CONFIG"; then \
|
|
echo "make format: _NIX_PRE_COMMIT_HOOKS_CONFIG not set. Please use \`nix develop\`."; \
|
|
exit 1; \
|
|
fi; \
|
|
pre-commit run --config $$_NIX_PRE_COMMIT_HOOKS_CONFIG --all-files
|