dev: automated commit - 2025-09-22 12:48:46
This commit is contained in:
parent
a2a4066600
commit
1e696b3cfd
3 changed files with 15 additions and 4 deletions
|
|
@ -1,8 +1,20 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Git pre-commit hook to format Lua files with stylua
|
||||||
|
|
||||||
|
# Check if stylua is available in PATH
|
||||||
|
if ! command -v stylua &>/dev/null; then
|
||||||
|
echo "Error: stylua not found. Please install it via NixOS configuration."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get staged Lua files
|
||||||
LUA_FILES=$(git diff --cached --name-only --diff-filter=AM | grep '\.lua$')
|
LUA_FILES=$(git diff --cached --name-only --diff-filter=AM | grep '\.lua$')
|
||||||
|
|
||||||
if [ -n "$LUA_FILES" ]; then
|
if [ -n "$LUA_FILES" ]; then
|
||||||
echo "$LUA_FILES" | xargs "$STYLUA_PATH"
|
echo "Formatting Lua files with stylua..."
|
||||||
|
echo "$LUA_FILES" | xargs stylua
|
||||||
echo "$LUA_FILES" | xargs git add
|
echo "$LUA_FILES" | xargs git add
|
||||||
|
echo "Lua files formatted and re-staged."
|
||||||
|
else
|
||||||
|
echo "No Lua files to format."
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ return {
|
||||||
flags = {},
|
flags = {},
|
||||||
filetypes = { "typescript" },
|
filetypes = { "typescript" },
|
||||||
cmd = {
|
cmd = {
|
||||||
"/home/forbi/local/local/tsgo",
|
"/home/mzunino/Dev/random/typescript-go/built/local",
|
||||||
"--lsp",
|
"--lsp",
|
||||||
"-stdio",
|
"-stdio",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -137,8 +137,7 @@ return {
|
||||||
"templ",
|
"templ",
|
||||||
"tinymist",
|
"tinymist",
|
||||||
"jdtls",
|
"jdtls",
|
||||||
"ts_ls",
|
-- "ts_ls",
|
||||||
"ts_go_ls",
|
|
||||||
"nixd",
|
"nixd",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue