<commit_before>.PHONY: image test citest irb

DOCKER_RUN ?= docker run --rm
MONGODB_URI ?= mongodb://mongodb/minidoc_test

image:
	docker build -t codeclimate/minidoc .

test: image
	$(DOCKER_RUN) \
	  --env MONGODB_URI="$(MONGODB_URI)" \
	  --volume "$(PWD)":/app \
	  codeclimate/minidoc bundle exec rspec $(RSPEC_ARGS)

# Route named service hosts to the docker bridge
citest: DOCKER_BRIDGE_IP=$(shell ip addr show dev docker0 | sed '/^.*inet \(.*\)\/.*$$/!d; s//\1/')
citest:
	docker run \
	  --add-host mongodb:$(DOCKER_BRIDGE_IP) \
	  --env MONGODB_URI="$(MONGODB_URI)" \
	  --volume $(PWD):/app \
	  codeclimate/minidoc bundle exec rspec && ./cc-test-reporter after-build -p "/app"

irb: image
	$(DOCKER_RUN) -it \
	  --env MONGODB_URI="$(MONGODB_URI)" \
	  --volume "$(PWD)":/app \
	  codeclimate/minidoc irb -I lib -r minidoc
<commit_msg>be more explicit<commit_after>.PHONY: image test citest irb

DOCKER_RUN ?= docker run --rm
MONGODB_URI ?= mongodb://mongodb/minidoc_test

image:
	docker build -t codeclimate/minidoc .

test: image
	$(DOCKER_RUN) \
	  --env MONGODB_URI="$(MONGODB_URI)" \
	  --volume "$(PWD)":/app \
	  codeclimate/minidoc bundle exec rspec $(RSPEC_ARGS)

# Route named service hosts to the docker bridge
citest: DOCKER_BRIDGE_IP=$(shell ip addr show dev docker0 | sed '/^.*inet \(.*\)\/.*$$/!d; s//\1/')
citest:
	docker run \
	  --add-host mongodb:$(DOCKER_BRIDGE_IP) \
	  --env MONGODB_URI="$(MONGODB_URI)" \
	  --volume $(PWD):/app \
	  codeclimate/minidoc bundle exec rspec && ./cc-test-reporter after-build --prefix "/app"

irb: image
	$(DOCKER_RUN) -it \
	  --env MONGODB_URI="$(MONGODB_URI)" \
	  --volume "$(PWD)":/app \
	  codeclimate/minidoc irb -I lib -r minidoc

{'fraction_non_alphanumeric': 0.17204932472108045, 'fraction_numerical': 0.002348796241926013, 'mean_word_length': 3.303030303030303, 'pattern_counts': {'":': 4, '<': 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': '4677166', 'n_tokens_mistral': 745, 'n_tokens_neox': 696, 'n_words': 158}