mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-22 22:20:57 -05:00
refactored AddDetailedMessageIfEnabled
This commit is contained in:
parent
759b5bac1f
commit
cee9d3a956
1 changed files with 12 additions and 22 deletions
|
@ -220,13 +220,7 @@ function LintCodebase() {
|
||||||
#######################################################
|
#######################################################
|
||||||
if IsTAP ; then
|
if IsTAP ; then
|
||||||
NotOkTap "${INDEX}" "${FILE}" "${TMPFILE}"
|
NotOkTap "${INDEX}" "${FILE}" "${TMPFILE}"
|
||||||
##########################################
|
AddDetailedMessageIfEnabled "$LINT_CMD" "${TMPFILE}"
|
||||||
# Report the detailed message if enabled #
|
|
||||||
##########################################
|
|
||||||
DETAILED_MSG=$(TransformTAPDetails "$LINT_CMD")
|
|
||||||
if [ -n "${DETAILED_MSG}" ] ; then
|
|
||||||
printf " ---\n message: %s\n ...\n" "$DETAILED_MSG" >> "${TMPFILE}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
###########
|
###########
|
||||||
|
@ -476,13 +470,7 @@ function TestCodebase() {
|
||||||
#######################################################
|
#######################################################
|
||||||
if IsTAP ; then
|
if IsTAP ; then
|
||||||
NotOkTap "${TESTS_RAN}" "${FILE_NAME}" "${TMPFILE}"
|
NotOkTap "${TESTS_RAN}" "${FILE_NAME}" "${TMPFILE}"
|
||||||
##########################################
|
AddDetailedMessageIfEnabled "$LINT_CMD" "${TMPFILE}"
|
||||||
# Report the detailed message if enabled #
|
|
||||||
##########################################
|
|
||||||
DETAILED_MSG=$(TransformTAPDetails "$LINT_CMD")
|
|
||||||
if [ -n "${DETAILED_MSG}" ] ; then
|
|
||||||
printf " ---\n message: %s\n ...\n" "${DETAILED_MSG}" >> "${TMPFILE}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -760,13 +748,7 @@ function LintAnsibleFiles() {
|
||||||
#######################################################
|
#######################################################
|
||||||
if IsTAP ; then
|
if IsTAP ; then
|
||||||
NotOkTap "${INDEX}" "${FILE}" "${TMPFILE}"
|
NotOkTap "${INDEX}" "${FILE}" "${TMPFILE}"
|
||||||
##########################################
|
AddDetailedMessageIfEnabled "${LINT_CMD}" "${TMPFILE}"
|
||||||
# Report the detailed message if enabled #
|
|
||||||
##########################################
|
|
||||||
DETAILED_MSG=$(TransformTAPDetails "$LINT_CMD")
|
|
||||||
if [ -n "${DETAILED_MSG}" ] ; then
|
|
||||||
printf " ---\n message: %s\n ...\n" "$DETAILED_MSG" >> "${TMPFILE}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -839,3 +821,11 @@ function OkTap() {
|
||||||
function NotOkTap() {
|
function NotOkTap() {
|
||||||
echo "not ok ${1} - ${2}" >> "${3}"
|
echo "not ok ${1} - ${2}" >> "${3}"
|
||||||
}
|
}
|
||||||
|
################################################################################
|
||||||
|
#### Function AddDetailedMessageIfEnabled ######################################
|
||||||
|
function AddDetailedMessageIfEnabled() {
|
||||||
|
DETAILED_MSG=$(TransformTAPDetails "${1}")
|
||||||
|
if [ -n "${DETAILED_MSG}" ] ; then
|
||||||
|
printf " ---\n message: %s\n ...\n" "$DETAILED_MSG" >> "${2}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue