From 69d5c91cb166fd816687a77a152e794965a7500e Mon Sep 17 00:00:00 2001 From: Gabo Date: Mon, 6 Jul 2020 19:20:05 -0500 Subject: [PATCH 1/3] Add special case for editor config --- lib/validation.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/validation.sh b/lib/validation.sh index ba01368b..963ab7db 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -75,6 +75,12 @@ function GetValidationInfo() { VALIDATE_EDITORCONFIG=$(echo "$VALIDATE_EDITORCONFIG" | awk '{print tolower($0)}') VALIDATE_HTML=$(echo "$VALIDATE_HTML" | awk '{print tolower($0)}') + ############################# + # Editorconfig special case # + ############################# + LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory + EDITORCONFIG_FILE_NAME='.editorconfig' + ################################################ # Determine if any linters were explicitly set # ################################################ @@ -484,10 +490,13 @@ function GetValidationInfo() { VALIDATE_EDITORCONFIG="false" fi else - # No linter flags were set - default all to true - VALIDATE_EDITORCONFIG="true" + # No linter flags were set + # special case cehcking for .editorconfig + if [ -f "$GITHUB_WORKSPACE/$LINTER_RULES_PATH/$EDITORCONFIG_FILE_NAME" ]; then + VALIDATE_EDITORCONFIG="true" + fi fi - + #################################### # Validate if we should check HTML # #################################### From 8884ea722b227b793d180692d5cfb48db53dc4aa Mon Sep 17 00:00:00 2001 From: Gabo Date: Tue, 7 Jul 2020 09:18:04 -0500 Subject: [PATCH 2/3] Don't use linter rules path --- lib/validation.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/validation.sh b/lib/validation.sh index 963ab7db..03ccb310 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -75,12 +75,6 @@ function GetValidationInfo() { VALIDATE_EDITORCONFIG=$(echo "$VALIDATE_EDITORCONFIG" | awk '{print tolower($0)}') VALIDATE_HTML=$(echo "$VALIDATE_HTML" | awk '{print tolower($0)}') - ############################# - # Editorconfig special case # - ############################# - LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory - EDITORCONFIG_FILE_NAME='.editorconfig' - ################################################ # Determine if any linters were explicitly set # ################################################ @@ -491,8 +485,8 @@ function GetValidationInfo() { fi else # No linter flags were set - # special case cehcking for .editorconfig - if [ -f "$GITHUB_WORKSPACE/$LINTER_RULES_PATH/$EDITORCONFIG_FILE_NAME" ]; then + # special case checking for .editorconfig + if [ -f "$GITHUB_WORKSPACE/.editorconfig" ]; then VALIDATE_EDITORCONFIG="true" fi fi From 294e4024aed7039d46dbc84bdcf938c0eab4742c Mon Sep 17 00:00:00 2001 From: Gabo Date: Tue, 7 Jul 2020 09:21:25 -0500 Subject: [PATCH 3/3] Remove unneeded line --- lib/linter.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index d06d44cc..b04aa9dc 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1135,7 +1135,6 @@ fi ######################## # EDITORCONFIG LINTING # ######################## -echo ed: "$VALIDATE_EDITORCONFIG" if [ "$VALIDATE_EDITORCONFIG" == "true" ]; then #################################### # Lint the files with editorconfig #