mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +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)
|
||||
|
||||
Reference in New Issue
Block a user