<commit_before>APP_NAME=dalf/searxstats:latest
CONTAINER_NAME=searxstats
OUTPUT_FILENAME=instances.json

ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

DOCKER_INTERACTIVE_PARAM:=$(shell [ -t 0 ] && echo " -t -i")

qa:
	flake8 --max-line-length=120 searxstats tests
	pylint searxstats tests
	python -m pytest --cov-report html --cov=searxstats tests -vv

docker-build: # Build the container
	docker build -t $(APP_NAME) .

docker-run: # Run the container
	# instances.json
	mkdir -p $(ROOT_DIR)/html/data
	touch $(ROOT_DIR)/html/data/instances.json
	chgrp 1005 $(ROOT_DIR)/html/data/instances.json
	chmod 664 $(ROOT_DIR)/html/data/instances.json
	# cache
	mkdir -p $(ROOT_DIR)/cache
	chgrp 1005 $(ROOT_DIR)/cache
	chmod 775 $(ROOT_DIR)/cache
	# run
	docker run $(DOCKER_INTERACTIVE_PARAM) \
	    --rm \
	    --network host \
	    -v $(ROOT_DIR)/html/data:/usr/local/searxstats/html/data \
	    -v $(ROOT_DIR)/cache:/usr/local/searxstats/cache \
	    --name="$(CONTAINER_NAME)" \
	    $(APP_NAME) \
	    --cache /usr/local/searxstats/cache \
	    --output /usr/local/searxstats/html/data/$(OUTPUT_FILENAME) \
	    --all

webserver:
	cd $(ROOT_DIR)/html; python -m http.server 8888<commit_msg>Fix default port for searx-stats2<commit_after>APP_NAME=dalf/searxstats:latest
CONTAINER_NAME=searxstats
OUTPUT_FILENAME=instances.json

ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

DOCKER_INTERACTIVE_PARAM:=$(shell [ -t 0 ] && echo " -t -i")

qa:
	flake8 --max-line-length=120 searxstats tests
	pylint searxstats tests
	python -m pytest --cov-report html --cov=searxstats tests -vv

docker-build: # Build the container
	docker build -t $(APP_NAME) .

docker-run: # Run the container
	# instances.json
	mkdir -p $(ROOT_DIR)/html/data
	touch $(ROOT_DIR)/html/data/instances.json
	chgrp 1005 $(ROOT_DIR)/html/data/instances.json
	chmod 664 $(ROOT_DIR)/html/data/instances.json
	# cache
	mkdir -p $(ROOT_DIR)/cache
	chgrp 1005 $(ROOT_DIR)/cache
	chmod 775 $(ROOT_DIR)/cache
	# run
	docker run $(DOCKER_INTERACTIVE_PARAM) \
	    --rm \
	    --network host \
	    -v $(ROOT_DIR)/html/data:/usr/local/searxstats/html/data \
	    -v $(ROOT_DIR)/cache:/usr/local/searxstats/cache \
	    --name="$(CONTAINER_NAME)" \
	    $(APP_NAME) \
	    --cache /usr/local/searxstats/cache \
	    --output /usr/local/searxstats/html/data/$(OUTPUT_FILENAME) \
	    --all

webserver:
	cd $(ROOT_DIR)/html; python -m http.server 8889
{'fraction_non_alphanumeric': 0.1493453355155483, 'fraction_numerical': 0.019230769230769232, 'mean_word_length': 3.6132075471698113, 'pattern_counts': {'":': 0, '<': 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': '3411283', 'n_tokens_mistral': 991, 'n_tokens_neox': 924, 'n_words': 181}