<commit_before>
#
## `protolint`: Makefile
#

# required tools: python, virtualenv

# - Config
VERBOSE ?= no
ENV ?= .env
BIN ?= $(ENV)/bin/
BUILD_TARGETS ?= build build_py build_scripts
RELEASE_TARGETS ?= sdist bdist bdist_dumb

DOCKER_TAG ?= latest
DOCKER_BUILD_ARGS ?= --rm --pull --tag

TARGET ?= build
DIST ?= dist

# - Tools
PROTOC ?= $(shell which protoc)
PROTOC_GEN_LINT ?= $(shell which protoc-gen-lint)

ifeq ($(VERBOSE),yes)
RM_FLAGS = -frv
CP_FLAGS = -frv
else
RM_FLAGS = -fr
CP_FLAGS = -fr
endif

define say
	@echo $1
endef


all: clean $(TARGET) link test release image
	$(call say,"'protolint' is ready.")

clean:
	$(call say,"Cleaning 'protolint' build targets...")
	@rm $(RM_FLAGS) $(TARGET) $(DIST) .coverage

	$(call say,"Cleaning ephemeral files...")
	@find . -name .DS_Store -delete
	@find . -name *.pyc -delete
	@find . -name *.pyo -delete

distclean: clean
	$(call say,"Resetting 'protolint'...")
	@rm $(RM_FLAGS) $(ENV)

forceclean: distclean
	$(call say,"Sanitizing 'protolint'...")
	@git reset --hard
	@git clean -xdf

$(TARGET): environment dependencies
	$(call say,"Building 'protolint'...")
	@python setup.py $(BUILD_TARGETS)

test:
	$(call say,"Running 'protolint' testsuite...")
	@mkdir -p $(ENV)/coverage $(ENV)/tests
	@$(BIN)/nosetests --with-coverage --cover-erase --cover-package=protolint --with-xunit --xunit-file=$(ENV)/tests/tests.xml --cover-xml --cover-xml-file=$(ENV)/coverage/coverage.xml

release: $(DIST)
$(DIST):
	$(call say,"Cutting 'protolint' release...")
	@python setup.py $(RELEASE_TARGETS)

image:
	$(call say,"Building 'protolint' image...")
	@docker build $(DOCKER_BUILD_ARGS) protolint:$(DOCKER_TAG) .

link:
	$(call say,"Resolving tools...")
	@-ln -s $(PROTOC) .env/bin/protoc
	@-ln -s $(PROTOC_GEN_LINT) .env/bin/protoc-gen-lint


## -- Tasks

dependencies:
	$(call say,"Installing dependencies for 'protolint'...")
	@$(BIN)easy_install pip
	@$(BIN)pip install -r requirements.txt --upgrade

environment: $(ENV)

$(ENV):
	$(call say,"Setting up virtualenv...")
	@mkdir $(ENV)
	@virtualenv --prompt="[protolint]: " $(ENV)


.PHONY: all clean distclean forceclean test link
<commit_msg>Add docker repo to build command<commit_after>
#
## `protolint`: Makefile
#

# required tools: python, virtualenv

# - Config
VERBOSE ?= no
ENV ?= .env
BIN ?= $(ENV)/bin/
BUILD_TARGETS ?= build build_py build_scripts
RELEASE_TARGETS ?= sdist bdist bdist_dumb

DOCKER_TAG ?= latest
DOCKER_BUILD_ARGS ?= --rm --pull --tag

TARGET ?= build
DIST ?= dist

# - Tools
PROTOC ?= $(shell which protoc)
PROTOC_GEN_LINT ?= $(shell which protoc-gen-lint)

ifeq ($(VERBOSE),yes)
RM_FLAGS = -frv
CP_FLAGS = -frv
else
RM_FLAGS = -fr
CP_FLAGS = -fr
endif

define say
	@echo $1
endef


all: clean $(TARGET) link test release image
	$(call say,"'protolint' is ready.")

clean:
	$(call say,"Cleaning 'protolint' build targets...")
	@rm $(RM_FLAGS) $(TARGET) $(DIST) .coverage

	$(call say,"Cleaning ephemeral files...")
	@find . -name .DS_Store -delete
	@find . -name *.pyc -delete
	@find . -name *.pyo -delete

distclean: clean
	$(call say,"Resetting 'protolint'...")
	@rm $(RM_FLAGS) $(ENV)

forceclean: distclean
	$(call say,"Sanitizing 'protolint'...")
	@git reset --hard
	@git clean -xdf

$(TARGET): environment dependencies
	$(call say,"Building 'protolint'...")
	@python setup.py $(BUILD_TARGETS)

test:
	$(call say,"Running 'protolint' testsuite...")
	@mkdir -p $(ENV)/coverage $(ENV)/tests
	@$(BIN)/nosetests --with-coverage --cover-erase --cover-package=protolint --with-xunit --xunit-file=$(ENV)/tests/tests.xml --cover-xml --cover-xml-file=$(ENV)/coverage/coverage.xml

release: $(DIST)
$(DIST):
	$(call say,"Cutting 'protolint' release...")
	@python setup.py $(RELEASE_TARGETS)

image:
	$(call say,"Building 'protolint' image...")
	@docker build $(DOCKER_BUILD_ARGS) sgammon/protolint:$(DOCKER_TAG) .

link:
	$(call say,"Resolving tools...")
	@-ln -s $(PROTOC) .env/bin/protoc
	@-ln -s $(PROTOC_GEN_LINT) .env/bin/protoc-gen-lint


## -- Tasks

dependencies:
	$(call say,"Installing dependencies for 'protolint'...")
	@$(BIN)easy_install pip
	@$(BIN)pip install -r requirements.txt --upgrade

environment: $(ENV)

$(ENV):
	$(call say,"Setting up virtualenv...")
	@mkdir $(ENV)
	@virtualenv --prompt="[protolint]: " $(ENV)


.PHONY: all clean distclean forceclean test link

{'fraction_non_alphanumeric': 0.18365451590434176, 'fraction_numerical': 0.0004643603436266543, 'mean_word_length': 4.159281437125749, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '3118055', 'n_tokens_mistral': 1662, 'n_tokens_neox': 1611, 'n_words': 415}