mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-09 10:33:37 -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
|
||||
NotOkTap "${INDEX}" "${FILE}" "${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
|
||||
AddDetailedMessageIfEnabled "$LINT_CMD" "${TMPFILE}"
|
||||
fi
|
||||
else
|
||||
###########
|
||||
|
@ -476,13 +470,7 @@ function TestCodebase() {
|
|||
#######################################################
|
||||
if IsTAP ; then
|
||||
NotOkTap "${TESTS_RAN}" "${FILE_NAME}" "${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
|
||||
AddDetailedMessageIfEnabled "$LINT_CMD" "${TMPFILE}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
@ -760,13 +748,7 @@ function LintAnsibleFiles() {
|
|||
#######################################################
|
||||
if IsTAP ; then
|
||||
NotOkTap "${INDEX}" "${FILE}" "${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
|
||||
AddDetailedMessageIfEnabled "${LINT_CMD}" "${TMPFILE}"
|
||||
fi
|
||||
|
||||
else
|
||||
|
@ -838,4 +820,12 @@ function OkTap() {
|
|||
#### Function NotOkTap #########################################################
|
||||
function NotOkTap() {
|
||||
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