From f3c9bbd0efcca057153747787ce0afb3e0461357 Mon Sep 17 00:00:00 2001 From: Brett Logan Date: Fri, 23 Dec 2022 19:30:02 -0500 Subject: [PATCH] Use canonical PSScriptAnalyzer setting file extension The PSScriptAnalyzer expects a text file, not a PowerShell extension on the filename. The latest version of powershell now respects this rule and breaks testing as the settings file doesn't meet the requirements of the linter. Signed-off-by: Brett Logan --- ...l-psscriptanalyzer.psd1 => .powershell-psscriptanalyzer.txt} | 2 +- lib/linter.sh | 2 +- test/inspec/super-linter/controls/super_linter.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename TEMPLATES/{.powershell-psscriptanalyzer.psd1 => .powershell-psscriptanalyzer.txt} (88%) diff --git a/TEMPLATES/.powershell-psscriptanalyzer.psd1 b/TEMPLATES/.powershell-psscriptanalyzer.txt similarity index 88% rename from TEMPLATES/.powershell-psscriptanalyzer.psd1 rename to TEMPLATES/.powershell-psscriptanalyzer.txt index f4bbd6b5..19866505 100644 --- a/TEMPLATES/.powershell-psscriptanalyzer.psd1 +++ b/TEMPLATES/.powershell-psscriptanalyzer.txt @@ -1,4 +1,4 @@ -#Documentation: https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/markdown/Invoke-ScriptAnalyzer.md#-settings +#Documentation: https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Cmdlets/Invoke-ScriptAnalyzer.md#-settings @{ #CustomRulePath='path\to\CustomRuleModule.psm1' #RecurseCustomRulePath='path\of\customrules' diff --git a/lib/linter.sh b/lib/linter.sh index 345c594e..15eb7b41 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -152,7 +152,7 @@ PHP_PHPSTAN_FILE_NAME="phpstan.neon" # shellcheck disable=SC2034 # Variable is referenced indirectly PHP_PSALM_FILE_NAME="psalm.xml" # shellcheck disable=SC2034 # Variable is referenced indirectly -POWERSHELL_FILE_NAME=".powershell-psscriptanalyzer.psd1" +POWERSHELL_FILE_NAME=".powershell-psscriptanalyzer.txt" # shellcheck disable=SC2034 # Variable is referenced indirectly PROTOBUF_FILE_NAME="${PROTOBUF_CONFIG_FILE:-.protolintrc.yml}" # shellcheck disable=SC2034 # Variable is referenced indirectly diff --git a/test/inspec/super-linter/controls/super_linter.rb b/test/inspec/super-linter/controls/super_linter.rb index 83bdccd2..8811a7a5 100644 --- a/test/inspec/super-linter/controls/super_linter.rb +++ b/test/inspec/super-linter/controls/super_linter.rb @@ -386,7 +386,7 @@ control "super-linter-validate-files" do "/action/lib/.automation/.mypy.ini", "/action/lib/.automation/.openapirc.yml", "/action/lib/.automation/.perlcriticrc", - "/action/lib/.automation/.powershell-psscriptanalyzer.psd1", + "/action/lib/.automation/.powershell-psscriptanalyzer.txt", "/action/lib/.automation/.protolintrc.yml", "/action/lib/.automation/.python-black", "/action/lib/.automation/.python-lint",