mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-26 17:22:11 -05:00
Move to separate pwshlint script for better handling
This commit is contained in:
parent
62fe1b7b41
commit
507afd74a7
2 changed files with 8 additions and 7 deletions
|
@ -1653,12 +1653,7 @@ LintCodebase()
|
|||
################################
|
||||
# Lint the file with the rules #
|
||||
################################
|
||||
#Special Handling for Powershell Required
|
||||
if [ $FILE_TYPE -eq 'POWERSHELL' ];then
|
||||
|
||||
else
|
||||
LINT_CMD=$(cd "$GITHUB_WORKSPACE" || exit; $LINTER_COMMAND "$FILE" 2>&1)
|
||||
fi
|
||||
LINT_CMD=$(cd "$GITHUB_WORKSPACE" || exit; $LINTER_COMMAND "$FILE" 2>&1)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
@ -2285,7 +2280,7 @@ if [ "$VALIDATE_POWERSHELL" == "true" ]; then
|
|||
# Lint the powershell files #
|
||||
#############################
|
||||
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY"
|
||||
LintCodebase "POWERSHELL" "pwsh" "pwsh -c 'Invoke-ScriptAnalyzer -Settings $POWERSHELL_LINTER_RULES -Path '" ".*\.\(ps[md]\?1\)\$" "${FILE_ARRAY_POWERSHELL[@]}"
|
||||
LintCodebase "POWERSHELL" "/action/lib/pwshlint.ps1" "/action/lib/pwshlint.ps1 $POWERSHELL_LINTER_RULES " ".*\.\(ps[md]\?1\)\$" "${FILE_ARRAY_POWERSHELL[@]}"
|
||||
fi
|
||||
|
||||
##########
|
||||
|
|
6
lib/pwshlint.ps1
Normal file
6
lib/pwshlint.ps1
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/pwsh
|
||||
param(
|
||||
[String]$SettingsPath,
|
||||
[String]$FileToAnalyze
|
||||
)
|
||||
Invoke-ScriptAnalyzer -Settings $SettingsPath -Path $FileToAnalyze
|
Loading…
Reference in a new issue