#!/bin/sh
set -e
set -x


lint() {
	uv run flake8 --select=C,F,E101,E112,E502,E72,E73,E74,E9,W291,W6,EZL --exclude=.cache,.venv,playground.py,async_playground.py
}


case $# in
	0)
		lint
		uv run pytest
		;;
	1)
		case $1 in
			'--lint')
				lint
				;;
			*)
				printf 'Incorrect arg: %s' $1 >&2
				exit 2
				;;
		esac
		;;
	*)
		echo 'Incorrect count of args' >&2
		exit 2
		;;
esac
