Spaces:
Sleeping
Sleeping
File size: 1,045 Bytes
c96b98a | 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 | @echo off
:: Formats phidata
:: Usage:
:: .\scripts\format.bat
set "CURR_DIR=%~dp0"
set "REPO_ROOT=%~dp0.."
:: Ensure that _utils.bat is correctly located and called
set "UTILS_BAT=%CURR_DIR%_utils.bat"
:main
call "%UTILS_BAT%" print_heading "Formatting phidata"
call "%UTILS_BAT%" print_heading "Running: ruff format %REPO_ROOT%"
call "%REPO_ROOT%\phienv\Scripts\ruff" format "%REPO_ROOT%"
if %ERRORLEVEL% neq 0 (
echo Failed to format with ruff.
goto :eof
)
call "%UTILS_BAT%" print_heading "Running: ruff check %REPO_ROOT%"
call "%REPO_ROOT%\phienv\Scripts\ruff" check "%REPO_ROOT%"
if %ERRORLEVEL% neq 0 (
echo Failed ruff check.
goto :eof
)
call "%UTILS_BAT%" print_heading "Running: mypy %REPO_ROOT%"
call "%REPO_ROOT%\phienv\Scripts\mypy" "%REPO_ROOT%"
if %ERRORLEVEL% neq 0 (
echo Failed mypy check.
goto :eof
)
call "%UTILS_BAT%" print_heading "Running: pytest %REPO_ROOT%"
call "%REPO_ROOT%\phienv\Scripts\pytest" "%REPO_ROOT%"
if %ERRORLEVEL% neq 0 (
echo Failed pytest.
goto :eof
)
goto :eof |