<commit_before># set this to match the base package, ie "github.com/brianm/goskel"
# this autodetection might work for you, or might not
PACKAGE := $(shell git remote -v | grep push | grep origin \
			 | awk '{print $2}' | cut -d '@' -f 2 | tr ':' '/' \
			 | cut -f 1,2 -d '.')

WORKSPACE=$(PWD)/.workspace

# Change this to build your thing appropriately
# in this case it is building the "hello" binary
# yours will probably be different
build: workspace
	GOPATH=$(WORKSPACE) go get $(PACKAGE)/hello

# Run tests in root, and non {WORKSPACE .git} subdirs
# of the root
test: build
	@GOPATH=$(WORKSPACE) go test $(PACKAGE)
	@GOPATH=$(WORKSPACE) find . -d 1 -type d \
									 -not -name WORKSPACE \
									 -not -name .git \
		-exec go test $(PACKAGE)/{}  \;

# Run "go fmt" on likely packages
fmt: workspace
	@GOPATH=$(WORKSPACE) go fmt $(PACKAGE)
	@GOPATH=$(WORKSPACE) find . -d 1 -type d \
									 -not -name WORKSPACE \
									 -not -name .git \
		-exec go fmt $(PACKAGE)/{}  \;

$(WORKSPACE):
	$(eval WORK_BUILD := $(shell mktemp -d /tmp/goskel.XXX))
	mkdir -p $(WORK_BUILD)/src/$(PACKAGE)
	rm -r $(WORK_BUILD)/src/$(PACKAGE)
	cp -pr . $(WORK_BUILD)/src/$(PACKAGE)
	mv $(WORK_BUILD) $(WORKSPACE)
	GOPATH=$(WORKSPACE) go get $(PACKAGE)

# Build the Go workspace and symlink this project into
# it at the correct place.
workspace: $(WORKSPACE)

# Wipes out build artifacts
clean:
	rm -rf $(WORKSPACE)

# Wipes out the workspace
clean-workspace: clean
	rm -rf $(WORKSPACE)


# Display useful env vars which can be set to enter
# the workspace
env: workspace
	@echo "export GOPATH=$(WORKSPACE)"
	@echo "export PATH=$(WORKSPACE)/bin:$(PATH)"
	@echo "export WORKING_ON=$(PACKAGE)"
	@echo "export project=$(WORKSPACE)/src/$(PACKAGE)"<commit_msg>when running tests, ignore workspace dir correctly<commit_after># set this to match the base package, ie "github.com/brianm/goskel"
# this autodetection might work for you, or might not
PACKAGE := $(shell git remote -v | grep push | grep origin \
			 | awk '{print $2}' | cut -d '@' -f 2 | tr ':' '/' \
			 | cut -f 1,2 -d '.')

WORKSPACE=$(PWD)/.workspace

# Change this to build your thing appropriately
# in this case it is building the "hello" binary
# yours will probably be different
build: workspace
	GOPATH=$(WORKSPACE) go get $(PACKAGE)/hello

# Run tests in root, and non {WORKSPACE .git} subdirs
# of the root
test: build
	@GOPATH=$(WORKSPACE) go test $(PACKAGE)
	@GOPATH=$(WORKSPACE) find . -d 1 -type d \
									 -not -name $(shell basename $(WORKSPACE)) \
									 -not -name .git \
		-exec go test $(PACKAGE)/{}  \;

# Run "go fmt" on likely packages
fmt: workspace
	@GOPATH=$(WORKSPACE) go fmt $(PACKAGE)
	@GOPATH=$(WORKSPACE) find . -d 1 -type d \
									 -not -name $(shell basename $(WORKSPACE)) \
									 -not -name .git \
		-exec go fmt $(PACKAGE)/{}  \;

$(WORKSPACE):
	$(eval WORK_BUILD := $(shell mktemp -d /tmp/goskel.XXX))
	mkdir -p $(WORK_BUILD)/src/$(PACKAGE)
	rm -r $(WORK_BUILD)/src/$(PACKAGE)
	cp -pr . $(WORK_BUILD)/src/$(PACKAGE)
	mv $(WORK_BUILD) $(WORKSPACE)
	GOPATH=$(WORKSPACE) go get $(PACKAGE)

# Build the Go workspace and symlink this project into
# it at the correct place.
workspace: $(WORKSPACE)

# Wipes out build artifacts
clean:
	rm -rf $(WORKSPACE)

# Wipes out the workspace
clean-workspace: clean
	rm -rf $(WORKSPACE)


# Display useful env vars which can be set to enter
# the workspace
env: workspace
	@echo "export GOPATH=$(WORKSPACE)"
	@echo "export PATH=$(WORKSPACE)/bin:$(PATH)"
	@echo "export WORKING_ON=$(PACKAGE)"
	@echo "export project=$(WORKSPACE)/src/$(PACKAGE)"
{'fraction_non_alphanumeric': 0.15043259838124476, 'fraction_numerical': 0.0033491487580240022, 'mean_word_length': 3.4744069912609237, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '688495', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1233, 'n_words': 433}