mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Add PSCustomUseLiteralPath and update PSSA for pslint (#54080)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,5 +5,6 @@ paramiko
|
||||
ntlm-auth
|
||||
requests-ntlm
|
||||
requests-credssp
|
||||
pypsrp
|
||||
pywinrm[credssp]
|
||||
pyyaml
|
||||
|
||||
Reference in New Issue
Block a user