feat: initial version

This commit is contained in:
2025-12-03 14:17:51 +02:00
commit d27cefcfd4
14 changed files with 1510 additions and 0 deletions

45
Makefile Normal file
View File

@@ -0,0 +1,45 @@
all: run
.PHONY: build
build:
go build
.PHONY: run
run: build
./watchr
.PHONY: test
test:
go test -v ./...
.PHONY: install
install: build
cp watchr ~/.local/bin
.PHONY: uninstall
uninstall:
rm -f ~/.local/bin/watchr
.PHONY: precommit-install
precommit-install:
@echo "Installing pre-commit hooks..."
@echo "#!/bin/sh\n\nmake precommit" > .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "Pre-commit hooks installed."
.PHONY: precommit
precommit:
@STAGED_FILES=$$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.go$$'); \
if [ -z "$$STAGED_FILES" ]; then \
echo "No staged Go files to check."; \
else \
echo "Running pre-commit checks..."; \
echo "go fmt"; \
go fmt ./...; \
echo "go vet"; \
go vet ./...; \
echo "golangci-lint"; \
golangci-lint run ./...; \
echo "go test"; \
go test -v ./...; \
fi