<commit_before>TARGET=elephant
.PHONY: test db.migrate db.seed db.schema

default: help

help: ## Show this help
	@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrepep | sed -Ee 's/([a-z.]*):[^#]*##(.*)/\1##\2/' | sort | column -t -s "##"

ifeq ($(TRAVIS_OS_NAME),osx)
test: development.setup lint
	cd "OS X development" && xctool -workspace Elephant.xcworkspace -scheme Elephant test
else ifndef CONTAINERIZED
test: development.setup ## Run the unit tests in a Docker container against a Docker based database
	$(info running unit test containertainers)
	@docker-compose build test
	@docker-compose run test
else
test: lint ## (with "CONTAINERIZED=true") Run the unit tests directly
	swift build
endif

db.migrate: ## Migrate the database
	$(info migrating the database)
	sleep 5 ## give time for postgres to start up
	psql $(DB_NAME) < Tests/db/migrate.sql

db.seed: ## Seed the database
	$(info seeding the database)
	psql $(DB_NAME) < Tests/db/seed.sql

db.enter_console:
	psql $(DB_NAME)

lint:

development.setup:
	@docker-compose up postgres
	@docker-compose run migrate<commit_msg>Make test environment the same on any OSX machine<commit_after>TARGET=elephant
UNAME := $(shell uname)
.PHONY: test db.migrate db.seed db.schema

default: help

help: ## Show this help
	@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrepep | sed -Ee 's/([a-z.]*):[^#]*##(.*)/\1##\2/' | sort | column -t -s "##"

ifeq ($(UNAME),Darwin)
test: development.setup lint
	cd "OS X development" && xctool -workspace Elephant.xcworkspace -scheme Elephant test
else ifndef CONTAINERIZED
test: development.setup ## Run the unit tests in a Docker container against a Docker based database
	$(info running unit test containertainers)
	@docker-compose build test
	@docker-compose run test
else
test: lint ## (with "CONTAINERIZED=true") Run the unit tests directly
	swift build
endif

db.migrate: ## Migrate the database
	$(info migrating the database)
	sleep 5 ## give time for postgres to start up
	psql $(DB_NAME) < Tests/db/migrate.sql

db.seed: ## Seed the database
	$(info seeding the database)
	psql $(DB_NAME) < Tests/db/seed.sql

db.enter_console:
	psql $(DB_NAME)

lint:

development.setup:
	@docker-compose stop postgres &> /dev/null
	@docker-compose rm -v --force postgres test &> /dev/null
	@docker-compose up -d postgres
	@docker-compose run migrate
{'fraction_non_alphanumeric': 0.1274131274131274, 'fraction_numerical': 0.002574002574002574, 'mean_word_length': 4.410672853828307, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5943326', 'n_tokens_mistral': 848, 'n_tokens_neox': 812, 'n_words': 270}