feat(config): Add support for LINTER_PATH param

To add support for LINT_PATH param. This will make super-lint more
usable for existing projects, which might have lint rule file in
other location. The default value is still .github/lints.

Closes #161
This commit is contained in:
sayboras 2020-06-19 15:11:54 +10:00
parent 9537bb5051
commit 21c3bb86e9
No known key found for this signature in database
GPG key ID: DA92B5F6DAB046CD
3 changed files with 13 additions and 0 deletions

View file

@ -116,6 +116,7 @@ ENV GITHUB_SHA=${GITHUB_SHA} \
GITHUB_WORKSPACE=${GITHUB_WORKSPACE} \
DEFAULT_BRANCH=${DEFAULT_BRANCH} \
VALIDATE_ALL_CODEBASE=${VALIDATE_ALL_CODEBASE} \
LINTER_PATH=${LINTER_PATH} \
VALIDATE_YAML=${VALIDATE_YAML} \
VALIDATE_JSON=${VALIDATE_JSON} \
VALIDATE_XML=${VALIDATE_XML} \

View file

@ -118,6 +118,7 @@ and won't run anything unexpected.
| --- | --- | --- |
| **VALIDATE_ALL_CODEBASE** | `true` | Will parse the entire repository and find all files to validate across all types. **NOTE:** When set to `false`, only **new** or **edited** files will be parsed for validation. |
| **DEFAULT_BRANCH** | `master` | The name of the repository default branch. |
| **LINTER_PATH** | `.github/linters` | Directory for all linter configuration rules. |
| **VALIDATE_YAML** | `true` |Flag to enable or disable the linting process of the language. |
| **VALIDATE_JSON** | `true` | Flag to enable or disable the linting process of the language. |
| **VALIDATE_XML** | `true` | Flag to enable or disable the linting process of the language. |

View file

@ -98,6 +98,7 @@ VALIDATE_CSS="${VALIDATE_CSS}" # Boolean to validate lang
VALIDATE_ENV="${VALIDATE_ENV}" # Boolean to validate language
TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases
DISABLE_ERRORS="${DISABLE_ERRORS}" # Boolean to enable warning-only output without throwing errors
LINTER_PATH="${LINTER_PATH}" # Linter Path Directory
##############
# Debug Vars #
@ -569,6 +570,16 @@ GetGitHubVars()
###############################
TEST_CASE_RUN=$(echo "$TEST_CASE_RUN" | awk '{print tolower($0)}')
#####################################
# Get the Linter path #
#####################################
if [ -z "$LINTER_PATH" ]; then
###################################
# No flag passed, set to default #
###################################
LINTER_PATH="$DEFAULT_LINTER_PATH"
fi
##########################
# Get the run local flag #
##########################