SHELL=/bin/bash
LINT_PATHS=hyperparams/ plots/ robustness/ *.py

mypy:
	mypy ${LINT_PATHS}

type: mypy

lint:
	# stop the build if there are Python syntax errors or undefined names
	# see https://www.flake8rules.com/
	ruff ${LINT_PATHS} --select=E9,F63,F7,F82 --show-source
	# exit-zero treats all errors as warnings.
	ruff ${LINT_PATHS} --exit-zero

format:
	# Sort imports
	ruff ${LINT_PATHS} --select I --fix
	# Reformat using black
	black ${LINT_PATHS}

check-codestyle:
	# Sort imports
	ruff --select I ${LINT_PATHS}
	# Reformat using black
	black --check ${LINT_PATHS}

commit-checks: format type lint

.PHONY: clean spelling doc lint format check-codestyle commit-checks
