# Every tracked file (not symlink) that starts with a bash or sh shebang (\043 is "#", which
# make would otherwise read as the start of a comment)
SCRIPTS := $(shell git ls-files -s | awk '$$1 != 120000 { print $$4 }' | xargs awk 'FNR == 1 && /^#!.*[\/ ](ba)?sh/ { print FILENAME }')

.PHONY: check lint smoketest

check: lint smoketest

# Errors and warnings only; drop --severity to see style notes too
lint:
	shellcheck -x --severity=warning $(SCRIPTS) smoketest/scenarios/*.sh
	python3 -m py_compile configure.d/lib/goa-account configure.d/lib/cosmic-favorites system/email-watch
	find . -name __pycache__ -prune -exec rm -rf {} +

smoketest:
	smoketest/run --tier all
