all: lint style check

#
# mandatory checks
#
lint: luacheck

style: style-check style-doc

check: luals

#
# subtasks
#
luacheck:
	luacheck --codes --quiet lua --exclude-files "**/_meta/**"

style-check:
	scripts/luals-check.sh codestyle-check

style-doc:
	scripts/doc-comments.sh

luals:
	scripts/luals-check.sh

#
# format
#
format-fix:
	CodeFormat format --config .editorconfig --workspace lua

format-check:
	CodeFormat format --config .editorconfig --workspace lua
	git diff --exit-code lua

#
# utility
#
help-update:
	scripts/vimdoc.sh doc
	scripts/help-defaults.sh

#
# CI
#
help-check: help-update
	git diff --exit-code doc/nvim-tree-lua.txt


.PHONY: all lint style check luacheck style-check style-doc luals format-fix format-check help-update help-check

