<commit_before>.PHONY: all

LIBCOMPOSE_ENVS := \
	-e DOCKER_TEST_HOST \
	-e TESTFLAGS

BIND_DIR := "dist"
LIBKERMIT_MOUNT := -v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/vdemeester/libkermit/$(BIND_DIR)"

GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
LIBKERMIT_DEV_IMAGE := libkermit-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
REPONAME := $(shell echo $(REPO) | tr '[:upper:]' '[:lower:]')
INTEGRATION_OPTS := $(if $(MAKE_DOCKER_HOST),-e "DOCKER_HOST=$(MAKE_DOCKER_HOST)", -v "/var/run/docker.sock:/var/run/docker.sock")

DOCKER_RUN_LIBKERMIT := docker run $(if $(CIRCLECI),,--rm) $(INTEGRATION_OPTS) -it $(LIBKERMIT_ENVS) $(LIBKERMIT_MOUNT) "$(LIBKERMIT_DEV_IMAGE)"

default: all

all: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh

test: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh test-unit test-integration

test-integration: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh test-integration

test-unit: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh test-unit

validate: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh validate-gofmt validate-govet validate-golint

validate-gofmt: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh validate-gofmt

validate-govet: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh validate-govet

validate-golint: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh validate-golint

build: dist
	docker build -t "$(LIBKERMIT_DEV_IMAGE)" .

shell: build
	$(DOCKER_RUN_LIBKERMIT) /bin/bash<commit_msg>Update Makefile to have simple target for fmt and lint<commit_after>.PHONY: all

LIBCOMPOSE_ENVS := \
	-e DOCKER_TEST_HOST \
	-e TESTFLAGS

BIND_DIR := "dist"
LIBKERMIT_MOUNT := -v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/vdemeester/libkermit/$(BIND_DIR)"

GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
LIBKERMIT_DEV_IMAGE := libkermit-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
REPONAME := $(shell echo $(REPO) | tr '[:upper:]' '[:lower:]')
INTEGRATION_OPTS := $(if $(MAKE_DOCKER_HOST),-e "DOCKER_HOST=$(MAKE_DOCKER_HOST)", -v "/var/run/docker.sock:/var/run/docker.sock")

DOCKER_RUN_LIBKERMIT := docker run $(if $(CIRCLECI),,--rm) $(INTEGRATION_OPTS) -it $(LIBKERMIT_ENVS) $(LIBKERMIT_MOUNT) "$(LIBKERMIT_DEV_IMAGE)"

default: all

all: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh

test: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh test-unit test-integration

test-integration: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh test-integration

test-unit: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh test-unit

validate: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh validate-gofmt validate-govet validate-golint

validate-gofmt: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh validate-gofmt

validate-govet: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh validate-govet

validate-golint: build
	$(DOCKER_RUN_LIBKERMIT) ./hack/make.sh validate-golint

lint:
	./hack/make.sh validate-golint

fmt:
	./hack/make.sh validate-gofmt

build: dist
	docker build -t "$(LIBKERMIT_DEV_IMAGE)" .

shell: build
	$(DOCKER_RUN_LIBKERMIT) /bin/bash
{'fraction_non_alphanumeric': 0.16136591898225644, 'fraction_numerical': 0.0006695681285570807, 'mean_word_length': 5.30379746835443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4677258', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1278, 'n_words': 212}