Add PSCustomUseLiteralPath and update PSSA for pslint (#54080)

This commit is contained in:
Jordan Borean
2019-03-20 16:26:12 +10:00
committed by GitHub
parent ac6ff8fe05
commit 0bf14d61d0
5 changed files with 140 additions and 16 deletions

View File

@@ -76,18 +76,23 @@ class PslintTest(SanitySingleVersion):
if not find_executable('pwsh', required='warning'):
return SanitySkipped(self.name)
cmd = ['test/sanity/pslint/pslint.ps1'] + paths
# Make sure requirements are installed before running sanity checks
cmds = [
['test/runner/requirements/sanity.ps1'],
['test/sanity/pslint/pslint.ps1'] + paths
]
try:
stdout, stderr = run_command(args, cmd, capture=True)
status = 0
except SubprocessError as ex:
stdout = ex.stdout
stderr = ex.stderr
status = ex.status
for cmd in cmds:
try:
stdout, stderr = run_command(args, cmd, capture=True)
status = 0
except SubprocessError as ex:
stdout = ex.stdout
stderr = ex.stderr
status = ex.status
if stderr:
raise SubprocessError(cmd=cmd, status=status, stderr=stderr, stdout=stdout)
if stderr:
raise SubprocessError(cmd=cmd, status=status, stderr=stderr, stdout=stdout)
if args.explain:
return SanitySuccess(self.name)

View File

@@ -5,4 +5,7 @@ Set-StrictMode -Version 2.0
$ErrorActionPreference = "Stop"
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name PSScriptAnalyzer
Install-Module -Name PSScriptAnalyzer -RequiredVersion 1.17.1
# Installed the PSCustomUseLiteralPath rule
Install-Module -Name PSSA-PSCustomUseLiteralPath -RequiredVersion 0.1.1

View File

@@ -5,5 +5,6 @@ paramiko
ntlm-auth
requests-ntlm
requests-credssp
pypsrp
pywinrm[credssp]
pyyaml