chore: bootstrap Godot quality tools
This commit is contained in:
+12
-4
@@ -59,6 +59,7 @@ function Find-Godot {
|
||||
}
|
||||
|
||||
function Test-GdFormat {
|
||||
if (Test-Path "$ROOT/.venv/Scripts/gdformat.exe") { return $true }
|
||||
if (Get-Command gdformat -ErrorAction SilentlyContinue) { return $true }
|
||||
try {
|
||||
$null = & python -m gdtoolkit.formatter --help 2>&1
|
||||
@@ -72,6 +73,7 @@ function Test-GdFormat {
|
||||
}
|
||||
|
||||
function Test-GdLint {
|
||||
if (Test-Path "$ROOT/.venv/Scripts/gdlint.exe") { return $true }
|
||||
if (Get-Command gdlint -ErrorAction SilentlyContinue) { return $true }
|
||||
try {
|
||||
$null = & python -m gdtoolkit.linter --help 2>&1
|
||||
@@ -86,7 +88,10 @@ function Test-GdLint {
|
||||
|
||||
function Invoke-GdFormat {
|
||||
$args = $args
|
||||
if (Get-Command gdformat -ErrorAction SilentlyContinue) {
|
||||
$localTool = "$ROOT/.venv/Scripts/gdformat.exe"
|
||||
if (Test-Path $localTool) {
|
||||
& $localTool @args 2>&1
|
||||
} elseif (Get-Command gdformat -ErrorAction SilentlyContinue) {
|
||||
& gdformat @args 2>&1
|
||||
} else {
|
||||
& python -m gdtoolkit.formatter @args 2>&1
|
||||
@@ -95,7 +100,10 @@ function Invoke-GdFormat {
|
||||
|
||||
function Invoke-GdLint {
|
||||
$args = $args
|
||||
if (Get-Command gdlint -ErrorAction SilentlyContinue) {
|
||||
$localTool = "$ROOT/.venv/Scripts/gdlint.exe"
|
||||
if (Test-Path $localTool) {
|
||||
& $localTool @args 2>&1
|
||||
} elseif (Get-Command gdlint -ErrorAction SilentlyContinue) {
|
||||
& gdlint @args 2>&1
|
||||
} else {
|
||||
& python -m gdtoolkit.linter @args 2>&1
|
||||
@@ -161,7 +169,7 @@ $fmtResult = "PASS"
|
||||
Set-Content -Path "$LOG/gdformat.log" -Value "" -Encoding utf8
|
||||
if (-not $fmtAvail) {
|
||||
$fmtResult = "SKIPPED"
|
||||
Add-Content -Path "$LOG/gdformat.log" -Value "gdformat not found -- install: pip install gdtoolkit" -Encoding utf8
|
||||
Add-Content -Path "$LOG/gdformat.log" -Value "gdformat not found -- install requirements-dev.txt (see docs/local_quality_gate.md)" -Encoding utf8
|
||||
} else {
|
||||
if ($Changed) {
|
||||
$files = Get-ChangedGd
|
||||
@@ -203,7 +211,7 @@ $lintResult = "PASS"
|
||||
Set-Content -Path "$LOG/gdlint.log" -Value "" -Encoding utf8
|
||||
if (-not $lintAvail) {
|
||||
$lintResult = "SKIPPED"
|
||||
Add-Content -Path "$LOG/gdlint.log" -Value "gdlint not found -- install: pip install gdtoolkit" -Encoding utf8
|
||||
Add-Content -Path "$LOG/gdlint.log" -Value "gdlint not found -- install requirements-dev.txt (see docs/local_quality_gate.md)" -Encoding utf8
|
||||
} else {
|
||||
if ($Changed) {
|
||||
$files = Get-ChangedGd
|
||||
|
||||
Reference in New Issue
Block a user