mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-25 15:41:02 -05:00
Merge pull request #38 from github/AddVersionsAndLinkage
adding version info
This commit is contained in:
commit
92d82b9a6c
1 changed files with 61 additions and 0 deletions
|
@ -31,6 +31,12 @@ JAVASCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$JAVASCRIPT_FILE_NAME" # Path t
|
||||||
ANSIBLE_FILE_NAME='.ansible-lint.yml' # Name of the file
|
ANSIBLE_FILE_NAME='.ansible-lint.yml' # Name of the file
|
||||||
ANSIBLE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$ANSIBLE_FILE_NAME" # Path to the coffescript lint rules
|
ANSIBLE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$ANSIBLE_FILE_NAME" # Path to the coffescript lint rules
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Linter array for information prints #
|
||||||
|
#######################################
|
||||||
|
LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck"
|
||||||
|
"pylint" "perl" "rubocop" "coffeelint" "eslint" "standard" "ansible-lint")
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# GitHub ENV Vars #
|
# GitHub ENV Vars #
|
||||||
###################
|
###################
|
||||||
|
@ -101,6 +107,10 @@ Header()
|
||||||
echo "------ Github Actions Language Linter -------"
|
echo "------ Github Actions Language Linter -------"
|
||||||
echo "---------------------------------------------"
|
echo "---------------------------------------------"
|
||||||
echo ""
|
echo ""
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
echo "The Super-Linter source code can be found at:"
|
||||||
|
echo " - https://github.com/github/super-linter"
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
|
||||||
# echo "--- DEBUG ---"
|
# echo "--- DEBUG ---"
|
||||||
# echo "---------------------------------------------"
|
# echo "---------------------------------------------"
|
||||||
|
@ -111,6 +121,52 @@ Header()
|
||||||
# echo "---------------------------------------------"
|
# echo "---------------------------------------------"
|
||||||
}
|
}
|
||||||
################################################################################
|
################################################################################
|
||||||
|
#### Function GetLinterVersions ################################################
|
||||||
|
GetLinterVersions()
|
||||||
|
{
|
||||||
|
#########################
|
||||||
|
# Print version headers #
|
||||||
|
#########################
|
||||||
|
echo ""
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
echo "Linter Version Info:"
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
##########################################################
|
||||||
|
# Go through the array of linters and print version info #
|
||||||
|
##########################################################
|
||||||
|
for LINTER in "${LINTER_ARRAY[@]}"
|
||||||
|
do
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
echo "[$LINTER]:"
|
||||||
|
###################
|
||||||
|
# Get the version #
|
||||||
|
###################
|
||||||
|
# shellcheck disable=SC2207
|
||||||
|
GET_VERSION_CMD=($("$LINTER" --version 2>&1))
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# Load the error code #
|
||||||
|
#######################
|
||||||
|
ERROR_CODE=$?
|
||||||
|
|
||||||
|
##############################
|
||||||
|
# Check the shell for errors #
|
||||||
|
##############################
|
||||||
|
if [ $ERROR_CODE -ne 0 ]; then
|
||||||
|
echo "WARN! Failed to get version info for:[$LINTER]"
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
else
|
||||||
|
##########################
|
||||||
|
# Print the version info #
|
||||||
|
##########################
|
||||||
|
echo "${GET_VERSION_CMD[*]}"
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
################################################################################
|
||||||
#### Function GetLinterRules ###################################################
|
#### Function GetLinterRules ###################################################
|
||||||
GetLinterRules()
|
GetLinterRules()
|
||||||
{
|
{
|
||||||
|
@ -2441,6 +2497,11 @@ GetGitHubVars
|
||||||
########################
|
########################
|
||||||
GetLinterRules
|
GetLinterRules
|
||||||
|
|
||||||
|
##################################
|
||||||
|
# Get and print all version info #
|
||||||
|
##################################
|
||||||
|
GetLinterVersions
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# Get list of files changed if env set #
|
# Get list of files changed if env set #
|
||||||
########################################
|
########################################
|
||||||
|
|
Loading…
Reference in a new issue