<commit_before>FULLERITE      := fullerite
BEATIT         := beatit
VERSION        := 0.1.15
SRCDIR         := src
HANDLER_DIR    := $(SRCDIR)/fullerite/handler
PROTO_SFX      := $(HANDLER_DIR)/signalfx.proto
GEN_PROTO_SFX  := $(HANDLER_DIR)/signalfx.pb.go
PKGS           := \
	$(BEATIT) \
	$(FULLERITE) \
	$(FULLERITE)/collector \
	$(FULLERITE)/config \
	$(FULLERITE)/handler \
	$(FULLERITE)/internalserver\
	$(FULLERITE)/metric

GO_VERSION     := $(shell go version | grep -Po '\bgo[\d\.]+\b')
SOURCES        := $(foreach pkg, $(PKGS), $(wildcard $(SRCDIR)/$(pkg)/*.go))
SOURCES        := $(filter-out $(GEN_PROTO_SFX), $(SOURCES))
OS	       := $(shell /usr/bin/lsb_release -si 2> /dev/null)

space :=
space +=
comma := ,

# symlinks confuse go tools, let's not mess with it and use -L
GOPATH  := $(shell pwd -L)
export GOPATH

PATH := bin:$(PATH)
export PATH

all: clean fmt lint $(FULLERITE) $(BEATIT) test

.PHONY: clean
clean:
	@echo Cleaning $(FULLERITE)...
	@rm -f $(FULLERITE) bin/$(FULLERITE)
	@rm -f $(BEATIT) bin/$(BEATIT)
	@rm -rf pkg/*/$(FULLERITE)
	@rm -rf build fullerite*.deb fullerite*.rpm
# Let's keep the generated file in the repo for ease of development.
#	@rm -f $(GEN_PROTO_SFX)

deps:
	@echo Getting dependencies...
	@$(foreach pkg, $(PKGS), go get -t $(pkg);)

$(FULLERITE): $(SOURCES) deps
	@echo Building $(FULLERITE)...
	@go build -o bin/$(FULLERITE) $@

$(BEATIT): $(BEATIT_SOURCES)
	@echo Building $(BEATIT)...
	@go build -o bin/$(BEATIT) $@

test: tests
tests: deps
	@echo Testing $(FULLERITE)
	@echo Creating virtualenv
	@$(curl -L https://raw.github.com/DamnWidget/VenGO/master/install.sh | bash)
	@$(source $(HOME)/.VenGO/bin/vengo)
	@echo Installing test dependencies
	@$(vengo mkenv -g $(GO_VERSION) temp)
	@$(vengo activate temp)
	@go get golang.org/x/tools/cmd/cover
	@echo Running tests
	@$(foreach pkg, $(PKGS), go test -cover $(pkg);)
	@echo Removing vengo installation
	@$(deactivate)
	@rm -rf $(HOME)/.VenGO/

coverage_report: deps<commit_msg>Use Vengo to get the dependency<commit_after>FULLERITE      := fullerite
BEATIT         := beatit
VERSION        := 0.1.15
SRCDIR         := src
HANDLER_DIR    := $(SRCDIR)/fullerite/handler
PROTO_SFX      := $(HANDLER_DIR)/signalfx.proto
GEN_PROTO_SFX  := $(HANDLER_DIR)/signalfx.pb.go
PKGS           := \
	$(BEATIT) \
	$(FULLERITE) \
	$(FULLERITE)/collector \
	$(FULLERITE)/config \
	$(FULLERITE)/handler \
	$(FULLERITE)/internalserver\
	$(FULLERITE)/metric

GO_VERSION     := $(shell go version | grep -Po '\bgo[\d\.]+\b')
SOURCES        := $(foreach pkg, $(PKGS), $(wildcard $(SRCDIR)/$(pkg)/*.go))
SOURCES        := $(filter-out $(GEN_PROTO_SFX), $(SOURCES))
OS	       := $(shell /usr/bin/lsb_release -si 2> /dev/null)

space :=
space +=
comma := ,

# symlinks confuse go tools, let's not mess with it and use -L
GOPATH  := $(shell pwd -L)
export GOPATH

PATH := bin:$(PATH)
export PATH

all: clean fmt lint $(FULLERITE) $(BEATIT) test

.PHONY: clean
clean:
	@echo Cleaning $(FULLERITE)...
	@rm -f $(FULLERITE) bin/$(FULLERITE)
	@rm -f $(BEATIT) bin/$(BEATIT)
	@rm -rf pkg/*/$(FULLERITE)
	@rm -rf build fullerite*.deb fullerite*.rpm
# Let's keep the generated file in the repo for ease of development.
#	@rm -f $(GEN_PROTO_SFX)

deps:
	@echo Getting dependencies...
	@$(foreach pkg, $(PKGS), go get -t $(pkg);)

$(FULLERITE): $(SOURCES) deps
	@echo Building $(FULLERITE)...
	@go build -o bin/$(FULLERITE) $@

$(BEATIT): $(BEATIT_SOURCES)
	@echo Building $(BEATIT)...
	@go build -o bin/$(BEATIT) $@

test: tests
tests: deps
	@echo Testing $(FULLERITE)
	@echo Creating virtualenv
	@$(curl -L https://raw.github.com/DamnWidget/VenGO/master/install.sh | bash)
	@$(source $(HOME)/.VenGO/bin/vengo)
	@$(vengo mkenv -g $(GO_VERSION) temp)
	@$(vengo activate temp)
	@echo Installing test dependencies
	@$(vengo get golang.org/x/tools/cmd/cover)
	@echo Running tests
	@$(foreach pkg, $(PKGS), go test -cover $(pkg);)
	@echo Removing vengo installation
	@$(deactivate)
	@rm -rf $(HOME)/.VenGO/

coverage_report: deps
{'fraction_non_alphanumeric': 0.1813406703351676, 'fraction_numerical': 0.0025012506253126563, 'mean_word_length': 3.5755148741418763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '2778092', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1537, 'n_words': 394}