-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck.sh
More file actions
executable file
·42 lines (36 loc) · 1.14 KB
/
check.sh
File metadata and controls
executable file
·42 lines (36 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
RED='\033[0;31m'
NC='\033[0m' # No Color
BOLD='\033[1m'
echo "\n${BOLD}🔍 Running checks...${NC}\n"
# Luacheck - exclude template files
echo "${BLUE}▶ Running luacheck...${NC}"
if luacheck . --exclude-files '**/*.template.lua'; then
echo "${GREEN}✓ Luacheck passed${NC}\n"
else
echo "${RED}✗ Luacheck failed${NC}\n"
exit 1
fi
# Type checking - exclude template files
echo "${BLUE}▶ Running type checking...${NC}"
# Find all lua files excluding templates
LUA_FILES=$(find . -name "*.lua" -not -name "*.template.lua")
if lua-language-server --loglevel=warn --logpath=. --check $LUA_FILES; then
echo "${GREEN}✓ Type checking passed${NC}\n"
else
echo "${RED}✗ Type checking failed${NC}\n"
exit 1
fi
# Formatting - exclude template files
echo "${BLUE}▶ Running formatting for lua files...${NC}"
if find lua -name "*.lua" -not -name "*.template.lua" | xargs stylua; then
echo "${GREEN}✓ Formatting completed${NC}\n"
else
echo "${RED}✗ Formatting failed${NC}\n"
exit 1
fi
# Success message
echo "${GREEN}${BOLD}✨ All checks passed!${NC}\n"