mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2025-01-18 10:30:48 +00:00
Update pre-commit.ps1
This commit is contained in:
parent
dd8b48d98a
commit
605e1075af
@ -3,12 +3,12 @@ Function RunTests {
|
|||||||
$run_tests = "pytest -v --capture=tee-sys --junitxml=./tests/.coverage.xml"
|
$run_tests = "pytest -v --capture=tee-sys --junitxml=./tests/.coverage.xml"
|
||||||
$match_pattern = "^=|^\s*$|^Running|^Using|^plugins|^collecting|^tests"
|
$match_pattern = "^=|^\s*$|^Running|^Using|^plugins|^collecting|^tests"
|
||||||
|
|
||||||
Clear-Content $coverage
|
if ( Test-Path "./$coverage" ) { Clear-Content $coverage }
|
||||||
|
|
||||||
ForEach ($line in $(Invoke-Expression $run_tests)) {
|
ForEach ($line in $(Invoke-Expression $run_tests)) {
|
||||||
If ( $line -Match $match_pattern ) {
|
If ( $line -Match $match_pattern ) {
|
||||||
if ( $line -Match "^Running tests for kind \[(\w+)\]" ) { $kind = $Matches[1] }
|
if ( $line -Match "^Running tests for kind \[(\w+)\]" ) { $kind = $Matches[1] }
|
||||||
$line | Tee-Object -FilePath $coverage -Append
|
$line | Tee-Object -FilePath $coverage -Append
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Write-Output "$(Get-TimeStamp)" | Out-file $coverage -Append
|
Write-Output "$(Get-TimeStamp)" | Out-file $coverage -Append
|
||||||
@ -17,9 +17,9 @@ Function RunTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Function Get-TimeStamp {
|
Function Get-TimeStamp {
|
||||||
|
|
||||||
return "[{0:MM/dd/yy} {0:HH:mm:ss}]" -f (Get-Date)
|
return "[{0:MM/dd/yy} {0:HH:mm:ss}]" -f (Get-Date)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($MyInvocation.InvocationName -ne ".") {
|
if ($MyInvocation.InvocationName -ne ".") {
|
||||||
|
Loading…
Reference in New Issue
Block a user