.PHONY: check test test-runflake8 test-pytest codecov \
	lint flake8 mypy \
	isortify blacken \
	build publish

check: test lint

test: test-runflake8 test-pytest


test-runflake8:
	tests/run_flake8/Run.sh

test-pytest:
	coverage erase
	coverage run -m unittest discover -v  # tests/test_*.py
	coverage xml

codecov:
	codecov


lint: mypy flake8

flake8:
	flake8 --version
	flake8 .

isortify:
	isort .

blacken:
	black .

mypy:
	# Temporarily check only package directory
	mypy --strict flake8_no_implicit_concat/



build:
	python -m build

# https://test.pypi.org/project/flake8-no-implicit-concat
publish_repository ?= testpypi  # Set to pypi to publish as production
publish: build
	twine upload --skip-existing --verbose --repository $(publish_repository) dist/*
