mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-06 01:05:54 -05:00
fix: don't add unnecessary empty lines (#5221)
This commit is contained in:
parent
ef9449e2b0
commit
eded42747b
5 changed files with 17 additions and 16 deletions
|
@ -379,7 +379,7 @@ ENV PATH="${PATH}:${DART_SDK}/bin:/root/.pub-cache/bin"
|
||||||
|
|
||||||
# Initialize Terrascan
|
# Initialize Terrascan
|
||||||
# Initialize ChkTeX config file
|
# Initialize ChkTeX config file
|
||||||
RUN terrascan init \
|
RUN terrascan init --log-level "debug" \
|
||||||
&& touch ~/.chktexrc
|
&& touch ~/.chktexrc
|
||||||
|
|
||||||
ENTRYPOINT ["/action/lib/linter.sh"]
|
ENTRYPOINT ["/action/lib/linter.sh"]
|
||||||
|
|
|
@ -150,14 +150,14 @@ function BuildFileList() {
|
||||||
|
|
||||||
local RESULTS_OBJECT
|
local RESULTS_OBJECT
|
||||||
RESULTS_OBJECT=
|
RESULTS_OBJECT=
|
||||||
if ! RESULTS_OBJECT=$(jq -n '[inputs]' "${PARALLEL_RESULTS_FILE_PATH}"); then
|
if ! RESULTS_OBJECT=$(jq --raw-output -n '[inputs]' "${PARALLEL_RESULTS_FILE_PATH}"); then
|
||||||
fatal "Error loading results when building the file list: ${RESULTS_OBJECT}"
|
fatal "Error loading results when building the file list: ${RESULTS_OBJECT}"
|
||||||
fi
|
fi
|
||||||
debug "RESULTS_OBJECT for ${FILE_TYPE}:\n${RESULTS_OBJECT}"
|
debug "RESULTS_OBJECT for ${FILE_TYPE}:\n${RESULTS_OBJECT}"
|
||||||
|
|
||||||
local STDOUT_BUILD_FILE_LIST
|
local STDOUT_BUILD_FILE_LIST
|
||||||
# Get raw output so we can strip quotes from the data we load
|
# Get raw output so we can strip quotes from the data we load
|
||||||
if ! STDOUT_BUILD_FILE_LIST="$(jq --raw-output '.[].Stdout' <<<"${RESULTS_OBJECT}")"; then
|
if ! STDOUT_BUILD_FILE_LIST="$(jq --raw-output '.[].Stdout[:-1]' <<<"${RESULTS_OBJECT}")"; then
|
||||||
fatal "Error when loading stdout when building the file list: ${STDOUT_BUILD_FILE_LIST}"
|
fatal "Error when loading stdout when building the file list: ${STDOUT_BUILD_FILE_LIST}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -168,12 +168,12 @@ function BuildFileList() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local STDERR_BUILD_FILE_LIST
|
local STDERR_BUILD_FILE_LIST
|
||||||
if ! STDERR_BUILD_FILE_LIST="$(jq --raw-output '.[].Stderr' <<<"${RESULTS_OBJECT}")"; then
|
if ! STDERR_BUILD_FILE_LIST="$(jq --raw-output '.[].Stderr[:-1]' <<<"${RESULTS_OBJECT}")"; then
|
||||||
fatal "Error when loading stderr when building the file list:\n${STDERR_BUILD_FILE_LIST}"
|
fatal "Error when loading stderr when building the file list:\n${STDERR_BUILD_FILE_LIST}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${STDERR_BUILD_FILE_LIST}" ]; then
|
if [ -n "${STDERR_BUILD_FILE_LIST}" ]; then
|
||||||
info "Command output when building the file list:\n------\n${STDERR_BUILD_FILE_LIST}\n------"
|
info "Stderr when building the file list:\n------\n${STDERR_BUILD_FILE_LIST}\n------"
|
||||||
else
|
else
|
||||||
debug "Stderr when building the file list is empty"
|
debug "Stderr when building the file list is empty"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -173,7 +173,7 @@ function LintCodebase() {
|
||||||
|
|
||||||
local RESULTS_OBJECT
|
local RESULTS_OBJECT
|
||||||
RESULTS_OBJECT=
|
RESULTS_OBJECT=
|
||||||
if ! RESULTS_OBJECT=$(jq -n '[inputs]' "${PARALLEL_RESULTS_FILE_PATH}"); then
|
if ! RESULTS_OBJECT=$(jq --raw-output -n '[inputs]' "${PARALLEL_RESULTS_FILE_PATH}"); then
|
||||||
fatal "Error loading results for ${FILE_TYPE}: ${RESULTS_OBJECT}"
|
fatal "Error loading results for ${FILE_TYPE}: ${RESULTS_OBJECT}"
|
||||||
fi
|
fi
|
||||||
debug "RESULTS_OBJECT for ${FILE_TYPE}:\n${RESULTS_OBJECT}"
|
debug "RESULTS_OBJECT for ${FILE_TYPE}:\n${RESULTS_OBJECT}"
|
||||||
|
@ -187,8 +187,8 @@ function LintCodebase() {
|
||||||
debug "Set INDEX for ${FILE_TYPE} to: ${INDEX}"
|
debug "Set INDEX for ${FILE_TYPE} to: ${INDEX}"
|
||||||
|
|
||||||
local STDOUT_LINTER
|
local STDOUT_LINTER
|
||||||
# Get raw output so we can strip quotes from the data we load
|
# Get raw output so we can strip quotes from the data we load. Also, strip the final newline to avoid adding it two times
|
||||||
if ! STDOUT_LINTER="$(jq --raw-output '.[].Stdout' <<<"${RESULTS_OBJECT}")"; then
|
if ! STDOUT_LINTER="$(jq --raw-output '.[].Stdout[:-1]' <<<"${RESULTS_OBJECT}")"; then
|
||||||
fatal "Error when loading stdout for ${FILE_TYPE}:\n${STDOUT_LINTER}"
|
fatal "Error when loading stdout for ${FILE_TYPE}:\n${STDOUT_LINTER}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -199,12 +199,12 @@ function LintCodebase() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local STDERR_LINTER
|
local STDERR_LINTER
|
||||||
if ! STDERR_LINTER="$(jq --raw-output '.[].Stderr' <<<"${RESULTS_OBJECT}")"; then
|
if ! STDERR_LINTER="$(jq --raw-output '.[].Stderr[:-1]' <<<"${RESULTS_OBJECT}")"; then
|
||||||
fatal "Error when loading stderr for ${FILE_TYPE}:\n${STDERR_LINTER}"
|
fatal "Error when loading stderr for ${FILE_TYPE}:\n${STDERR_LINTER}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${STDERR_LINTER}" ]; then
|
if [ -n "${STDERR_LINTER}" ]; then
|
||||||
info "Command output for ${FILE_TYPE}:\n------\n${STDERR_LINTER}\n------"
|
info "Stderr contents for ${FILE_TYPE}:\n------\n${STDERR_LINTER}\n------"
|
||||||
else
|
else
|
||||||
debug "Stderr for ${FILE_TYPE} is empty"
|
debug "Stderr for ${FILE_TYPE} is empty"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -929,13 +929,13 @@ debug "PARALLEL_COMMAND_OUTPUT when running linters (exit code: ${PARALLEL_COMMA
|
||||||
debug "Parallel output file (${PARALLEL_RESULTS_FILE_PATH}) contents when running linters:\n$(cat "${PARALLEL_RESULTS_FILE_PATH}")"
|
debug "Parallel output file (${PARALLEL_RESULTS_FILE_PATH}) contents when running linters:\n$(cat "${PARALLEL_RESULTS_FILE_PATH}")"
|
||||||
|
|
||||||
RESULTS_OBJECT=
|
RESULTS_OBJECT=
|
||||||
if ! RESULTS_OBJECT=$(jq -n '[inputs]' "${PARALLEL_RESULTS_FILE_PATH}"); then
|
if ! RESULTS_OBJECT=$(jq --raw-output -n '[inputs]' "${PARALLEL_RESULTS_FILE_PATH}"); then
|
||||||
fatal "Error loading results when building the file list: ${RESULTS_OBJECT}"
|
fatal "Error loading results when building the file list: ${RESULTS_OBJECT}"
|
||||||
fi
|
fi
|
||||||
debug "RESULTS_OBJECT when running linters:\n${RESULTS_OBJECT}"
|
debug "RESULTS_OBJECT when running linters:\n${RESULTS_OBJECT}"
|
||||||
|
|
||||||
# Get raw output so we can strip quotes from the data we load
|
# Get raw output so we can strip quotes from the data we load. Also, strip the final newline to avoid adding it two times
|
||||||
if ! STDOUT_LINTERS="$(jq --raw-output '.[].Stdout' <<<"${RESULTS_OBJECT}")"; then
|
if ! STDOUT_LINTERS="$(jq --raw-output '.[].Stdout[:-1]' <<<"${RESULTS_OBJECT}")"; then
|
||||||
fatal "Error when loading stdout when running linters:\n${STDOUT_LINTERS}"
|
fatal "Error when loading stdout when running linters:\n${STDOUT_LINTERS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -945,12 +945,12 @@ else
|
||||||
debug "Stdout when running linters is empty"
|
debug "Stdout when running linters is empty"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! STDERR_LINTERS="$(jq --raw-output '.[].Stderr' <<<"${RESULTS_OBJECT}")"; then
|
if ! STDERR_LINTERS="$(jq --raw-output '.[].Stderr[:-1]' <<<"${RESULTS_OBJECT}")"; then
|
||||||
fatal "Error when loading stderr for ${FILE_TYPE}:\n${STDERR_LINTERS}"
|
fatal "Error when loading stderr for ${FILE_TYPE}:\n${STDERR_LINTERS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${STDERR_LINTERS}" ]; then
|
if [ -n "${STDERR_LINTERS}" ]; then
|
||||||
info "Command output for ${FILE_TYPE}:\n------\n${STDERR_LINTERS}\n------"
|
info "Stderr when running linters:\n------\n${STDERR_LINTERS}\n------"
|
||||||
else
|
else
|
||||||
debug "Stderr when running linters is empty"
|
debug "Stderr when running linters is empty"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -483,7 +483,8 @@ control "super-linter-validate-files" do
|
||||||
"/action/lib/.automation/.yaml-lint.yml",
|
"/action/lib/.automation/.yaml-lint.yml",
|
||||||
"/action/lib/.automation/phpcs.xml",
|
"/action/lib/.automation/phpcs.xml",
|
||||||
"/action/lib/.automation/phpstan.neon",
|
"/action/lib/.automation/phpstan.neon",
|
||||||
"/action/lib/.automation/psalm.xml"
|
"/action/lib/.automation/psalm.xml",
|
||||||
|
"/root/.chktexrc"
|
||||||
]
|
]
|
||||||
|
|
||||||
files.each do |item|
|
files.each do |item|
|
||||||
|
|
Loading…
Reference in a new issue