<commit_before>.PHONY=fmt
BINARY_NAME=water
GOPATH := $(shell go env GOPATH)
GOBIN ?= $(GOPATH)/bin
INSTALL_DIR=~/.local/bin
BUILD_DIR=./build

GOLANGCILINT := $(GOBIN)/golangci-lint
$(GOLANGCILINT):
	curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.50.0

RICHGO := $(GOBIN)/richgo
$(RICHGO):
	@go install github.com/kyoh86/richgo@v0.3.6

GOSEC := $(GOBIN)/gosec
$(GOSEC):
	curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v2.13.1

fmt:
	@goimports -w .
	@gofmt -w .

lint: $(GOLANGCILINT)
	@golangci-lint run

test: $(RICHGO)
	@$(RICHGO) test -v ./...

security: $(GOSEC)
	@gosec -quiet ./...

check: fmt lint test security

build:
	mkdir -p $(BUILD_DIR)
	go build -o $(BUILD_DIR)/$(BINARY_NAME) main.go

install:
	test -f $(BUILD_DIR)/$(BINARY_NAME)
	mkdir -p $(INSTALL_DIR)
	cp $(BUILD_DIR)/$(BINARY_NAME) $(INSTALL_DIR)

uninstall:
	rm $(INSTALL_DIR)/$(BINARY_NAME)

clean:
	@rm -rf $(BUILD_DIR)<commit_msg>✅ Add gofumpt and gocritic<commit_after>.PHONY=fmt
BINARY_NAME=water
GOPATH := $(shell go env GOPATH)
GOBIN ?= $(GOPATH)/bin
INSTALL_DIR=~/.local/bin
BUILD_DIR=./build

GO := $(shell command -v go 2> /dev/null)

GOLANGCILINT := $(GOBIN)/golangci-lint
$(GOLANGCILINT):
	curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.50.0

RICHGO := $(GOBIN)/richgo
$(RICHGO):
	@go install github.com/kyoh86/richgo@v0.3.6

GOSEC := $(GOBIN)/gosec
$(GOSEC):
	curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v2.13.1

GOFUMPT := $(GOBIN)/gofumpt
$(GOFUMPT):
	$(GO) install mvdan.cc/gofumpt@v0.1.1

GOCRITIC := $(GOBIN)/gocritic
$(GOCRITIC):
	$(GO) install github.com/go-critic/go-critic/cmd/gocritic@v0.6.5

fmt: $(GOFUMPT) $(GOCRITIC)
	$(GO) fmt ./...
	goimports -w .
	$(GOFUMPT) -s -w .
	$(GOCRITIC) check ./...


lint: $(GOLANGCILINT)
	golangci-lint run

test: $(RICHGO)
	@$(RICHGO) test -v ./...

security: $(GOSEC)
	gosec -quiet ./...

check: fmt test lint security

build:
	mkdir -p $(BUILD_DIR)
	go build -o $(BUILD_DIR)/$(BINARY_NAME) main.go

install:
	test -f $(BUILD_DIR)/$(BINARY_NAME)
	mkdir -p $(INSTALL_DIR)
	cp $(BUILD_DIR)/$(BINARY_NAME) $(INSTALL_DIR)

uninstall:
	rm $(INSTALL_DIR)/$(BINARY_NAME)

clean:
	@rm -rf $(BUILD_DIR)
{'fraction_non_alphanumeric': 0.19237079573420837, 'fraction_numerical': 0.013535684987694831, 'mean_word_length': 3.9272727272727272, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1124850', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1071, 'n_words': 217}