-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.ps1
More file actions
57 lines (40 loc) · 1.3 KB
/
make.ps1
File metadata and controls
57 lines (40 loc) · 1.3 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
param($lint = $false,
$interpreter = "python.exe",
$filematch = "." )
$scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
Set-Location $dir
write-host "Using interpreter $interpreter"
$Script:ErrorActionPreference = "Continue"
$args = @('-m', 'unittest', 'discover', '-s', 'src', '-p', '*_test.py')
& $interpreter $args 2>&1 | % { "$_" }
if ($lint -eq $false -or $LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
# Iterate all src
Get-ChildItem "src" -File -Filter "*.py" |
Where Name -CMatch $filematch |
ForEach-Object {
write-output($_.FullName)
Write-Output("")
Write-Output("PYLINT")
& $interpreter "-m", "pylint", $_.FullName 2>&1
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Output("MYPY")
& $interpreter "-m", "mypy", $_.FullName 2>&1
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Output("---------------------------------------")
Write-Output("PYFLAKES")
& $interpreter "-m", "pyflakes", $_.FullName 2>&1
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Output("***************************************")
Write-Output("***************************************")
}
exit 0