Address linting issues

Signed-off-by: Brett Logan <lindluni@github.com>
This commit is contained in:
Brett Logan 2023-01-08 23:35:37 -05:00
parent 2cdffd7af5
commit c26ca9fb2c

View file

@ -68,7 +68,7 @@ control "super-linter-installed-packages" do
) )
packages.each do |item| packages.each do |item|
if(image == "slim" && SLIM_IMAGE_REMOVED_PACKAGES.include?(item)) if (image == "slim" && SLIM_IMAGE_REMOVED_PACKAGES.include?(item))
next next
else else
describe package(item) do describe package(item) do
@ -171,10 +171,10 @@ control "super-linter-installed-commands" do
# command because the vast majority of linters have name == command # command because the vast majority of linters have name == command
linter_command = "" linter_command = ""
if(image == "slim" && SLIM_IMAGE_REMOVED_LINTERS.include?(linter[:linter_name])) if (image == "slim" && SLIM_IMAGE_REMOVED_LINTERS.include?(linter[:linter_name]))
next next
else else
if(linter.key?(:linter_command)) if (linter.key?(:linter_command))
linter_command = linter[:linter_command] linter_command = linter[:linter_command]
else else
linter_command = linter[:linter_name] linter_command = linter[:linter_name]
@ -185,12 +185,12 @@ control "super-linter-installed-commands" do
end end
# A few linters have a command that it's different than linter_command # A few linters have a command that it's different than linter_command
if(linter.key?(:version_command)) if (linter.key?(:version_command))
version_command = linter[:version_command] version_command = linter[:version_command]
else else
# Check if the linter needs an option that is different from the one that # Check if the linter needs an option that is different from the one that
# the vast majority of linters use to get the version # the vast majority of linters use to get the version
if(linter.key?(:version_option)) if (linter.key?(:version_option))
version_option = linter[:version_option] version_option = linter[:version_option]
else else
version_option = default_version_option version_option = default_version_option
@ -198,13 +198,13 @@ control "super-linter-installed-commands" do
version_command = "#{linter_command} #{version_option}" version_command = "#{linter_command} #{version_option}"
if(linter.key?(:expected_exit_status)) if (linter.key?(:expected_exit_status))
expected_exit_status = linter[:expected_exit_status] expected_exit_status = linter[:expected_exit_status]
else else
expected_exit_status = default_version_expected_exit_status expected_exit_status = default_version_expected_exit_status
end end
if(linter.key?(:expected_stdout_regex)) if (linter.key?(:expected_stdout_regex))
expected_stdout_regex = linter[:expected_stdout_regex] expected_stdout_regex = linter[:expected_stdout_regex]
else else
expected_stdout_regex = default_expected_stdout_regex expected_stdout_regex = default_expected_stdout_regex
@ -332,7 +332,7 @@ control "super-linter-validate-directories" do
) )
dirs.each do |item| dirs.each do |item|
if(image == "slim" && SLIM_IMAGE_REMOVED_DIRS.include?(item)) if (image == "slim" && SLIM_IMAGE_REMOVED_DIRS.include?(item))
next next
else else
describe directory(item) do describe directory(item) do
@ -421,7 +421,7 @@ control "super-linter-validate-powershell-modules" do
title "Super-Linter validate Powershell Modules" title "Super-Linter validate Powershell Modules"
desc "Check that Powershell modules that Super-Linter needs are installed." desc "Check that Powershell modules that Super-Linter needs are installed."
if(image == "slim") if (image == "slim")
next next
else else
describe command("pwsh -c \"(Get-Module -Name PSScriptAnalyzer -ListAvailable | Select-Object -First 1).Name\" 2>&1") do describe command("pwsh -c \"(Get-Module -Name PSScriptAnalyzer -ListAvailable | Select-Object -First 1).Name\" 2>&1") do