Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .hooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cd $(git rev-parse --show-toplevel)
make lint
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-include setup

# Default platform commands
SHELL=/bin/bash
MKDIR := mkdir -p
Expand Down Expand Up @@ -356,7 +358,7 @@ lint-old: $(GOLANGCI_LINT) ## Fast lint including previous issues

FMT_PKG ?= cni cns npm

fmt format: $(GOFUMPT) ## run gofumpt on $FMT_PKG (default "cni cns npm")
fmt: $(GOFUMPT) ## run gofumpt on $FMT_PKG (default "cni cns npm")
$(GOFUMPT) -s -w $(FMT_PKG)

COVER_PKG ?= .
Expand All @@ -383,6 +385,16 @@ test-cyclonus:
kind:
kind create cluster --config ./test/kind/kind.yaml

##@ Utilities

$(REPO_ROOT)/.git/hooks/pre-push:
@ln -s $(REPO_ROOT)/.hooks/pre-push $(REPO_ROOT)/.git/hooks/
@echo installed pre-push hook

install-hooks: $(REPO_ROOT)/.git/hooks/pre-push ## installs git hooks

setup: install-hooks ## performs common required repo setup

version: ## prints the version
@echo $(VERSION)

Expand Down