Skip to content

Commit

Permalink
Fix new issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nemchik committed Jun 30, 2020
1 parent 889179e commit c6594d8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .vscode/testlinter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ fi
#########################
export RUN_LOCAL=true

# shellcheck source=../lib/linter.sh
# shellcheck source=/dev/null
source "$PWD"/lib/linter.sh
2 changes: 1 addition & 1 deletion lib/buildFileList.sh
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ function BuildFileList()
fi
done

echo $READ_ONLY_CHANGE_FLAG > /dev/null 2>&1 || true # Workaround SC2034
echo ${READ_ONLY_CHANGE_FLAG} > /dev/null 2>&1 || true # Workaround SC2034

#########################################
# Need to switch back to branch of code #
Expand Down
11 changes: 8 additions & 3 deletions lib/linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#########################
# Source Function Files #
#########################
# shellcheck source=../lib/buildFileList.sh
# shellcheck source=/dev/null
source /action/lib/buildFileList.sh # Source the function script(s)
# shellcheck source=../lib/validation.sh
# shellcheck source=/dev/null
source /action/lib/validation.sh # Source the function script(s)
# shellcheck source=../lib/worker.sh
# shellcheck source=/dev/null
source /action/lib/worker.sh # Source the function script(s)

###########
Expand Down Expand Up @@ -150,10 +150,15 @@ DEFAULT_IFS="$IFS" # Get the Default IFS for updating
# Default Vars that are called in Subs and need to be ignored #
###############################################################
DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors
echo "${DEFAULT_DISABLE_ERRORS}" > /dev/null 2>&1 || true # Workaround SC2034
RAW_FILE_ARRAY=() # Array of all files that were changed
echo "${RAW_FILE_ARRAY[*]}" > /dev/null 2>&1 || true # Workaround SC2034
READ_ONLY_CHANGE_FLAG=0 # Flag set to 1 if files changed are not txt or md
echo "${READ_ONLY_CHANGE_FLAG}" > /dev/null 2>&1 || true # Workaround SC2034
TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore
echo "${TEST_CASE_FOLDER}" > /dev/null 2>&1 || true # Workaround SC2034
DEFAULT_ANSIBLE_DIRECTORY="$GITHUB_WORKSPACE/ansible" # Default Ansible Directory
echo "${DEFAULT_ANSIBLE_DIRECTORY}" > /dev/null 2>&1 || true # Workaround SC2034

##########################
# Array of changed files #
Expand Down
28 changes: 4 additions & 24 deletions lib/worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,30 +253,10 @@ function TestCodebase()
##########################
LIST_FILES=()

############################################
# Check if its ansible, as its the outlier #
############################################
if [[ "$FILE_TYPE" == "ANSIBLE" ]]; then
#################################
# Get list of all files to lint #
#################################
mapfile -t LIST_FILES < <(ls "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/ansible/*.yml" 2>&1)
else
###############################################################################
# Set the file seperator to newline to allow for grabbing objects with spaces #
###############################################################################
IFS=$'\n'

#################################
# Get list of all files to lint #
#################################
mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER" -type f -regex "$FILE_EXTENSIONS" ! -path "*./ansible*" 2>&1)

###########################
# Set IFS back to default #
###########################
IFS="$DEFAULT_IFS"
fi
#################################
# Get list of all files to lint #
#################################
mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER" -type f -regex "$FILE_EXTENSIONS" ! -path "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/ansible/ghe-initialize/*" 2>&1)

##################
# Lint the files #
Expand Down

0 comments on commit c6594d8

Please sign in to comment.