mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-22 06:01:05 -05:00
Move FILTER_REGEX_INCLUDE and FILTER_REGEX_EXCLUDE test (#1022)
* Move FILTER_REGEX_INCLUDE AND FILTER_REGEX_EXCLUDE before checking filetype * missing continue, and a lint error Co-authored-by: Marco Ferrari <ferrari.marco@gmail.com>
This commit is contained in:
parent
e77c41432c
commit
3abe0fc5e6
2 changed files with 16 additions and 20 deletions
|
@ -221,6 +221,22 @@ function BuildFileList() {
|
|||
debug "TEST_CASE_RUN (${TEST_CASE_RUN}) is true. Skipping ${FILE}..."
|
||||
fi
|
||||
|
||||
#################################################
|
||||
# Filter files if FILTER_REGEX_INCLUDE is set #
|
||||
#################################################
|
||||
if [[ -n "$FILTER_REGEX_INCLUDE" ]] && [[ ! (${FILE} =~ $FILTER_REGEX_INCLUDE) ]]; then
|
||||
debug "FILTER_REGEX_INCLUDE didn't match. Skipping ${FILE}"
|
||||
continue
|
||||
fi
|
||||
|
||||
#################################################
|
||||
# Filter files if FILTER_REGEX_EXCLUDE is set #
|
||||
#################################################
|
||||
if [[ -n "$FILTER_REGEX_EXCLUDE" ]] && [[ ${FILE} =~ $FILTER_REGEX_EXCLUDE ]]; then
|
||||
debug "FILTER_REGEX_EXCLUDE match. Skipping ${FILE}"
|
||||
continue
|
||||
fi
|
||||
|
||||
# Editorconfig-checker should check every file
|
||||
FILE_ARRAY_EDITORCONFIG+=("${FILE}")
|
||||
# jscpd also runs an all files
|
||||
|
|
|
@ -47,26 +47,6 @@ function LintCodebase() {
|
|||
|
||||
debug "SKIP_FLAG: ${SKIP_FLAG}, list of files to lint: ${LIST_FILES[*]}"
|
||||
|
||||
#################################################
|
||||
# Filter files if FILTER_REGEX_INCLUDE is set #
|
||||
#################################################
|
||||
if [[ -n "$FILTER_REGEX_INCLUDE" ]]; then
|
||||
for index in "${!LIST_FILES[@]}"; do
|
||||
[[ ! (${LIST_FILES[$index]} =~ $FILTER_REGEX_INCLUDE) ]] && unset -v 'LIST_FILES[$index]'
|
||||
done
|
||||
debug "List of files to lint after FILTER_REGEX_INCLUDE: ${LIST_FILES[*]}"
|
||||
fi
|
||||
|
||||
#################################################
|
||||
# Filter files if FILTER_REGEX_EXCLUDE is set #
|
||||
#################################################
|
||||
if [[ -n "$FILTER_REGEX_EXCLUDE" ]]; then
|
||||
for index in "${!LIST_FILES[@]}"; do
|
||||
[[ ${LIST_FILES[$index]} =~ $FILTER_REGEX_EXCLUDE ]] && unset -v 'LIST_FILES[$index]'
|
||||
done
|
||||
debug "List of files to lint after FILTER_REGEX_EXCLUDE: ${LIST_FILES[*]}"
|
||||
fi
|
||||
|
||||
###############################
|
||||
# Check if any data was found #
|
||||
###############################
|
||||
|
|
Loading…
Reference in a new issue