Add a rule to install stylua and use the local one for other rules (#1307)
This commit is contained in:
14
Makefile
14
Makefile
@@ -1,6 +1,12 @@
|
||||
.PHONY: install-stylua
|
||||
install-stylua:
|
||||
@if [ ! -f "./utils/stylua" ]; then \
|
||||
sh ./utils/install_stylua.sh; \
|
||||
fi
|
||||
|
||||
.PHONY: fmt
|
||||
fmt:
|
||||
stylua --config-path stylua.toml --glob 'lua/**/*.lua' -- lua
|
||||
fmt: install-stylua
|
||||
./utils/stylua --config-path stylua.toml --glob 'lua/**/*.lua' -- lua
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
@@ -11,13 +17,13 @@ test:
|
||||
vusted --output=gtest ./lua
|
||||
|
||||
.PHONY: pre-commit
|
||||
pre-commit:
|
||||
pre-commit: install-stylua
|
||||
./utils/stylua --config-path stylua.toml --glob 'lua/**/*.lua' -- lua
|
||||
luacheck lua
|
||||
vusted lua
|
||||
|
||||
.PHONY: integration
|
||||
integration:
|
||||
integration: install-stylua
|
||||
./utils/stylua --config-path stylua.toml --check --glob 'lua/**/*.lua' -- lua
|
||||
luacheck lua
|
||||
vusted lua
|
||||
|
||||
Reference in New Issue
Block a user