diff --git a/README.md b/README.md index e5229424..d81dd733 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,7 @@ But if you wish to select or exclude specific linters, we give you full control | **TYPESCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [ESLint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) | | **USE_FIND_ALGORITHM** | `false` | By default, we use `git diff` to find all files in the workspace and what has been updated, this would enable the Linux `find` method instead to find all files to lint | | **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. | -| **VALIDATE_JSCPD_ALL_CODEBASE** | `false` | If set to `true`, will lint the whole codebase with JSCPD, in addition to linting files with JSCPD one by one. If set to `false`, JSCPD will only lint files one by one. | +| **VALIDATE_JSCPD_ALL_CODEBASE** | `false` | If set to `true`, will lint the whole codebase with JSCPD. If set to `false`, JSCPD will only lint files one by one. | | **VALIDATE_ANSIBLE** | `true` | Flag to enable or disable the linting process of the Ansible language. | | **VALIDATE_ARM** | `true` | Flag to enable or disable the linting process of the ARM language. | | **VALIDATE_BASH** | `true` | Flag to enable or disable the linting process of the Bash language. | diff --git a/lib/functions/buildFileList.sh b/lib/functions/buildFileList.sh index 43d68dec..5a64e9da 100755 --- a/lib/functions/buildFileList.sh +++ b/lib/functions/buildFileList.sh @@ -316,8 +316,13 @@ function BuildFileList() { # Editorconfig-checker should check every file FILE_ARRAY_EDITORCONFIG+=("${FILE}") - # jscpd also runs an all files - FILE_ARRAY_JSCPD+=("${FILE}") + + if [ "${VALIDATE_JSCPD_ALL_CODEBASE}" == "true" ]; then + debug "Not adding ${FILE} to FILE_ARRAY_JSCPD because we're going to lint the whole codebase anyway." + else + # jscpd also runs an all files + FILE_ARRAY_JSCPD+=("${FILE}") + fi # Need to make sure we dont check the secrets paterns # for secrets, as it will pop! if [ "${BASE_FILE}" != ".gitleaks.toml" ]; then