-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpsalm-check.bat
More file actions
61 lines (52 loc) · 1.46 KB
/
Copy pathpsalm-check.bat
File metadata and controls
61 lines (52 loc) · 1.46 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@echo off
setlocal enabledelayedexpansion
echo.
echo ========================================
echo PSALM VALIDATION CHECKER
echo ========================================
echo.
REM Check if psalm is installed
if not exist "vendor\bin\psalm.bat" (
echo [ERROR] Psalm not found at vendor\bin\psalm.bat
echo Please run: composer install
pause
exit /b 1
)
REM Ask user if they want to run psalm validation
set /p "run_psalm=🔍 Do you want to run Psalm validation? (y/n): "
if /i "%run_psalm%"=="n" (
echo [SKIP] Psalm validation skipped.
echo.
pause
exit /b 0
)
if /i "%run_psalm%"=="y" (
echo.
echo 🔄 Running Psalm Level 1 strict validation...
echo.
REM Check if specific file argument provided
if not "%~1"=="" (
echo 📁 Validating file: %~1
vendor\bin\psalm.bat --level=1 --strict "%~1"
) else (
echo 📁 Validating entire project...
vendor\bin\psalm.bat --level=1 --strict
)
set psalm_exit=%ERRORLEVEL%
echo.
if !psalm_exit! equ 0 (
echo ✅ SUCCESS: No Psalm errors found!
echo 🎉 Code is Psalm Level 1 compliant
) else (
echo [ERROR] Psalm found errors ^(Exit code: !psalm_exit!^)
echo [FIX] Please fix all issues before proceeding
)
echo.
echo ========================================
pause
exit /b !psalm_exit!
) else (
echo ❓ Invalid input. Please enter 'y' or 'n'
pause
exit /b 1
)