From 1312a3a3e482f7af2a9e77c223cb3dfd255c39a9 Mon Sep 17 00:00:00 2001 From: Michael Shimokura Date: Thu, 8 Oct 2020 15:27:47 -0400 Subject: [PATCH 1/5] use the .ecrc file --- README.md | 1 + lib/linter.sh | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 84fe50d3..4c924a60 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,7 @@ But if you wish to select or exclude specific linters, we give you full control | **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | | **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | | **DOCKERFILE_HADOLINT_FILE_NAME** | `.hadolint.yml` | Filename for [hadolint configuration](https://github.com/hadolint/hadolint) (ex: `.hadolintlintrc.yaml`) | +| **EDITORCONFIG_FILE_NAME** | `.ecrc` | Filename for [editorconfig-checker configuration](https://github.com/editorconfig-checker/) | | **ERROR_ON_MISSING_EXEC_BIT** | `false` | If set to `false`, the `bash-exec` linter will report a warning if a shell script is not executable. If set to `true`, the `bash-exec` linter will report an arror instead. | | **FILTER_REGEX_EXCLUDE** | `none` | Regular expression defining which files will be excluded from linting (ex: `.*src/test.*`) | | **FILTER_REGEX_INCLUDE** | `all` | Regular expression defining which files will be processed by linters (ex: `.*src/.*`) | diff --git a/lib/linter.sh b/lib/linter.sh index 38d4f361..77713abe 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -76,6 +76,9 @@ DOCKERFILE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKERFILE_FILE_NAME}" # Pa # Dockerfile Hadolint Vars DOCKERFILE_HADOLINT_FILE_NAME="${DOCKERFILE_HADOLINT_FILE_NAME:-.hadolint.yml}" # Name of the file DOCKERFILE_HADOLINT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKERFILE_HADOLINT_FILE_NAME}" # Path to the Docker lint rules +# Editorconfig Vars +EDITORCONFIG_FILE_NAME='.ecrc' # Name of the file +EDITORCONFIG_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${EDITORCONFIG_FILE_NAME}" # Path to the Editorconfig lint rules # Golang Vars GO_FILE_NAME='.golangci.yml' # Name of the file GO_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${GO_FILE_NAME}" # Path to the Go lint rules @@ -1237,7 +1240,7 @@ if [ "${VALIDATE_EDITORCONFIG}" == "true" ]; then #################################### # Lint the files with editorconfig # #################################### - LintCodebase "EDITORCONFIG" "editorconfig-checker" "editorconfig-checker" "${FILTER_REGEX_INCLUDE}" "${FILTER_REGEX_EXCLUDE}" "${FILE_ARRAY_EDITORCONFIG[@]}" + LintCodebase "EDITORCONFIG" "editorconfig-checker" "editorconfig-checker -config ${EDITORCONFIG_LINTER_RULES}" "${FILTER_REGEX_INCLUDE}" "${FILTER_REGEX_EXCLUDE}" "${FILE_ARRAY_EDITORCONFIG[@]}" fi ############### From 6271f5f35096c02c394913b966c8ca50f5da0cec Mon Sep 17 00:00:00 2001 From: Michael Shimokura Date: Thu, 8 Oct 2020 16:10:44 -0400 Subject: [PATCH 2/5] fix README link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c924a60..81857255 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ But if you wish to select or exclude specific linters, we give you full control | **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | | **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | | **DOCKERFILE_HADOLINT_FILE_NAME** | `.hadolint.yml` | Filename for [hadolint configuration](https://github.com/hadolint/hadolint) (ex: `.hadolintlintrc.yaml`) | -| **EDITORCONFIG_FILE_NAME** | `.ecrc` | Filename for [editorconfig-checker configuration](https://github.com/editorconfig-checker/) | +| **EDITORCONFIG_FILE_NAME** | `.ecrc` | Filename for [editorconfig-checker configuration](https://github.com/editorconfig-checker/editorconfig-checker) | | **ERROR_ON_MISSING_EXEC_BIT** | `false` | If set to `false`, the `bash-exec` linter will report a warning if a shell script is not executable. If set to `true`, the `bash-exec` linter will report an arror instead. | | **FILTER_REGEX_EXCLUDE** | `none` | Regular expression defining which files will be excluded from linting (ex: `.*src/test.*`) | | **FILTER_REGEX_INCLUDE** | `all` | Regular expression defining which files will be processed by linters (ex: `.*src/.*`) | From cd4798ea04253dfde7619b967c41faded90da270 Mon Sep 17 00:00:00 2001 From: Michael Shimokura Date: Thu, 8 Oct 2020 16:17:29 -0400 Subject: [PATCH 3/5] only assign EDITORCONFIG_FILE_NAME if not already assigned --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index 77713abe..86611690 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -77,7 +77,7 @@ DOCKERFILE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKERFILE_FILE_NAME}" # Pa DOCKERFILE_HADOLINT_FILE_NAME="${DOCKERFILE_HADOLINT_FILE_NAME:-.hadolint.yml}" # Name of the file DOCKERFILE_HADOLINT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKERFILE_HADOLINT_FILE_NAME}" # Path to the Docker lint rules # Editorconfig Vars -EDITORCONFIG_FILE_NAME='.ecrc' # Name of the file +EDITORCONFIG_FILE_NAME="${EDITORCONFIG_FILE_NAME:-.ecrc}" # Name of the file EDITORCONFIG_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${EDITORCONFIG_FILE_NAME}" # Path to the Editorconfig lint rules # Golang Vars GO_FILE_NAME='.golangci.yml' # Name of the file From 23a463867d9f56f382d7277e47097a6a55e456f6 Mon Sep 17 00:00:00 2001 From: Michael Shimokura Date: Fri, 9 Oct 2020 09:02:12 -0400 Subject: [PATCH 4/5] rename the variable to EDITORCONFIG_CHECKER_FILE_NAME for clarity --- README.md | 2 +- lib/linter.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 81857255..dd62dad1 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ But if you wish to select or exclude specific linters, we give you full control | **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | | **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | | **DOCKERFILE_HADOLINT_FILE_NAME** | `.hadolint.yml` | Filename for [hadolint configuration](https://github.com/hadolint/hadolint) (ex: `.hadolintlintrc.yaml`) | -| **EDITORCONFIG_FILE_NAME** | `.ecrc` | Filename for [editorconfig-checker configuration](https://github.com/editorconfig-checker/editorconfig-checker) | +| **EDITORCONFIG_CHECKER_FILE_NAME**| `.ecrc` | Filename for [editorconfig-checker configuration](https://github.com/editorconfig-checker/editorconfig-checker) | | **ERROR_ON_MISSING_EXEC_BIT** | `false` | If set to `false`, the `bash-exec` linter will report a warning if a shell script is not executable. If set to `true`, the `bash-exec` linter will report an arror instead. | | **FILTER_REGEX_EXCLUDE** | `none` | Regular expression defining which files will be excluded from linting (ex: `.*src/test.*`) | | **FILTER_REGEX_INCLUDE** | `all` | Regular expression defining which files will be processed by linters (ex: `.*src/.*`) | diff --git a/lib/linter.sh b/lib/linter.sh index 86611690..a7bb4881 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -77,8 +77,8 @@ DOCKERFILE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKERFILE_FILE_NAME}" # Pa DOCKERFILE_HADOLINT_FILE_NAME="${DOCKERFILE_HADOLINT_FILE_NAME:-.hadolint.yml}" # Name of the file DOCKERFILE_HADOLINT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKERFILE_HADOLINT_FILE_NAME}" # Path to the Docker lint rules # Editorconfig Vars -EDITORCONFIG_FILE_NAME="${EDITORCONFIG_FILE_NAME:-.ecrc}" # Name of the file -EDITORCONFIG_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${EDITORCONFIG_FILE_NAME}" # Path to the Editorconfig lint rules +EDITORCONFIG_CHECKER_FILE_NAME="${EDITORCONFIG_CHECKER_FILE_NAME:-.ecrc}" # Name of the file +EDITORCONFIG_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${EDITORCONFIG_CHECKER_FILE_NAME}" # Path to the Editorconfig lint rules # Golang Vars GO_FILE_NAME='.golangci.yml' # Name of the file GO_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${GO_FILE_NAME}" # Path to the Go lint rules From a5cada70f874be6fd70f8f780672d3cc2c645ba8 Mon Sep 17 00:00:00 2001 From: Michael Shimokura Date: Fri, 9 Oct 2020 09:13:37 -0400 Subject: [PATCH 5/5] Revert "rename the variable to EDITORCONFIG_CHECKER_FILE_NAME for clarity" This reverts commit 23a463867d9f56f382d7277e47097a6a55e456f6. --- README.md | 2 +- lib/linter.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dd62dad1..81857255 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ But if you wish to select or exclude specific linters, we give you full control | **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | | **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | | **DOCKERFILE_HADOLINT_FILE_NAME** | `.hadolint.yml` | Filename for [hadolint configuration](https://github.com/hadolint/hadolint) (ex: `.hadolintlintrc.yaml`) | -| **EDITORCONFIG_CHECKER_FILE_NAME**| `.ecrc` | Filename for [editorconfig-checker configuration](https://github.com/editorconfig-checker/editorconfig-checker) | +| **EDITORCONFIG_FILE_NAME** | `.ecrc` | Filename for [editorconfig-checker configuration](https://github.com/editorconfig-checker/editorconfig-checker) | | **ERROR_ON_MISSING_EXEC_BIT** | `false` | If set to `false`, the `bash-exec` linter will report a warning if a shell script is not executable. If set to `true`, the `bash-exec` linter will report an arror instead. | | **FILTER_REGEX_EXCLUDE** | `none` | Regular expression defining which files will be excluded from linting (ex: `.*src/test.*`) | | **FILTER_REGEX_INCLUDE** | `all` | Regular expression defining which files will be processed by linters (ex: `.*src/.*`) | diff --git a/lib/linter.sh b/lib/linter.sh index a7bb4881..86611690 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -77,8 +77,8 @@ DOCKERFILE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKERFILE_FILE_NAME}" # Pa DOCKERFILE_HADOLINT_FILE_NAME="${DOCKERFILE_HADOLINT_FILE_NAME:-.hadolint.yml}" # Name of the file DOCKERFILE_HADOLINT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKERFILE_HADOLINT_FILE_NAME}" # Path to the Docker lint rules # Editorconfig Vars -EDITORCONFIG_CHECKER_FILE_NAME="${EDITORCONFIG_CHECKER_FILE_NAME:-.ecrc}" # Name of the file -EDITORCONFIG_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${EDITORCONFIG_CHECKER_FILE_NAME}" # Path to the Editorconfig lint rules +EDITORCONFIG_FILE_NAME="${EDITORCONFIG_FILE_NAME:-.ecrc}" # Name of the file +EDITORCONFIG_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${EDITORCONFIG_FILE_NAME}" # Path to the Editorconfig lint rules # Golang Vars GO_FILE_NAME='.golangci.yml' # Name of the file GO_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${GO_FILE_NAME}" # Path to the Go lint rules