From ddbc96bd23afb1333eacb0005555323adde8973d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 23 Jun 2020 15:25:12 +0100 Subject: [PATCH 01/96] Support TAP reporting format --- .gitignore | 3 +++ Dockerfile | 4 +++- README.md | 2 ++ lib/linter.sh | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ad46b308..26f92ccf 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,6 @@ typings/ # next.js build output .next + +# default output report +super-linter.report \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 78f9aea8..50b13f30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -171,7 +171,9 @@ ENV GITHUB_SHA=${GITHUB_SHA} \ RUN_LOCAL=${RUN_LOCAL} \ TEST_CASE_RUN=${TEST_CASE_RUN} \ ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ - DISABLE_ERRORS=${DISABLE_ERRORS} + DISABLE_ERRORS=${DISABLE_ERRORS} \ + OUTPUT_FORMAT=${OUTPUT_FORMAT} \ + OUTPUT_FOLDER=${OUTPUT_FOLDER} ############################# # Copy scripts to container # diff --git a/README.md b/README.md index 5cc133b3..db767737 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,8 @@ and won't run anything unexpected. | **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | | **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | | **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | +| **OUTPUT_FORMAT** | `` | The report format to be generated, besides the stdout one. Supported formats: tap | +| **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. | ### Template rules files You can use the **GitHub** **Super-Linter** *with* or *without* your own personal rules sets. This allows for greater flexibility for each individual code base. The Template rules all try to follow the standards we believe should be enabled at the basic level. diff --git a/lib/linter.sh b/lib/linter.sh index 862adf9a..12826889 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -125,6 +125,13 @@ READ_ONLY_CHANGE_FLAG=0 # Flag set to 1 if files c TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors +############## +# Format # +############## +OUTPUT_FORMAT="${OUTPUT_FORMAT}" # Output format to be generated. Default none +OUTPUT_FOLDER="${OUTPUT_FOLDER:-super-linter.report}" # Folder where the reports are generated. Default super-linter.report +REPORT_OUTPUT_FOLDER="${DEFAULT_WORKSPACE}/${OUTPUT_FOLDER}" + ########################## # Array of changed files # ########################## @@ -1782,6 +1789,16 @@ LintCodebase() echo "$LINE" done + #################################### + # Prepare context if OUTPUT_FORMAT # + #################################### + if [ -n "${OUTPUT_FORMAT}" ] ; then + TMPFILE=$(mktemp -q /tmp/super-linter.XXXXXX) + INDEX=0 + mkdir -p "${REPORT_OUTPUT_FOLDER}" + REPORT_OUTPUT_FILE="${REPORT_OUTPUT_FOLDER}/super-linter-${FILE_TYPE}.${OUTPUT_FORMAT}" + fi + ################## # Lint the files # ################## @@ -1803,6 +1820,8 @@ LintCodebase() continue fi + (("INDEX++")) + ############## # File print # ############## @@ -1846,13 +1865,37 @@ LintCodebase() echo "ERROR:[$LINT_CMD]" # Increment the error count (("ERRORS_FOUND_$FILE_TYPE++")) + + ####################################################### + # Store the linting as a temporary file in TAP format # + ####################################################### + if [ -n "${OUTPUT_FORMAT}" ] ; then + echo "nok ok ${INDEX} - ${FILE}" >> "${TMPFILE}" + echo " ERROR:[$LINT_CMD]" >> "${TMPFILE}" + fi + else ########### # Success # ########### echo " - File:[$FILE_NAME] was linted with [$LINTER_NAME] successfully" + + ####################################################### + # Store the linting as a temporary file in TAP format # + ####################################################### + if [ -n "${OUTPUT_FORMAT}" ] ; then + echo "ok ${INDEX} - ${FILE}" >> "${TMPFILE}" + fi fi done + + ################################# + # Generate report in TAP format # + ################################# + if [ -n "${OUTPUT_FORMAT}" ] && [ ${INDEX} -gt 0 ] ; then + echo "1..${INDEX}" > "${REPORT_OUTPUT_FILE}" + cat "${TMPFILE}" >> "${REPORT_OUTPUT_FILE}" + fi fi } ################################################################################ @@ -2073,6 +2116,14 @@ Footer() echo "----------------------------------------------" echo "" + + ################################### + # Prints output report if enabled # + ################################### + if [ -z "${FORMAT_REPORT}" ] ; then + echo "Reports generated in folder ${REPORT_OUTPUT_FOLDER}" + fi + ############################## # Prints for errors if found # ############################## @@ -2201,6 +2252,17 @@ RunTestCases() ########## Header +############################################################## +# check flag for validating the report folder does not exist # +############################################################## +if [ -n "${OUTPUT_FORMAT}" ]; then + if [ -d "${REPORT_OUTPUT_FOLDER}" ] ; then + echo "ERROR! Found ${REPORT_OUTPUT_FOLDER}" + echo "Please remove the folder and try again." + exit 1 + fi +fi + ####################### # Get GitHub Env Vars # ####################### From 40687fc6db845f5bdec8d46c8a6e3cac5b8b799e Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 23 Jun 2020 15:40:43 +0100 Subject: [PATCH 02/96] Enable ansible linter in TAP format --- lib/linter.sh | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index 12826889..73c632c6 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -497,6 +497,16 @@ LintAnsibleFiles() done fi + #################################### + # Prepare context if OUTPUT_FORMAT # + #################################### + if [ -n "${OUTPUT_FORMAT}" ] ; then + TMPFILE=$(mktemp -q "/tmp/super-linter-${FILE_TYPE}.XXXXXX") + INDEX=0 + mkdir -p "${REPORT_OUTPUT_FOLDER}" + REPORT_OUTPUT_FILE="${REPORT_OUTPUT_FOLDER}/super-linter-${FILE_TYPE}.${OUTPUT_FORMAT}" + fi + ################## # Lint the files # ################## @@ -511,6 +521,11 @@ LintAnsibleFiles() continue fi + ################################## + # Increase the linted file index # + ################################## + (("INDEX++")) + #################### # Get the filename # #################### @@ -543,13 +558,37 @@ LintAnsibleFiles() echo "ERROR:[$LINT_CMD]" # Increment error count ((ERRORS_FOUND_ANSIBLE++)) + + ####################################################### + # Store the linting as a temporary file in TAP format # + ####################################################### + if [ -n "${OUTPUT_FORMAT}" ] ; then + echo "nok ok ${INDEX} - ${FILE}" >> "${TMPFILE}" + echo " ERROR:[$LINT_CMD]" >> "${TMPFILE}" + fi else ########### # Success # ########### echo " - File:[$FILE_NAME] was linted with [$LINTER_NAME] successfully" + + ####################################################### + # Store the linting as a temporary file in TAP format # + ####################################################### + if [ -n "${OUTPUT_FORMAT}" ] ; then + echo "ok ${INDEX} - ${FILE}" >> "${TMPFILE}" + fi fi done + + ################################# + # Generate report in TAP format # + ################################# + if [ -n "${OUTPUT_FORMAT}" ] && [ ${INDEX} -gt 0 ] ; then + echo "1..${INDEX}" > "${REPORT_OUTPUT_FILE}" + cat "${TMPFILE}" >> "${REPORT_OUTPUT_FILE}" + fi + else # No ansible directory found in path ############################### # Check to see if debug is on # @@ -1793,7 +1832,7 @@ LintCodebase() # Prepare context if OUTPUT_FORMAT # #################################### if [ -n "${OUTPUT_FORMAT}" ] ; then - TMPFILE=$(mktemp -q /tmp/super-linter.XXXXXX) + TMPFILE=$(mktemp -q "/tmp/super-linter-${FILE_TYPE}.XXXXXX") INDEX=0 mkdir -p "${REPORT_OUTPUT_FOLDER}" REPORT_OUTPUT_FILE="${REPORT_OUTPUT_FOLDER}/super-linter-${FILE_TYPE}.${OUTPUT_FORMAT}" @@ -1820,6 +1859,9 @@ LintCodebase() continue fi + ################################## + # Increase the linted file index # + ################################## (("INDEX++")) ############## From 6b1635490139cb104fcc205ac67b8c8b86d47c9a Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 24 Jun 2020 22:45:44 +0100 Subject: [PATCH 03/96] TAP Format --- lib/linter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 73c632c6..9f7a8c96 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -564,7 +564,7 @@ LintAnsibleFiles() ####################################################### if [ -n "${OUTPUT_FORMAT}" ] ; then echo "nok ok ${INDEX} - ${FILE}" >> "${TMPFILE}" - echo " ERROR:[$LINT_CMD]" >> "${TMPFILE}" + printf " ---\n but:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" fi else ########### @@ -1913,7 +1913,7 @@ LintCodebase() ####################################################### if [ -n "${OUTPUT_FORMAT}" ] ; then echo "nok ok ${INDEX} - ${FILE}" >> "${TMPFILE}" - echo " ERROR:[$LINT_CMD]" >> "${TMPFILE}" + printf " ---\n but:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" fi else From c26c3ddf8eb19d85b9de1165e21ad4097781e0bf Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 24 Jun 2020 22:49:12 +0100 Subject: [PATCH 04/96] TAP 13 specification See https://testanything.org/tap-version-13-specification.html --- lib/linter.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 9f7a8c96..32604fb9 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -564,7 +564,7 @@ LintAnsibleFiles() ####################################################### if [ -n "${OUTPUT_FORMAT}" ] ; then echo "nok ok ${INDEX} - ${FILE}" >> "${TMPFILE}" - printf " ---\n but:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" + printf " ---\n message:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" fi else ########### @@ -585,7 +585,7 @@ LintAnsibleFiles() # Generate report in TAP format # ################################# if [ -n "${OUTPUT_FORMAT}" ] && [ ${INDEX} -gt 0 ] ; then - echo "1..${INDEX}" > "${REPORT_OUTPUT_FILE}" + printf "TAP version 13\n1..%s" "${INDEX}" > "${REPORT_OUTPUT_FILE}" cat "${TMPFILE}" >> "${REPORT_OUTPUT_FILE}" fi @@ -1913,7 +1913,7 @@ LintCodebase() ####################################################### if [ -n "${OUTPUT_FORMAT}" ] ; then echo "nok ok ${INDEX} - ${FILE}" >> "${TMPFILE}" - printf " ---\n but:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" + printf " ---\n message:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" fi else @@ -1935,7 +1935,7 @@ LintCodebase() # Generate report in TAP format # ################################# if [ -n "${OUTPUT_FORMAT}" ] && [ ${INDEX} -gt 0 ] ; then - echo "1..${INDEX}" > "${REPORT_OUTPUT_FILE}" + printf "TAP version 13\n1..%s" "${INDEX}" > "${REPORT_OUTPUT_FILE}" cat "${TMPFILE}" >> "${REPORT_OUTPUT_FILE}" fi fi From dd3a792f27ae1a8c3e33b12e4d1b0621e118254b Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 24 Jun 2020 22:58:45 +0100 Subject: [PATCH 05/96] Use isTap function and fix the output format --- lib/linter.sh | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 32604fb9..a48f8bbe 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -500,7 +500,7 @@ LintAnsibleFiles() #################################### # Prepare context if OUTPUT_FORMAT # #################################### - if [ -n "${OUTPUT_FORMAT}" ] ; then + if IsTAP ; then TMPFILE=$(mktemp -q "/tmp/super-linter-${FILE_TYPE}.XXXXXX") INDEX=0 mkdir -p "${REPORT_OUTPUT_FOLDER}" @@ -562,7 +562,7 @@ LintAnsibleFiles() ####################################################### # Store the linting as a temporary file in TAP format # ####################################################### - if [ -n "${OUTPUT_FORMAT}" ] ; then + if IsTAP ; then echo "nok ok ${INDEX} - ${FILE}" >> "${TMPFILE}" printf " ---\n message:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" fi @@ -575,7 +575,7 @@ LintAnsibleFiles() ####################################################### # Store the linting as a temporary file in TAP format # ####################################################### - if [ -n "${OUTPUT_FORMAT}" ] ; then + if IsTAP ; then echo "ok ${INDEX} - ${FILE}" >> "${TMPFILE}" fi fi @@ -584,8 +584,8 @@ LintAnsibleFiles() ################################# # Generate report in TAP format # ################################# - if [ -n "${OUTPUT_FORMAT}" ] && [ ${INDEX} -gt 0 ] ; then - printf "TAP version 13\n1..%s" "${INDEX}" > "${REPORT_OUTPUT_FILE}" + if IsTAP && [ ${INDEX} -gt 0 ] ; then + printf "TAP version 13\n1..%s\n" "${INDEX}" > "${REPORT_OUTPUT_FILE}" cat "${TMPFILE}" >> "${REPORT_OUTPUT_FILE}" fi @@ -1831,7 +1831,7 @@ LintCodebase() #################################### # Prepare context if OUTPUT_FORMAT # #################################### - if [ -n "${OUTPUT_FORMAT}" ] ; then + if IsTAP ; then TMPFILE=$(mktemp -q "/tmp/super-linter-${FILE_TYPE}.XXXXXX") INDEX=0 mkdir -p "${REPORT_OUTPUT_FOLDER}" @@ -1911,7 +1911,7 @@ LintCodebase() ####################################################### # Store the linting as a temporary file in TAP format # ####################################################### - if [ -n "${OUTPUT_FORMAT}" ] ; then + if IsTAP ; then echo "nok ok ${INDEX} - ${FILE}" >> "${TMPFILE}" printf " ---\n message:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" fi @@ -1925,7 +1925,7 @@ LintCodebase() ####################################################### # Store the linting as a temporary file in TAP format # ####################################################### - if [ -n "${OUTPUT_FORMAT}" ] ; then + if IsTAP ; then echo "ok ${INDEX} - ${FILE}" >> "${TMPFILE}" fi fi @@ -1934,8 +1934,8 @@ LintCodebase() ################################# # Generate report in TAP format # ################################# - if [ -n "${OUTPUT_FORMAT}" ] && [ ${INDEX} -gt 0 ] ; then - printf "TAP version 13\n1..%s" "${INDEX}" > "${REPORT_OUTPUT_FILE}" + if IsTAP && [ ${INDEX} -gt 0 ] ; then + printf "TAP version 13\n1..%s\n" "${INDEX}" > "${REPORT_OUTPUT_FILE}" cat "${TMPFILE}" >> "${REPORT_OUTPUT_FILE}" fi fi @@ -2286,6 +2286,16 @@ RunTestCases() Footer } ################################################################################ +#### Function IsTap ############################################################ +IsTAP() +{ + if [ "${OUTPUT_FORMAT}" == "tap" ] ; then + return 0 + else + return 1 + fi +} +################################################################################ ############################### MAIN ########################################### ################################################################################ From 030c23766fcfbbe1ae4b4f4d08aa5f665be9e036 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 29 Jun 2020 07:48:51 +0100 Subject: [PATCH 06/96] fix: typo --- lib/linter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index a48f8bbe..ac5929dc 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -563,7 +563,7 @@ LintAnsibleFiles() # Store the linting as a temporary file in TAP format # ####################################################### if IsTAP ; then - echo "nok ok ${INDEX} - ${FILE}" >> "${TMPFILE}" + echo "not ok ${INDEX} - ${FILE}" >> "${TMPFILE}" printf " ---\n message:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" fi else @@ -1912,7 +1912,7 @@ LintCodebase() # Store the linting as a temporary file in TAP format # ####################################################### if IsTAP ; then - echo "nok ok ${INDEX} - ${FILE}" >> "${TMPFILE}" + echo "not ok ${INDEX} - ${FILE}" >> "${TMPFILE}" printf " ---\n message:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" fi From 407f411e21af54f9802b11053e75ec44e94a5c14 Mon Sep 17 00:00:00 2001 From: Casey Vega Date: Mon, 6 Jul 2020 01:17:20 -0700 Subject: [PATCH 07/96] adding dart support --- .automation/test/dart/README.md | 13 ++++++ .automation/test/dart/dart_bad_1.dart | 6 +++ .automation/test/dart/dart_good_1.dart | 6 +++ .github/linters/.dart-lint.yml | 57 ++++++++++++++++++++++++++ Dockerfile | 9 ++++ README.md | 2 + docs/disabling-linters.md | 29 +++++++++++++ lib/buildFileList.sh | 9 ++++ lib/linter.sh | 25 +++++++++-- lib/validation.sh | 22 +++++++++- lib/worker.sh | 1 + 11 files changed, 175 insertions(+), 4 deletions(-) create mode 100644 .automation/test/dart/README.md create mode 100644 .automation/test/dart/dart_bad_1.dart create mode 100644 .automation/test/dart/dart_good_1.dart create mode 100644 .github/linters/.dart-lint.yml diff --git a/.automation/test/dart/README.md b/.automation/test/dart/README.md new file mode 100644 index 00000000..21299b50 --- /dev/null +++ b/.automation/test/dart/README.md @@ -0,0 +1,13 @@ +# Dart Test Cases +This folder holds the test cases for **Dart**. + +## Additional Docs +No Additional information is needed for this test case. + +## Good Test Cases +The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. +- **Note:** They are linted utilizing the default linter rules. + +## Bad Test Cases +The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. +- **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/dart/dart_bad_1.dart b/.automation/test/dart/dart_bad_1.dart new file mode 100644 index 00000000..55ef95a4 --- /dev/null +++ b/.automation/test/dart/dart_bad_1.dart @@ -0,0 +1,6 @@ +// empty_constructor_bodies bad {} + +class Point { + int x, y; + Point(this.x, this.y) {} +} diff --git a/.automation/test/dart/dart_good_1.dart b/.automation/test/dart/dart_good_1.dart new file mode 100644 index 00000000..d336bbef --- /dev/null +++ b/.automation/test/dart/dart_good_1.dart @@ -0,0 +1,6 @@ +// empty_constructor_bodies good ; + +class Point { + int x, y; + Point(this.x, this.y); +} diff --git a/.github/linters/.dart-lint.yml b/.github/linters/.dart-lint.yml new file mode 100644 index 00000000..0c444f44 --- /dev/null +++ b/.github/linters/.dart-lint.yml @@ -0,0 +1,57 @@ +--- +########################## +########################## +## Dart Linter rules ## +########################## +########################## + +# Pedantic Rules +# https://github.com/dart-lang/pedantic + +linter: + rules: + - always_declare_return_types + - always_require_non_null_named_parameters + - annotate_overrides + - avoid_empty_else + - avoid_init_to_null + - avoid_null_checks_in_equality_operators + - avoid_relative_lib_imports + - avoid_return_types_on_setters + - avoid_shadowing_type_parameters + - avoid_types_as_parameter_names + - camel_case_extensions + - curly_braces_in_flow_control_structures + - empty_catches + - empty_constructor_bodies + - library_names + - library_prefixes + - no_duplicate_case_values + - null_closures + - omit_local_variable_types + - prefer_adjacent_string_concatenation + - prefer_collection_literals + - prefer_conditional_assignment + - prefer_contains + - prefer_equal_for_default_values + - prefer_final_fields + - prefer_for_elements_to_map_fromIterable + - prefer_generic_function_type_aliases + - prefer_if_null_operators + - prefer_is_empty + - prefer_is_not_empty + - prefer_iterable_whereType + - prefer_single_quotes + - prefer_spread_collections + - recursive_getters + - slash_for_doc_comments + - type_init_formals + - unawaited_futures + - unnecessary_const + - unnecessary_new + - unnecessary_null_in_if_null_operators + - unnecessary_this + - unrelated_type_equality_checks + - use_function_type_syntax_for_parameters + - use_rethrow_when_possible + - valid_regexps diff --git a/Dockerfile b/Dockerfile index 56bc44a8..171ee259 100644 --- a/Dockerfile +++ b/Dockerfile @@ -159,6 +159,14 @@ RUN curl -sLO https://github.com/borkdude/clj-kondo/releases/download/v${CLJ_KON RUN curl -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && chmod a+x ktlint \ && mv "ktlint" /usr/bin/ +#################### +# Install dart-sdk # +#################### +ARG DART_VERSION='2.8.4' +RUN wget https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip - \ + && mv dart-sdk/bin/* /usr/bin \ + && rm -r "dart-sdk" + ########################################### # Load GitHub Env Vars for GitHub Actions # ########################################### @@ -190,6 +198,7 @@ ENV GITHUB_SHA=${GITHUB_SHA} \ VALIDATE_ENV=${VALIDATE_ENV} \ VALIDATE_CLOJURE=${VALIDATE_CLOJURE} \ VALIDATE_KOTLIN=${VALIDATE_KOTLIN} \ + VALIDATE_DART=${VALIDATE_DART} \ VALIDATE_POWERSHELL=${VALIDATE_POWERSHELL} \ VALIDATE_OPENAPI=${VALIDATE_OPENAPI} \ VALIDATE_PROTOBUF=${VALIDATE_PROTOBUF} \ diff --git a/README.md b/README.md index 6c1b6520..d29a7676 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base | **CSS** | [stylelint](https://stylelint.io/) | | **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) | | **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) | +| **Dart** | [dartanalyzer](https://dart.dev/tools/dartanalyzer) | | **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) | | **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | | **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) | @@ -176,6 +177,7 @@ and won't run anything unexpected. | **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the language. | | **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the language. | | **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the language. | | **VALIDATE_OPENAPI** | `true` | Flag to enable or disable the linting process of the language. | | **VALIDATE_CLOUDFORMATION** | `true` | Flag to enable or disable the linting process of the language. | | **VALIDATE_PROTOBUF** | `true` | Flag to enable or disable the linting process of the language. | diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index 93800eb7..e8ceabe3 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -658,6 +658,35 @@ import package.b.* -------------------------------------------------------------------------------- +## Dart +- [dartanalyzer](https://dart.dev/tools/dartanalyzer) + +### dartanalyzer standard Config file +- `.github/linters/.dart-lint.yml` +- You can pass multiple rules and overwrite default rules +- File should be located at: `.github/linters/.dart-lint.yml` + +### dartanalyzer disable single line +```dart +int x = ''; // ignore: invalid_assignment +``` + +### dartanalyzer disable code block +- You can make [rule exceptions](https://dart.dev/guides/language/analysis-options#excluding-code-from-analysis) for the entire file. +```dart +// ignore_for_file: unused_import, unused_local_variable +``` + +### dartanalyzer disable entire file +- You can disable entire files with the `analyzer.exclude` property in `.dart-lint.yml` +```dart +analyzer: + exclude: + - file +``` + +-------------------------------------------------------------------------------- + ## OpenAPI - [spectral](https://github.com/stoplightio/spectral) diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index 7334b447..2c274e75 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -336,6 +336,15 @@ function BuildFileList() { ############################ # Get the Protocol Buffers files # ############################ + elif [ "$FILE_TYPE" == "dart" ]; then + ################################ + # Append the file to the array # + ################################ + FILE_ARRAY_DART+=("$FILE") + ########################################################## + # Set the READ_ONLY_CHANGE_FLAG since this could be exec # + ########################################################## + READ_ONLY_CHANGE_FLAG=1 elif [ "$FILE_TYPE" == "proto" ]; then ################################ # Append the file to the array # diff --git a/lib/linter.sh b/lib/linter.sh index a036dc2c..dc089a6a 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -77,6 +77,9 @@ PROTOBUF_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PROTOBUF_FILE_NAME" # Path to th # Clojure Vars CLOJURE_FILE_NAME='.clj-kondo/config.edn' CLOJURE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CLOJURE_FILE_NAME" +# Dart Vars +DART_FILE_NAME='.dart-lint.yml' +DART_LINTER_RULES="$DEFAULT_RULES_LOCATION/$DART_FILE_NAME" ####################################### # Linter array for information prints # @@ -85,7 +88,7 @@ LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck" "pylint" "perl" "rubocop" "coffeelint" "eslint" "standard" "ansible-lint" "/dockerfilelint/bin/dockerfilelint" "golangci-lint" "tflint" "stylelint" "dotenv-linter" "pwsh" "ktlint" "protolint" "clj-kondo" - "spectral" "cfn-lint") + "spectral" "cfn-lint" "dart") ############################# # Language array for prints # @@ -93,7 +96,7 @@ LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck" LANGUAGE_ARRAY=('YML' 'JSON' 'XML' 'MARKDOWN' 'BASH' 'PERL' 'PHP' 'RUBY' 'PYTHON' 'COFFEESCRIPT' 'ANSIBLE' 'JAVASCRIPT_STANDARD' 'JAVASCRIPT_ES' 'TYPESCRIPT_STANDARD' 'TYPESCRIPT_ES' 'DOCKER' 'GO' 'TERRAFORM' - 'CSS' 'ENV' 'POWERSHELL' 'KOTLIN' 'PROTOBUF' 'CLOJURE' 'OPENAPI' 'CFN') + 'CSS' 'ENV' 'POWERSHELL' 'KOTLIN' 'PROTOBUF' 'CLOJURE' 'OPENAPI' 'CFN' 'DART') ################### # GitHub ENV Vars # @@ -129,6 +132,7 @@ VALIDATE_TERRAFORM="${VALIDATE_TERRAFORM}" # Boolean to vali VALIDATE_POWERSHELL="${VALIDATE_POWERSHELL}" # Boolean to validate language VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language +VALIDATE_DART="${VALIDATE_DART}" # 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 @@ -219,6 +223,7 @@ ERRORS_FOUND_CLOJURE=0 # Count of errors found ERRORS_FOUND_KOTLIN=0 # Count of errors found ERRORS_FOUND_PROTOBUF=0 # Count of errors found ERRORS_FOUND_OPENAPI=0 # Count of errors found +ERRORS_FOUND_DART=0 # Count of errors found ################################################################################ ########################## FUNCTIONS BELOW ##################################### @@ -727,7 +732,8 @@ Footer() { [ "$ERRORS_FOUND_OPENAPI" -ne 0 ] || [ "$ERRORS_FOUND_PROTOBUF" -ne 0 ] || [ "$ERRORS_FOUND_CLOJURE" -ne 0 ] || - [ "$ERRORS_FOUND_KOTLIN" -ne 0 ]; then + [ "$ERRORS_FOUND_KOTLIN" -ne 0 ] || + [ "$ERRORS_FOUND_DART" -ne 0 ]; then # Failed exit echo -e "${NC}${F[R]}Exiting with errors found!${NC}" exit 1 @@ -795,6 +801,8 @@ GetLinterRules "POWERSHELL" GetLinterRules "CSS" # Get CFN rules GetLinterRules "CFN" +# Get DART rules +GetLinterRules "DART" ################################# # Check if were in verbose mode # @@ -1069,6 +1077,17 @@ if [ "$VALIDATE_KOTLIN" == "true" ]; then LintCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "${FILE_ARRAY_KOTLIN[@]}" fi +################## +# DART LINTING # +################## +if [ "$VALIDATE_DART" == "true" ]; then + ####################### + # Lint the Dart files # + ####################### + # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" + LintCodebase "DART" "dart" "dartanalyzer --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "${FILE_ARRAY_DART[@]}" +fi + ################## # DOCKER LINTING # ################## diff --git a/lib/validation.sh b/lib/validation.sh index 988abea5..2850dbf5 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -100,7 +100,8 @@ function GetValidationInfo() { $VALIDATE_CLOJURE || -n \ $VALIDATE_PROTOBUF || -n \ $VALIDATE_OPENAPI || -n \ - $VALIDATE_KOTLIN ]]; then + $VALIDATE_KOTLIN || -n \ + $VALIDATE_DART ]]; then ANY_SET="true" fi @@ -412,6 +413,20 @@ function GetValidationInfo() { VALIDATE_KOTLIN="true" fi + #################################### + # Validate if we should check DART # + #################################### + if [[ $ANY_SET == "true" ]]; then + # Some linter flags were set - only run those set to true + if [[ -z $VALIDATE_DART ]]; then + # ENV flag was not set - default to false + VALIDATE_DART="false" + fi + else + # No linter flags were set - default all to true + VALIDATE_DART="true" + fi + ####################################### # Validate if we should check OPENAPI # ####################################### @@ -582,6 +597,11 @@ function GetValidationInfo() { else PRINT_ARRAY+=("- Excluding [PROTOBUF] files in code base...") fi + if [[ $VALIDATE_DART == "true" ]]; then + PRINT_ARRAY+=("- Validating [DART] files in code base...") + else + PRINT_ARRAY+=("- Excluding [DART] files in code base...") + fi ############################## # Validate Ansible Directory # diff --git a/lib/worker.sh b/lib/worker.sh index 4382620a..6fb6e52d 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -477,6 +477,7 @@ function RunTestCases() { TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin" TestCodebase "PROTOBUF" "protolint" "protolint lint --config_path $PROTOBUF_LINTER_RULES" ".*\.\(proto\)\$" "protobuf" TestCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" ".*\.\(ymlopenapi\|jsonopenapi\)\$" "openapi" + TestCodebase "DART" "dart" "dartanalyzer --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart" ################# # Footer prints # From 9a909c5d1d0da0ad4ca7ceec371d10e1e90a871c Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 6 Jul 2020 18:06:58 +0100 Subject: [PATCH 08/96] Output transformation (with error messages or simpler) (#1) * Output transformation (with error messages or simpler) * colon causes issues when transforming TAP to XUnit --- Dockerfile | 3 ++- README.md | 6 ++++-- lib/linter.sh | 30 ++++++++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index ce1ee696..9b8e748b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -186,7 +186,8 @@ ENV GITHUB_SHA=${GITHUB_SHA} \ ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ DISABLE_ERRORS=${DISABLE_ERRORS} \ OUTPUT_FORMAT=${OUTPUT_FORMAT} \ - OUTPUT_FOLDER=${OUTPUT_FOLDER} + OUTPUT_FOLDER=${OUTPUT_FOLDER} \ + OUTPUT_DETAILS=${OUTPUT_DETAILS} ############################# # Copy scripts to container # diff --git a/README.md b/README.md index 6f790344..ad1a1961 100644 --- a/README.md +++ b/README.md @@ -171,8 +171,10 @@ and won't run anything unexpected. | **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | | **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | | **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | -| **OUTPUT_FORMAT** | `` | The report format to be generated, besides the stdout one. Supported formats: tap | -| **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. | +| **OUTPUT_FORMAT** | `` | The report format to be generated, besides the stdout one. Supported formats: tap | +| **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. | +| **OUTPUT_DETAILS** | `simpler` | What level of details to be reported. Supported formats: simpler or detailed. | + ### Template rules files You can use the **GitHub** **Super-Linter** *with* or *without* your own personal rules sets. This allows for greater flexibility for each individual code base. The Template rules all try to follow the standards we believe should be enabled at the basic level. diff --git a/lib/linter.sh b/lib/linter.sh index 87cdffeb..d5576f9c 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -139,6 +139,7 @@ DEFAULT_IFS="$IFS" # Get the Default IFS for updating ############## OUTPUT_FORMAT="${OUTPUT_FORMAT}" # Output format to be generated. Default none OUTPUT_FOLDER="${OUTPUT_FOLDER:-super-linter.report}" # Folder where the reports are generated. Default super-linter.report +OUTPUT_DETAILS="${OUTPUT_DETAILS:-simpler}" # What level of details. (simpler or detailed). Default simpler REPORT_OUTPUT_FOLDER="${DEFAULT_WORKSPACE}/${OUTPUT_FOLDER}" ########################## @@ -577,7 +578,13 @@ LintAnsibleFiles() ####################################################### if IsTAP ; then echo "not ok ${INDEX} - ${FILE}" >> "${TMPFILE}" - printf " ---\n message:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" + ########################################## + # Report the detailed message if enabled # + ########################################## + DETAILED_MSG=$(TransformTAPDetails "$LINT_CMD") + if [ -n "${DETAILED_MSG}" ] ; then + printf " ---\n message: %s\n ..." "$DETAILED_MSG" >> "${TMPFILE}" + fi fi else ########### @@ -2034,7 +2041,13 @@ LintCodebase() ####################################################### if IsTAP ; then echo "not ok ${INDEX} - ${FILE}" >> "${TMPFILE}" - printf " ---\n message:[%s]\n ..." "$LINT_CMD" >> "${TMPFILE}" + ########################################## + # Report the detailed message if enabled # + ########################################## + DETAILED_MSG=$(TransformTAPDetails "$LINT_CMD") + if [ -n "${DETAILED_MSG}" ] ; then + printf " ---\n message: %s\n ..." "$DETAILED_MSG" >> "${TMPFILE}" + fi fi else @@ -2430,6 +2443,19 @@ IsTAP() return 1 fi } +################################################################################ +#### Function TransformTAPDetails ############################################## +TransformTAPDetails() +{ + DATA=$1 + if [ -n "${DATA}" ] && [ "${OUTPUT_DETAILS}" == "detailed" ] ; then + ######################################################### + # Transform new lines to \\n, remove colours and colons # + ######################################################### + echo "${DATA}" | awk 'BEGIN{RS="\n";ORS="\\n"}1' | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" | tr ':' ' ' + fi +} + ################################################################################ ############################### MAIN ########################################### ################################################################################ From b4fe702ec414d6f54c90880be2a8c5eda65c112b Mon Sep 17 00:00:00 2001 From: Casey Vega Date: Mon, 6 Jul 2020 10:51:49 -0700 Subject: [PATCH 09/96] add glibc compat layer for alpine via apk --- Dockerfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 171ee259..a7791132 100644 --- a/Dockerfile +++ b/Dockerfile @@ -162,10 +162,18 @@ RUN curl -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktli #################### # Install dart-sdk # #################### +# install alpine-pkg-glibc (glibc compatibility layer package for Alpine Linux) +ARG GLIBC_VERSION='2.31-r0' +RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub +RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk +RUN apk add glibc-${GLIBC_VERSION}.apk + +# install dart sdk ARG DART_VERSION='2.8.4' RUN wget https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip - \ - && mv dart-sdk/bin/* /usr/bin \ - && rm -r "dart-sdk" + && chmod +x dart-sdk/bin/dart* \ + && mv dart-sdk/bin/* /usr/bin/ && mv dart-sdk/lib/* /usr/lib/ && mv dart-sdk/include/* /usr/include/ \ + && rm -r dart-sdk/ ########################################### # Load GitHub Env Vars for GitHub Actions # From 05e73c61270cbe2e84117712069788f97cfbbdc5 Mon Sep 17 00:00:00 2001 From: Casey Vega Date: Mon, 6 Jul 2020 11:14:55 -0700 Subject: [PATCH 10/96] fix merge conflict, whoops --- lib/validation.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/validation.sh b/lib/validation.sh index ad7f2f29..b7a1ce28 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -105,12 +105,9 @@ function GetValidationInfo() { $VALIDATE_PROTOBUF || -n \ $VALIDATE_OPENAPI || -n \ $VALIDATE_KOTLIN || -n \ -<<<<<<< HEAD - $VALIDATE_DART ]]; then -======= + $VALIDATE_DART || -n \ $VALIDATE_EDITORCONFIG || -n \ $VALIDATE_HTML ]]; then ->>>>>>> master ANY_SET="true" fi From 4ea4aef02ea78a95ffe8a25b2bb11f5b46178650 Mon Sep 17 00:00:00 2001 From: Casey Vega Date: Mon, 6 Jul 2020 15:06:56 -0700 Subject: [PATCH 11/96] update documentation for dart --- .automation/test/dart/dart_bad_1.dart | 1 - .automation/test/dart/dart_good_1.dart | 1 - Dockerfile | 2 +- README.md | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.automation/test/dart/dart_bad_1.dart b/.automation/test/dart/dart_bad_1.dart index 55ef95a4..c8e4746e 100644 --- a/.automation/test/dart/dart_bad_1.dart +++ b/.automation/test/dart/dart_bad_1.dart @@ -1,5 +1,4 @@ // empty_constructor_bodies bad {} - class Point { int x, y; Point(this.x, this.y) {} diff --git a/.automation/test/dart/dart_good_1.dart b/.automation/test/dart/dart_good_1.dart index d336bbef..ba9c09c5 100644 --- a/.automation/test/dart/dart_good_1.dart +++ b/.automation/test/dart/dart_good_1.dart @@ -1,5 +1,4 @@ // empty_constructor_bodies good ; - class Point { int x, y; Point(this.x, this.y); diff --git a/Dockerfile b/Dockerfile index 6e8f6322..f4f2d806 100644 --- a/Dockerfile +++ b/Dockerfile @@ -190,7 +190,7 @@ RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/s RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk RUN apk add glibc-${GLIBC_VERSION}.apk -# install dart sdk +# stable dart sdk: https://dart.dev/get-dart#release-channels ARG DART_VERSION='2.8.4' RUN wget https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip - \ && chmod +x dart-sdk/bin/dart* \ diff --git a/README.md b/README.md index 5875572e..d6c14050 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base | **CSS** | [stylelint](https://stylelint.io/) | | **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) | | **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) | -| **Dart** | [dartanalyzer](https://dart.dev/tools/dartanalyzer) | +| **Dart** | [dartanalyzer](https://dart.dev/guides/language/analysis-options) | | **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) | | **EDITORCONFIG** | [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) | | **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | From 433b10bdc9bc2a8e78df5ada8b3b4b2e91ff94f9 Mon Sep 17 00:00:00 2001 From: Casey Vega Date: Mon, 6 Jul 2020 21:18:17 -0700 Subject: [PATCH 12/96] fix sytax error, missing fi --- lib/validation.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/validation.sh b/lib/validation.sh index b7a1ce28..707836dc 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -654,6 +654,7 @@ function GetValidationInfo() { PRINT_ARRAY+=("- Validating [DART] files in code base...") else PRINT_ARRAY+=("- Excluding [DART] files in code base...") + fi if [[ $VALIDATE_EDITORCONFIG == "true" ]]; then PRINT_ARRAY+=("- Validating [EDITORCONFIG] files in code base...") else From 8f7b2bcc749d629a76299d11c5da19eb397cf4aa Mon Sep 17 00:00:00 2001 From: Casey Vega Date: Mon, 6 Jul 2020 21:42:29 -0700 Subject: [PATCH 13/96] add suggested changes from @devoncarew - use analysis_options.yaml file (dart convention), mv .dart-lint.yml - add --fatal-infos switch for testing - add VALIDATE_DART, because I missed it before --- .github/linters/{.dart-lint.yml => analysis_options.yaml} | 0 lib/linter.sh | 2 +- lib/validation.sh | 1 + lib/worker.sh | 2 +- 4 files changed, 3 insertions(+), 2 deletions(-) rename .github/linters/{.dart-lint.yml => analysis_options.yaml} (100%) diff --git a/.github/linters/.dart-lint.yml b/.github/linters/analysis_options.yaml similarity index 100% rename from .github/linters/.dart-lint.yml rename to .github/linters/analysis_options.yaml diff --git a/lib/linter.sh b/lib/linter.sh index a86fcec3..52f45332 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -81,7 +81,7 @@ PROTOBUF_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PROTOBUF_FILE_NAME" # Path t CLOJURE_FILE_NAME='.clj-kondo/config.edn' # Name of the file CLOJURE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CLOJURE_FILE_NAME" # Path to the Clojure lint rules # Dart Vars -DART_FILE_NAME='.dart-lint.yml' # Name of the file +DART_FILE_NAME='analysis_options.yaml' # Name of the file DART_LINTER_RULES="$DEFAULT_RULES_LOCATION/$DART_FILE_NAME" # Path to the DART lint rules # HTML Vars HTML_FILE_NAME='.htmlhintrc' # Name of the file diff --git a/lib/validation.sh b/lib/validation.sh index 707836dc..bc4f2682 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -73,6 +73,7 @@ function GetValidationInfo() { VALIDATE_PROTOBUF=$(echo "$VALIDATE_PROTOBUF" | awk '{print tolower($0)}') VALIDATE_OPENAPI=$(echo "$VALIDATE_OPENAPI" | awk '{print tolower($0)}') VALIDATE_EDITORCONFIG=$(echo "$VALIDATE_EDITORCONFIG" | awk '{print tolower($0)}') + VALIDATE_DART=$(echo "$VALIDATE_DART" | awk '{print tolower($0)}') VALIDATE_HTML=$(echo "$VALIDATE_HTML" | awk '{print tolower($0)}') ################################################ diff --git a/lib/worker.sh b/lib/worker.sh index 3240dca1..48a7a9a9 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -478,7 +478,7 @@ function RunTestCases() { TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin" TestCodebase "PROTOBUF" "protolint" "protolint lint --config_path $PROTOBUF_LINTER_RULES" ".*\.\(proto\)\$" "protobuf" TestCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" ".*\.\(ymlopenapi\|jsonopenapi\)\$" "openapi" - TestCodebase "DART" "dart" "dartanalyzer --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart" + TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart" TestCodebase "HTML" "htmlhint" "htmlhint --config $HTML_LINTER_RULES" ".*\.\(html\)\$" "html" ################# From 20162f330e3533d9b5ef40b3938bda95475ab1b7 Mon Sep 17 00:00:00 2001 From: Casey Vega Date: Mon, 6 Jul 2020 22:06:27 -0700 Subject: [PATCH 14/96] add -q flag to unzip for less verbosity --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b98e5579..340e3ff1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -198,7 +198,7 @@ RUN apk add glibc-${GLIBC_VERSION}.apk # stable dart sdk: https://dart.dev/get-dart#release-channels ARG DART_VERSION='2.8.4' -RUN wget https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip - \ +RUN wget https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip -q - \ && chmod +x dart-sdk/bin/dart* \ && mv dart-sdk/bin/* /usr/bin/ && mv dart-sdk/lib/* /usr/lib/ && mv dart-sdk/include/* /usr/include/ \ && rm -r dart-sdk/ From 2cdea4f076c692f8f4cb39a3169bbc74319013ef Mon Sep 17 00:00:00 2001 From: Casey Vega Date: Mon, 6 Jul 2020 22:18:31 -0700 Subject: [PATCH 15/96] add --no-cache to apk per linter sugestion --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 340e3ff1..fb8ea84c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -194,7 +194,7 @@ RUN curl -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktli ARG GLIBC_VERSION='2.31-r0' RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk -RUN apk add glibc-${GLIBC_VERSION}.apk +RUN apk --no-cache add glibc-${GLIBC_VERSION}.apk # stable dart sdk: https://dart.dev/get-dart#release-channels ARG DART_VERSION='2.8.4' From abf0bdbf663501c269da630e77bdd64356a1162f Mon Sep 17 00:00:00 2001 From: Casey Vega Date: Mon, 6 Jul 2020 22:23:06 -0700 Subject: [PATCH 16/96] pay respect to the Dockerfile linter, fix apk add --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fb8ea84c..a041c850 100644 --- a/Dockerfile +++ b/Dockerfile @@ -194,7 +194,7 @@ RUN curl -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktli ARG GLIBC_VERSION='2.31-r0' RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk -RUN apk --no-cache add glibc-${GLIBC_VERSION}.apk +RUN apk add --no-cache glibc-${GLIBC_VERSION}.apk # stable dart sdk: https://dart.dev/get-dart#release-channels ARG DART_VERSION='2.8.4' From 0e9439d9a0b64e85d141a31bb8d5f15ba3832bc3 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 14 Jul 2020 08:50:31 +0100 Subject: [PATCH 17/96] Apply suggestions from code review Co-authored-by: Zack Koppert --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 038b7268..9ef3b20c 100644 --- a/README.md +++ b/README.md @@ -189,8 +189,8 @@ and won't run anything unexpected. | **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | | **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | | **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | -| **OUTPUT_FORMAT** | `` | The report format to be generated, besides the stdout one. Supported formats: tap | -| **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. | +| **OUTPUT_FORMAT** | `` | The report format to be generated, besides the stdout one. Output format of tap is currently using v13 of the specification. Supported formats: tap | +| **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. Output folder must not previously exist. | | **OUTPUT_DETAILS** | `simpler` | What level of details to be reported. Supported formats: simpler or detailed. | From fdfa61e6a0fbd19dcd2f4a0161528a0d6c3cd925 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 14 Jul 2020 08:51:53 +0100 Subject: [PATCH 18/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ef3b20c..266d2580 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ and won't run anything unexpected. | **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | | **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | | **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | -| **OUTPUT_FORMAT** | `` | The report format to be generated, besides the stdout one. Output format of tap is currently using v13 of the specification. Supported formats: tap | +| **OUTPUT_FORMAT** | `none` | The report format to be generated, besides the stdout one. Output format of tap is currently using v13 of the specification. Supported formats: tap | | **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. Output folder must not previously exist. | | **OUTPUT_DETAILS** | `simpler` | What level of details to be reported. Supported formats: simpler or detailed. | From 543eef3780a8b95fbf72f7a25165ff625c645c70 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 14 Jul 2020 13:30:55 -0500 Subject: [PATCH 19/96] Adding missing env var --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 4088461c..1aa7dd35 100644 --- a/Dockerfile +++ b/Dockerfile @@ -209,6 +209,7 @@ ENV GITHUB_SHA=${GITHUB_SHA} \ VALIDATE_TERRAFORM=${VALIDATE_TERRAFORM} \ VALIDATE_CSS=${VALIDATE_CSS} \ VALIDATE_ENV=${VALIDATE_ENV} \ + VALIDATE_HTML=${VALIDATE_HTML} \ VALIDATE_CLOJURE=${VALIDATE_CLOJURE} \ VALIDATE_KOTLIN=${VALIDATE_KOTLIN} \ VALIDATE_POWERSHELL=${VALIDATE_POWERSHELL} \ From 21979ad0fb07ef6883bcad2d007d59a5cd0c26d3 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Tue, 14 Jul 2020 16:43:06 -0700 Subject: [PATCH 20/96] Correct exempt label syntax This should correct [these](https://github.com/github/super-linter/runs/867395200?check_suite_focus=true#step:2:1) warnings --- .github/workflows/stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 6e58ee8f..4aecddcb 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -37,9 +37,9 @@ jobs: days-before-stale: 30 days-before-close: 14 stale-issue-label: "O: stale 🤖" - exempt-issue-label: "O: backlog 🤖" + exempt-issue-labels: "O: backlog 🤖" stale-pr-label: "O: stale 🤖" - exempt-pr-label: "O: backlog 🤖" + exempt-pr-labels: "O: backlog 🤖" ################## # Mark not stale # From 7069ceeef2462e0151818d8ed98cc68ca70b6d04 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Tue, 14 Jul 2020 17:14:01 -0700 Subject: [PATCH 21/96] Add Azure and Gitlab options --- README.md | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 561ea8a8..7f92eb13 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,7 @@ The end goal of this tool: - [Environment variables](#environment-variables) - [Disable rules](#disabling-rules) - [Docker Hub](#docker-hub) -- [Run Super-Linter locally](#running-super-linter-locally-troubleshootingdebuggingenhancements) - - [CI / CT/ CD](#cictcd) +- [Run Super-Linter outside GitHub Actions](#run-super-linter-outside-github-actions) - [Limitations](#limitations) - [Contributing](#how-to-contribute) @@ -209,19 +208,23 @@ If you need to disable certain *rules* and *functionality*, you can view [Disabl ## Docker Hub The **Docker** container that is built from this repository is located at `https://hub.docker.com/r/github/super-linter` -## Running Super-Linter locally (troubleshooting/debugging/enhancements) +## Run Super-Linter outside GitHub Actions +### Local (troubleshooting/debugging/enhancements) If you find that you need to run super-linter locally, you can follow the documentation at [Running super-linter locally](https://github.com/github/super-linter/blob/master/docs/run-linter-locally.md) Check out the [note](#how-it-works) in **How it Works** to understand more about the **Super-Linter** linting locally versus via continuous integration. -### CI/CT/CD -The **Super-Linter** has *CI/CT/CD* configured utilizing **GitHub** Actions. -- When a branch is created and code is pushed, a **GitHub** Action is triggered for building the new **Docker** container with the new codebase -- The **Docker** container is then ran against the *test cases* to validate all code sanity - - `.automation/test` contains all test cases for each language that should be validated -- These **GitHub** Actions utilize the Checks API and Protected Branches to help follow the SDLC -- When the Pull Request is merged to master, the **Super-Linter** **Docker** container is then updated and deployed with the new codebase - - **Note:** The branch's **Docker** container is also removed from **DockerHub** to cleanup after itself +### Azure +Check out this [article](http://blog.tyang.org/2020/06/27/use-github-super-linter-in-azure-pipelines/) + +### GitLab +Check out this [snippet](https://gitlab.com/snippets/1988376) + +### Visual Studio Code +You can checkout this repository using [Container Remote Development](https://code.visualstudio.com/docs/remote/containers), and debug the linter using the `Test Linter` task. +![Example](https://user-images.githubusercontent.com/15258962/85165778-2d2ce700-b21b-11ea-803e-3f6709d8e609.gif) + +We will also support [Github Codespaces](https://github.com/features/codespaces/) once it becomes available ## Limitations Below are a list of the known limitations for the **GitHub Super-Linter**: @@ -232,12 +235,6 @@ Below are a list of the known limitations for the **GitHub Super-Linter**: ## How to contribute If you would like to help contribute to this **GitHub** Action, please see [CONTRIBUTING](https://github.com/github/super-linter/blob/master/.github/CONTRIBUTING.md) -### Visual Studio Code -You can checkout this repository using [Container Remote Development](https://code.visualstudio.com/docs/remote/containers), and debug the linter using the `Test Linter` task. -![Example](https://user-images.githubusercontent.com/15258962/85165778-2d2ce700-b21b-11ea-803e-3f6709d8e609.gif) - -We will also support [Github Codespaces](https://github.com/features/codespaces/) once it becomes available - -------------------------------------------------------------------------------- ### License From 7772df028a71a4755a983cee70535185c65f3308 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Tue, 14 Jul 2020 17:19:22 -0700 Subject: [PATCH 22/96] move CI/CT/CD section to contributing.md --- .github/CONTRIBUTING.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 64a37fb3..d8a0e759 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -29,6 +29,15 @@ Draft pull requests are also welcome to get feedback early on, or if there is so - Create a branch with a name that identifies the user and nature of the changes (similar to `user/branch-purpose`) - Open a pull request +### CI/CT/CD +The **Super-Linter** has *CI/CT/CD* configured utilizing **GitHub** Actions. +- When a branch is created and code is pushed, a **GitHub** Action is triggered for building the new **Docker** container with the new codebase +- The **Docker** container is then ran against the *test cases* to validate all code sanity + - `.automation/test` contains all test cases for each language that should be validated +- These **GitHub** Actions utilize the Checks API and Protected Branches to help follow the SDLC +- When the Pull Request is merged to master, the **Super-Linter** **Docker** container is then updated and deployed with the new codebase + - **Note:** The branch's **Docker** container is also removed from **DockerHub** to cleanup after itself + ## Releasing If you are the current maintainer of this action: 1. If a major version number change: Update `README.md` and the wiki to reflect new version number in the example workflow file sections From 95f0c2d534fa3b34f4389ec9e687ad7842d2df9f Mon Sep 17 00:00:00 2001 From: Casey Vega Date: Tue, 14 Jul 2020 23:36:22 -0700 Subject: [PATCH 23/96] add dart pub get and --fatal flags - add `pub get || true` - add --fatal flags to throw 1 on exit Adding `pub get` enables dart to import dev/project dependencies before analysis/linting. It is set to always return true in the event this has already occured somewhere else in the CI workflow a pubspec.yaml does not exist Using `--fatal-(infos|warnings)` allows super-linter to fail when a lint is reported. --- lib/linter.sh | 2 +- lib/worker.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 778c2aef..4950ff7d 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1185,7 +1185,7 @@ if [ "$VALIDATE_DART" == "true" ]; then # Lint the Dart files # ####################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "DART" "dart" "dartanalyzer --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "${FILE_ARRAY_DART[@]}" + LintCodebase "DART" "dart" "pub get || true && dartanalyzer --fatal-infos --fatal-warnings --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "${FILE_ARRAY_DART[@]}" fi ################## diff --git a/lib/worker.sh b/lib/worker.sh index a8589ea8..3400871a 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -479,7 +479,7 @@ function RunTestCases() { TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin" TestCodebase "PROTOBUF" "protolint" "protolint lint --config_path $PROTOBUF_LINTER_RULES" ".*\.\(proto\)\$" "protobuf" TestCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" ".*\.\(ymlopenapi\|jsonopenapi\)\$" "openapi" - TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart" + TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart" TestCodebase "HTML" "htmlhint" "htmlhint --config $HTML_LINTER_RULES" ".*\.\(html\)\$" "html" ################# From 97dd95194a7ee671bbb09903c04a1d57192f49c7 Mon Sep 17 00:00:00 2001 From: Gabo Date: Wed, 15 Jul 2020 14:04:55 -0500 Subject: [PATCH 24/96] User gemfile for dependabot and update rubocop --- Dockerfile | 15 +++-------- dependencies/Gemfile | 10 +++++++ dependencies/Gemfile.lock | 55 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 11 deletions(-) create mode 100644 dependencies/Gemfile create mode 100644 dependencies/Gemfile.lock diff --git a/Dockerfile b/Dockerfile index 9b50bb40..6704cfca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -83,17 +83,10 @@ RUN npm config set package-lock false \ ############################# ENV PATH="/node_modules/.bin:${PATH}" -#################### -# Run GEM installs # -#################### -RUN gem install rubocop:0.74.0 rubocop-rails rubocop-github:0.13.0 - -# Need to fix the version as it installs 'rubocop:0.85.1' as a dep, and forces the default -# We then need to promote the correct version, uninstall, and fix deps -RUN sh -c 'INCORRECT_VERSION=$(gem list rhc -e rubocop | grep rubocop | awk "{print $2}" | cut -d"(" -f2 | cut -d"," -f1); \ - gem install --default rubocop:0.74.0; \ - yes | gem uninstall rubocop:$INCORRECT_VERSION -a -x -I; \ - gem install rubocop:0.74.0' +############################## +# Installs ruby dependencies # +############################## +RUN bundle install ######################################### # Install Powershell + PSScriptAnalyzer # diff --git a/dependencies/Gemfile b/dependencies/Gemfile new file mode 100644 index 00000000..10236e74 --- /dev/null +++ b/dependencies/Gemfile @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } + + +gem "rubocop", "~> 0.82.0" +gem "rubocop-rails", "~> 2.5" +gem "rubocop-github", "~> 0.13.0" diff --git a/dependencies/Gemfile.lock b/dependencies/Gemfile.lock new file mode 100644 index 00000000..09e8fe95 --- /dev/null +++ b/dependencies/Gemfile.lock @@ -0,0 +1,55 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (6.0.3.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + ast (2.4.1) + concurrent-ruby (1.1.6) + i18n (1.8.3) + concurrent-ruby (~> 1.0) + jaro_winkler (1.5.4) + minitest (5.14.1) + parallel (1.19.2) + parser (2.7.1.4) + ast (~> 2.4.1) + rack (2.2.3) + rainbow (3.0.0) + rexml (3.2.4) + rubocop (0.82.0) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.7.0.1) + rainbow (>= 2.2.2, < 4.0) + rexml + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-github (0.13.0) + rubocop (~> 0.70) + rubocop-performance (~> 1.3.0) + rubocop-performance (1.3.0) + rubocop (>= 0.68.0) + rubocop-rails (2.6.0) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 0.82.0) + ruby-progressbar (1.10.1) + thread_safe (0.3.6) + tzinfo (1.2.7) + thread_safe (~> 0.1) + unicode-display_width (1.7.0) + zeitwerk (2.4.0) + +PLATFORMS + ruby + +DEPENDENCIES + rubocop (~> 0.82.0) + rubocop-github (~> 0.13.0) + rubocop-rails (~> 2.5) + +BUNDLED WITH + 2.1.4 From d180d7082633d2e279ff40fab56e91f8080247a8 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Wed, 15 Jul 2020 15:49:42 -0500 Subject: [PATCH 25/96] cleanup docker --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 93c10701..494e97ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,11 @@ ARG ARM_TTK_DIRECTORY='/opt/microsoft' ARG RAKU_VER="2020.06" ARG RAKU_INSTALL_PATH=/usr ARG RAKUBREW_HOME=/tmp/rakubrew +# Dart Linter +## stable dart sdk: https://dart.dev/get-dart#release-channels +ARG DART_VERSION='2.8.4' +## install alpine-pkg-glibc (glibc compatibility layer package for Alpine Linux) +ARG GLIBC_VERSION='2.31-r0' #################### # Run APK installs # @@ -162,14 +167,9 @@ RUN curl -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktli #################### # Install dart-sdk # #################### -# install alpine-pkg-glibc (glibc compatibility layer package for Alpine Linux) -ARG GLIBC_VERSION='2.31-r0' RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk RUN apk add --no-cache glibc-${GLIBC_VERSION}.apk - -# stable dart sdk: https://dart.dev/get-dart#release-channels -ARG DART_VERSION='2.8.4' RUN wget https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip -q - \ && chmod +x dart-sdk/bin/dart* \ && mv dart-sdk/bin/* /usr/bin/ && mv dart-sdk/lib/* /usr/lib/ && mv dart-sdk/include/* /usr/include/ \ From f1f0fb024122dda89c46dd664ab1b6f49d19f869 Mon Sep 17 00:00:00 2001 From: Gabo Date: Wed, 15 Jul 2020 16:18:07 -0500 Subject: [PATCH 26/96] Fix version with bug --- dependencies/Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies/Gemfile.lock b/dependencies/Gemfile.lock index 09e8fe95..679edcf3 100644 --- a/dependencies/Gemfile.lock +++ b/dependencies/Gemfile.lock @@ -29,9 +29,9 @@ GEM unicode-display_width (>= 1.4.0, < 2.0) rubocop-github (0.13.0) rubocop (~> 0.70) - rubocop-performance (~> 1.3.0) - rubocop-performance (1.3.0) - rubocop (>= 0.68.0) + rubocop-performance (~> 1.5.0) + rubocop-performance (1.5.2) + rubocop (>= 0.71.0) rubocop-rails (2.6.0) activesupport (>= 4.2.0) rack (>= 1.1) From 41ddd0e1d3aed722217bab7fc65454411b15896d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 14 Jul 2020 14:48:28 +0100 Subject: [PATCH 27/96] [tests] validate TAP format --- .../test/ansible/reports/expected-ANSIBLE.tap | 7 ++ .../reports/expected-COFFEESCRIPT.tap | 7 ++ .../test/docker/reports/expected-DOCKER.tap | 7 ++ .../reports/expected-JAVASCRIPT_ES.tap | 7 ++ .../reports/expected-JAVASCRIPT_STANDARD.tap | 7 ++ .../test/json/reports/expected-JSON.tap | 7 ++ .../test/kotlin/reports/expected-KOTLIN.tap | 7 ++ .../markdown/reports/expected-MARKDOWN.tap | 8 ++ .../test/perl/reports/expected-PERL.tap | 7 ++ .automation/test/php/reports/expected-PHP.tap | 7 ++ .../test/python/reports/expected-PYTHON.tap | 7 ++ .../test/ruby/reports/expected-RUBY.tap | 7 ++ .../test/shell/reports/expected-BASH.tap | 7 ++ .../reports/expected-TYPESCRIPT_ES.tap | 7 ++ .../reports/expected-TYPESCRIPT_STANDARD.tap | 7 ++ .automation/test/xml/reports/expected-XML.tap | 7 ++ .automation/test/yml/reports/expected-YML.tap | 7 ++ .github/workflows/deploy-DEV.yml | 2 +- lib/worker.sh | 75 ++++++++++++++++--- 19 files changed, 187 insertions(+), 10 deletions(-) create mode 100644 .automation/test/ansible/reports/expected-ANSIBLE.tap create mode 100644 .automation/test/coffeescript/reports/expected-COFFEESCRIPT.tap create mode 100644 .automation/test/docker/reports/expected-DOCKER.tap create mode 100644 .automation/test/javascript/reports/expected-JAVASCRIPT_ES.tap create mode 100644 .automation/test/javascript/reports/expected-JAVASCRIPT_STANDARD.tap create mode 100644 .automation/test/json/reports/expected-JSON.tap create mode 100644 .automation/test/kotlin/reports/expected-KOTLIN.tap create mode 100644 .automation/test/markdown/reports/expected-MARKDOWN.tap create mode 100644 .automation/test/perl/reports/expected-PERL.tap create mode 100644 .automation/test/php/reports/expected-PHP.tap create mode 100644 .automation/test/python/reports/expected-PYTHON.tap create mode 100644 .automation/test/ruby/reports/expected-RUBY.tap create mode 100644 .automation/test/shell/reports/expected-BASH.tap create mode 100644 .automation/test/typescript/reports/expected-TYPESCRIPT_ES.tap create mode 100644 .automation/test/typescript/reports/expected-TYPESCRIPT_STANDARD.tap create mode 100644 .automation/test/xml/reports/expected-XML.tap create mode 100644 .automation/test/yml/reports/expected-YML.tap diff --git a/.automation/test/ansible/reports/expected-ANSIBLE.tap b/.automation/test/ansible/reports/expected-ANSIBLE.tap new file mode 100644 index 00000000..5f81e1ed --- /dev/null +++ b/.automation/test/ansible/reports/expected-ANSIBLE.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - ansible_bad_1.yml + --- + message: Traceback (most recent call last) \n File "/usr/bin/ansible-lint", line 11, in \n load_entry_point('ansible-lint==4.2.0', 'console_scripts', 'ansible-lint')()\n File "/usr/lib/python3.8/site-packages/ansiblelint/__main__.py", line 187, in main\n matches.extend(runner.run())\n File "/usr/lib/python3.8/site-packages/ansiblelint/__init__.py", line 267, in run\n for child in ansiblelint.utils.find_children(arg, self.playbook_dir) \n File "/usr/lib/python3.8/site-packages/ansiblelint/utils.py", line 163, in find_children\n for child in play_children(basedir, item, playbook[1], playbook_dir) \n File "/usr/lib/python3.8/site-packages/ansiblelint/utils.py", line 215, in play_children\n return delegate_map[k](basedir, k, v, parent_type)\n File "/usr/lib/python3.8/site-packages/ansiblelint/utils.py", line 246, in _taskshandlers_children\n results.extend(_roles_children(basedir, k, [th['action'].get('name')],\n File "/usr/lib/python3.8/site-packages/ansiblelint/utils.py", line 285, in _roles_children\n results.extend(_look_for_role_files(basedir, role, main=main))\n File "/usr/lib/python3.8/site-packages/ansiblelint/utils.py", line 330, in _look_for_role_files\n role_path = _rolepath(basedir, role)\n File "/usr/lib/python3.8/site-packages/ansiblelint/utils.py", line 299, in _rolepath\n path_dwim(basedir, os.path.join('roles', role)),\n File "/usr/lib/python3.8/posixpath.py", line 90, in join\n genericpath._check_arg_types('join', a, *p)\n File "/usr/lib/python3.8/genericpath.py", line 152, in _check_arg_types\n raise TypeError(f'{funcname}() argument must be str, bytes, or '\nTypeError join() argument must be str, bytes, or os.PathLike object, not 'NoneType'\n + ... +ok 2 - ansible_good_1.yml diff --git a/.automation/test/coffeescript/reports/expected-COFFEESCRIPT.tap b/.automation/test/coffeescript/reports/expected-COFFEESCRIPT.tap new file mode 100644 index 00000000..4ce33752 --- /dev/null +++ b/.automation/test/coffeescript/reports/expected-COFFEESCRIPT.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - coffeescript_bad_1.coffee + --- + message: ✗ /tmp/lint/.automation/test/coffeescript/coffeescript_bad_1.coffee\n ✗ #39 [stdin] 39 29 error unmatched )\nmodule.exports = (robot) -> )\n ^. (coffeescript_error)\n\n✗ Lint! » 1 error and 0 warnings in 1 file\n + ... +ok 2 - coffeescript_good_1.coffee diff --git a/.automation/test/docker/reports/expected-DOCKER.tap b/.automation/test/docker/reports/expected-DOCKER.tap new file mode 100644 index 00000000..6aafb4c6 --- /dev/null +++ b/.automation/test/docker/reports/expected-DOCKER.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - Dockerfile + --- + message: \nFile /tmp/lint/.automation/test/docker/bad/Dockerfile\nIssues 6\n\nLine 1 from node latest\nIssue Category Title Description\n 1 Clarity Capitalize For clarity and readability, all instructions in a Dockerfile\n Dockerfile should be uppercase.\n Instructions This is a convention adopted by most of the official images and\n greatly improves readability in long Dockerfiles. For an example\n of\n why this makes a difference, check out the current [redis\n Dockerfile](https //github.com/docker-library/redis/blob/b375650fb6\n 9b7db819e90c0033433c705b28656e/3.0/Dockerfile)\n and you should be able to easily see the instructions used.\n 2 Clarity Base Image Latest Base images should not use the latest tag.\n Tag\n\nLine 4 run mkdir -p /usr/src/app\nIssue Category Title Description\n 3 Clarity Capitalize For clarity and readability, all instructions in a Dockerfile\n Dockerfile should be uppercase.\n Instructions This is a convention adopted by most of the official images and\n greatly improves readability in long Dockerfiles. For an example\n of\n why this makes a difference, check out the current [redis\n Dockerfile](https //github.com/docker-library/redis/blob/b375650fb6\n 9b7db819e90c0033433c705b28656e/3.0/Dockerfile)\n and you should be able to easily see the instructions used.\n\nLine 8 copy package.json /usr/src/app/ /here/there\nIssue Category Title Description\n 4 Clarity Capitalize For clarity and readability, all instructions in a Dockerfile\n Dockerfile should be uppercase.\n Instructions This is a convention adopted by most of the official images and\n greatly improves readability in long Dockerfiles. For an example\n of\n why this makes a difference, check out the current [redis\n Dockerfile](https //github.com/docker-library/redis/blob/b375650fb6\n 9b7db819e90c0033433c705b28656e/3.0/Dockerfile)\n and you should be able to easily see the instructions used.\n\nLine 9 RUN sudo npm install\nIssue Category Title Description\n 5 Possible Bug Use Of sudo Is Not Use of `sudo` is not allowed in a Dockerfile. From the official\n Allowed document [Best practices for writing\n Dockerfiles](https //docs.docker.com/engine/userguide/eng-image/doc\n kerfile_best-practices/) \n > You should avoid installing or using `sudo` since it has\n unpredictable TTY and signal-forwarding behavior that can cause\n more problems than it solves.\n > If you absolutely need functionality similar to `sudo` (e.g.,\n initializing the daemon as root but running it as non-root), you\n may be able to use `gosu`.\n\nLine 14 ENtrypoint /tmp/here.sh\nIssue Category Title Description\n 6 Clarity Capitalize For clarity and readability, all instructions in a Dockerfile\n Dockerfile should be uppercase.\n Instructions This is a convention adopted by most of the official images and\n greatly improves readability in long Dockerfiles. For an example\n of\n why this makes a difference, check out the current [redis\n Dockerfile](https //github.com/docker-library/redis/blob/b375650fb6\n 9b7db819e90c0033433c705b28656e/3.0/Dockerfile)\n and you should be able to easily see the instructions used.\n + ... +ok 2 - Dockerfile diff --git a/.automation/test/javascript/reports/expected-JAVASCRIPT_ES.tap b/.automation/test/javascript/reports/expected-JAVASCRIPT_ES.tap new file mode 100644 index 00000000..9e605d09 --- /dev/null +++ b/.automation/test/javascript/reports/expected-JAVASCRIPT_ES.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - javascript_bad_1.js + --- + message: \n/tmp/lint/.automation/test/javascript/javascript_bad_1.js\n 4 39 error Parsing error Unterminated regular expression literal\n\n✖ 1 problem (1 error, 0 warnings)\n + ... +ok 2 - javascript_good_1.js diff --git a/.automation/test/javascript/reports/expected-JAVASCRIPT_STANDARD.tap b/.automation/test/javascript/reports/expected-JAVASCRIPT_STANDARD.tap new file mode 100644 index 00000000..42d92b34 --- /dev/null +++ b/.automation/test/javascript/reports/expected-JAVASCRIPT_STANDARD.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - javascript_bad_1.js + --- + message: standard Use JavaScript Standard Style (https //standardjs.com)\n /tmp/lint/.automation/test/javascript/javascript_bad_1.js 4 40 Parsing error Unterminated regular expression\n + ... +ok 2 - javascript_good_1.js diff --git a/.automation/test/json/reports/expected-JSON.tap b/.automation/test/json/reports/expected-JSON.tap new file mode 100644 index 00000000..2b43a1ec --- /dev/null +++ b/.automation/test/json/reports/expected-JSON.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - json_bad_1.json + --- + message: Error Parse error on line 6 \n...ng" { "level" 'ignore', "space\n----------------------^\nExpecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'\n at Object.parseError (/usr/lib/node_modules/jsonlint/lib/jsonlint.js 55 11)\n at Object.parse (/usr/lib/node_modules/jsonlint/lib/jsonlint.js 132 22)\n at parse (/usr/lib/node_modules/jsonlint/lib/cli.js 82 14)\n at main (/usr/lib/node_modules/jsonlint/lib/cli.js 135 14)\n at Object. (/usr/lib/node_modules/jsonlint/lib/cli.js 179 1)\n at Module._compile (internal/modules/cjs/loader.js 1138 30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js 1158 10)\n at Module.load (internal/modules/cjs/loader.js 986 32)\n at Function.Module._load (internal/modules/cjs/loader.js 879 14)\n at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js 71 12)\n + ... +ok 2 - json_good_1.json diff --git a/.automation/test/kotlin/reports/expected-KOTLIN.tap b/.automation/test/kotlin/reports/expected-KOTLIN.tap new file mode 100644 index 00000000..89c7fbc8 --- /dev/null +++ b/.automation/test/kotlin/reports/expected-KOTLIN.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - kotlin_bad_1.kt + --- + message: /tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 1 1 File must end with a newline (\n)\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 2 20 Unnecessary semicolon\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 3 16 Redundant curly braces\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 3 27 Unnecessary semicolon\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 5 15 Unnecessary semicolon\n + ... +ok 2 - kotlint_good_1.kt diff --git a/.automation/test/markdown/reports/expected-MARKDOWN.tap b/.automation/test/markdown/reports/expected-MARKDOWN.tap new file mode 100644 index 00000000..8960605d --- /dev/null +++ b/.automation/test/markdown/reports/expected-MARKDOWN.tap @@ -0,0 +1,8 @@ +TAP version 13 +1..3 +ok 1 - README.md +not ok 2 - markdown_bad_1.md + --- + message: /tmp/lint/.automation/test/markdown/markdown_bad_1.md 1 MD041/first-line-heading/first-line-h1 First line in file should be a top level heading [Context "## Bad Markdown"]\n/tmp/lint/.automation/test/markdown/markdown_bad_1.md 5 MD001/heading-increment/header-increment Heading levels should only increment by one level at a time [Expected h3; Actual h6]\n/tmp/lint/.automation/test/markdown/markdown_bad_1.md 11 1 MD007/ul-indent Unordered list indentation [Expected 4; Actual 6]\n/tmp/lint/.automation/test/markdown/markdown_bad_1.md 13 MD040/fenced-code-language Fenced code blocks should have a language specified [Context "```"]\n/tmp/lint/.automation/test/markdown/markdown_bad_1.md 20 16 MD034/no-bare-urls Bare URL used [Context "https //github.com"]\n + ... +ok 3 - markdown_good_1.md diff --git a/.automation/test/perl/reports/expected-PERL.tap b/.automation/test/perl/reports/expected-PERL.tap new file mode 100644 index 00000000..932c3621 --- /dev/null +++ b/.automation/test/perl/reports/expected-PERL.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - perl_bad_1.pl + --- + message: Global symbol "$here" requires explicit package name (did you forget to declare "my $here"?) at /tmp/lint/.automation/test/perl/perl_bad_1.pl line 37.\n/tmp/lint/.automation/test/perl/perl_bad_1.pl had compilation errors.\n + ... +ok 2 - perl_good_1.pl diff --git a/.automation/test/php/reports/expected-PHP.tap b/.automation/test/php/reports/expected-PHP.tap new file mode 100644 index 00000000..48408065 --- /dev/null +++ b/.automation/test/php/reports/expected-PHP.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - php_bad_1.php + --- + message: PHP Parse error syntax error, unexpected 'pe98y' (T_STRING) in /tmp/lint/.automation/test/php/php_bad_1.php on line 3\nErrors parsing /tmp/lint/.automation/test/php/php_bad_1.php\n + ... +ok 2 - php_good_1.php diff --git a/.automation/test/python/reports/expected-PYTHON.tap b/.automation/test/python/reports/expected-PYTHON.tap new file mode 100644 index 00000000..1751d70f --- /dev/null +++ b/.automation/test/python/reports/expected-PYTHON.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - python_bad_1.py + --- + message: ************* Module python_bad_1\npython/python_bad_1.py 15 24 E0001 invalid syntax (, line 15) (syntax-error)\n + ... +ok 2 - python_good_1.py diff --git a/.automation/test/ruby/reports/expected-RUBY.tap b/.automation/test/ruby/reports/expected-RUBY.tap new file mode 100644 index 00000000..3f0a1372 --- /dev/null +++ b/.automation/test/ruby/reports/expected-RUBY.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - ruby_bad_1.rb + --- + message: /usr/lib/ruby/gems/2.7.0/gems/rubocop-0.74.0/lib/rubocop/config_loader_resolver.rb 76 warning Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call\n/usr/lib/ruby/gems/2.7.0/gems/rubocop-0.74.0/lib/rubocop/config_loader_resolver.rb 84 warning The called method `merge' is defined here\nInspecting 1 file\nC\n\nOffenses \n\nruby/ruby_bad_1.rb 1 1 C Style/FrozenStringLiteralComment Missing magic comment # frozen_string_literal true.\nruby/ruby_bad_1.rb 11 11 C Style/StringLiterals Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.\nFile.open('/tmp/urls.txt', " w" ) do | file|\n ^^^^^^^^^^^^^^^\nruby/ruby_bad_1.rb 11 32 C Layout/SpaceInsideParens Space inside parentheses detected.\nFile.open('/tmp/urls.txt', " w" ) do | file|\n ^\nruby/ruby_bad_1.rb 11 39 C Layout/SpaceAroundBlockParameters Space before first block parameter detected.\nFile.open('/tmp/urls.txt', " w" ) do | file|\n ^\nruby/ruby_bad_1.rb 12 24 C Layout/SpaceAroundBlockParameters Space after last block parameter detected.\n Hook.active.map do |h |\n ^\nruby/ruby_bad_1.rb 13 13 C Layout/SpaceInsideArrayLiteralBrackets Do not use space inside array brackets.\n urls = [ ARRAY_OF_URLS_CALLING_INSTANCE]\n ^\n\n1 file inspected, 6 offenses detected\n + ... +ok 2 - ruby_good_1.rb diff --git a/.automation/test/shell/reports/expected-BASH.tap b/.automation/test/shell/reports/expected-BASH.tap new file mode 100644 index 00000000..f3bedca8 --- /dev/null +++ b/.automation/test/shell/reports/expected-BASH.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - shell_bad_1.sh + --- + message: \nIn /tmp/lint/.automation/test/shell/shell_bad_1.sh line 10 \nif [ $ERROR_CODE -ne 0]; then\n^-- SC1009 The mentioned syntax error was in this if expression.\n ^-- SC1073 Couldn't parse this test expression. Fix to allow more checks.\n ^-- SC1020 You need a space before the ].\n ^-- SC1072 Missing space before ]. Fix any mentioned problems and try again.\n\nFor more information \n https //www.shellcheck.net/wiki/SC1020 -- You need a space before the ].\n https //www.shellcheck.net/wiki/SC1072 -- Missing space before ]. Fix any m...\n https //www.shellcheck.net/wiki/SC1073 -- Couldn't parse this test expressi...\n + ... +ok 2 - shell_good_1.sh diff --git a/.automation/test/typescript/reports/expected-TYPESCRIPT_ES.tap b/.automation/test/typescript/reports/expected-TYPESCRIPT_ES.tap new file mode 100644 index 00000000..c08faa21 --- /dev/null +++ b/.automation/test/typescript/reports/expected-TYPESCRIPT_ES.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - typescript_bad_1.ts + --- + message: \n/tmp/lint/.automation/test/typescript/typescript_bad_1.ts\n 5 39 error Parsing error Unterminated regular expression literal\n\n✖ 1 problem (1 error, 0 warnings)\n + ... +ok 2 - typescript_good_1.ts diff --git a/.automation/test/typescript/reports/expected-TYPESCRIPT_STANDARD.tap b/.automation/test/typescript/reports/expected-TYPESCRIPT_STANDARD.tap new file mode 100644 index 00000000..1271fc8f --- /dev/null +++ b/.automation/test/typescript/reports/expected-TYPESCRIPT_STANDARD.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - typescript_bad_1.ts + --- + message: standard Use JavaScript Standard Style (https //standardjs.com)\n /tmp/lint/.automation/test/typescript/typescript_bad_1.ts 5 39 Parsing error Unterminated regular expression literal.\n + ... +ok 2 - typescript_good_1.ts diff --git a/.automation/test/xml/reports/expected-XML.tap b/.automation/test/xml/reports/expected-XML.tap new file mode 100644 index 00000000..4a3081b9 --- /dev/null +++ b/.automation/test/xml/reports/expected-XML.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - xml_bad_1.xml + --- + message: /tmp/lint/.automation/test/xml/xml_bad_1.xml 7 parser error EndTag '&1) + mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER" -type f -regex "$FILE_EXTENSIONS" ! -path "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/ansible/ghe-initialize/*" | sort 2>&1) + + ######################################## + # Prepare context if TAP output format # + ######################################## + if IsTAP ; then + TMPFILE=$(mktemp -q "/tmp/super-linter-${FILE_TYPE}.XXXXXX") + mkdir -p "${REPORT_OUTPUT_FOLDER}" + REPORT_OUTPUT_FILE="${REPORT_OUTPUT_FOLDER}/super-linter-${FILE_TYPE}.${OUTPUT_FORMAT}" + fi ################## # Lint the files # @@ -406,6 +415,11 @@ function TestCodebase() { ####################### ERROR_CODE=$? + ######################################## + # Increment counter that check was ran # + ######################################## + (("TESTS_RAN++")) + ######################################## # Check for if it was supposed to pass # ######################################## @@ -422,15 +436,17 @@ function TestCodebase() { echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Linter CMD:[$LINTER_COMMAND $FILE]${NC}" # Increment the error count (("ERRORS_FOUND_$FILE_TYPE++")) - # Increment counter that check was ran - ((TESTS_RAN++)) else ########### # Success # ########### echo -e "${NC}${F[B]} - File:${F[W]}[$FILE_NAME]${F[B]} was linted with ${F[W]}[$LINTER_NAME]${F[B]} successfully${NC}" - # Increment counter that check was ran - ((TESTS_RAN++)) + fi + ####################################################### + # Store the linting as a temporary file in TAP format # + ####################################################### + if IsTAP ; then + echo "ok ${TESTS_RAN} - ${FILE_NAME}" >> "${TMPFILE}" fi else ####################################### @@ -449,19 +465,60 @@ function TestCodebase() { echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Linter CMD:[$LINTER_COMMAND $FILE]${NC}" # Increment the error count (("ERRORS_FOUND_$FILE_TYPE++")) - # Increment counter that check was ran - ((TESTS_RAN++)) else ########### # Success # ########### echo -e "${NC}${F[B]} - File:${F[W]}[$FILE_NAME]${F[B]} failed test case with ${F[W]}[$LINTER_NAME]${F[B]} successfully${NC}" - # Increment counter that check was ran - ((TESTS_RAN++)) + fi + ####################################################### + # Store the linting as a temporary file in TAP format # + ####################################################### + if IsTAP ; then + echo "not ok ${TESTS_RAN} - ${FILE_NAME}" >> "${TMPFILE}" + ########################################## + # Report the detailed message if enabled # + ########################################## + DETAILED_MSG=$(TransformTAPDetails "$LINT_CMD") + if [ -n "${DETAILED_MSG}" ] ; then + printf " ---\n message: %s\n ...\n" "${DETAILED_MSG}" >> "${TMPFILE}" + fi fi fi done + ########################################################################### + # Generate report in TAP format and validate with the expected TAP output # + ########################################################################### + if IsTAP && [ ${TESTS_RAN} -gt 0 ] ; then + printf "TAP version 13\n1..%s\n" "${TESTS_RAN}" > "${REPORT_OUTPUT_FILE}" + cat "${TMPFILE}" >> "${REPORT_OUTPUT_FILE}" + + ######################################################################## + # If expected TAP report exists then compare with the generated report # + ######################################################################## + EXPECTED_FILE="$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER/reports/expected-${FILE_TYPE}.tap" + if [ -e "$EXPECTED_FILE" ] ; then + TMPFILE=$(mktemp -q "/tmp/diff-${FILE_TYPE}.XXXXXX") + ## Ignore white spaces, case sensitive + if ! diff -a -w -i "${EXPECTED_FILE}" "${REPORT_OUTPUT_FILE}" > "${TMPFILE}" 2>&1; then + ############################################# + # We failed to compare the reporting output # + ############################################# + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to assert TAP output:[$LINTER_NAME]${NC}"! + echo "Please validate the asserts!" + cat "${TMPFILE}" + exit 1 + else + # Success + echo -e "${NC}${F[B]}Successfully validation in the expected TAP format for ${F[W]}[$LINTER_NAME]${NC}" + fi + else + echo -e "${NC}${F[Y]}WARN!${NC} No TAP expected file found at:[$EXPECTED_FILE]${NC}" + echo "skipping report assertions" + fi + fi + ############################## # Validate we ran some tests # ############################## From 759b5bac1f1eee48a3e05d2494ee0d2c0851b33b Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 15 Jul 2020 22:26:24 +0100 Subject: [PATCH 28/96] no more duplicated entries for ok/not ok tap and tap header --- lib/worker.sh | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/lib/worker.sh b/lib/worker.sh index a04f1117..1fe46a02 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -219,7 +219,7 @@ function LintCodebase() { # Store the linting as a temporary file in TAP format # ####################################################### if IsTAP ; then - echo "not ok ${INDEX} - ${FILE}" >> "${TMPFILE}" + NotOkTap "${INDEX}" "${FILE}" "${TMPFILE}" ########################################## # Report the detailed message if enabled # ########################################## @@ -238,7 +238,7 @@ function LintCodebase() { # Store the linting as a temporary file in TAP format # ####################################################### if IsTAP ; then - echo "ok ${INDEX} - ${FILE}" >> "${TMPFILE}" + OkTap "${INDEX}" "${FILE}" "${TMPFILE}" fi fi done @@ -247,7 +247,7 @@ function LintCodebase() { # Generate report in TAP format # ################################# if IsTAP && [ ${INDEX} -gt 0 ] ; then - printf "TAP version 13\n1..%s\n" "${INDEX}" > "${REPORT_OUTPUT_FILE}" + HeaderTap "${INDEX}" "${REPORT_OUTPUT_FILE}" cat "${TMPFILE}" >> "${REPORT_OUTPUT_FILE}" fi fi @@ -446,7 +446,7 @@ function TestCodebase() { # Store the linting as a temporary file in TAP format # ####################################################### if IsTAP ; then - echo "ok ${TESTS_RAN} - ${FILE_NAME}" >> "${TMPFILE}" + OkTap "${TESTS_RAN}" "${FILE_NAME}" "${TMPFILE}" fi else ####################################### @@ -475,7 +475,7 @@ function TestCodebase() { # Store the linting as a temporary file in TAP format # ####################################################### if IsTAP ; then - echo "not ok ${TESTS_RAN} - ${FILE_NAME}" >> "${TMPFILE}" + NotOkTap "${TESTS_RAN}" "${FILE_NAME}" "${TMPFILE}" ########################################## # Report the detailed message if enabled # ########################################## @@ -491,7 +491,7 @@ function TestCodebase() { # Generate report in TAP format and validate with the expected TAP output # ########################################################################### if IsTAP && [ ${TESTS_RAN} -gt 0 ] ; then - printf "TAP version 13\n1..%s\n" "${TESTS_RAN}" > "${REPORT_OUTPUT_FILE}" + HeaderTap "${TESTS_RAN}" "${REPORT_OUTPUT_FILE}" cat "${TMPFILE}" >> "${REPORT_OUTPUT_FILE}" ######################################################################## @@ -759,7 +759,7 @@ function LintAnsibleFiles() { # Store the linting as a temporary file in TAP format # ####################################################### if IsTAP ; then - echo "not ok ${INDEX} - ${FILE}" >> "${TMPFILE}" + NotOkTap "${INDEX}" "${FILE}" "${TMPFILE}" ########################################## # Report the detailed message if enabled # ########################################## @@ -779,7 +779,7 @@ function LintAnsibleFiles() { # Store the linting as a temporary file in TAP format # ####################################################### if IsTAP ; then - echo "ok ${INDEX} - ${FILE}" >> "${TMPFILE}" + OkTap "${INDEX}" "${FILE}" "${TMPFILE}" fi fi done @@ -788,7 +788,7 @@ function LintAnsibleFiles() { # Generate report in TAP format # ################################# if IsTAP && [ ${INDEX} -gt 0 ] ; then - printf "TAP version 13\n1..%s\n" "${INDEX}" > "${REPORT_OUTPUT_FILE}" + HeaderTap "${INDEX}" "${REPORT_OUTPUT_FILE}" cat "${TMPFILE}" >> "${REPORT_OUTPUT_FILE}" fi else # No ansible directory found in path @@ -824,3 +824,18 @@ function TransformTAPDetails() { echo "${DATA}" | awk 'BEGIN{RS="\n";ORS="\\n"}1' | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" | tr ':' ' ' fi } +################################################################################ +#### Function HeaderTap ######################################################## +function HeaderTap() { + printf "TAP version 13\n1..%s\n" "${1}" > "${2}" +} +################################################################################ +#### Function OkTap ############################################################ +function OkTap() { + echo "ok ${1} - ${2}" >> "${3}" +} +################################################################################ +#### Function NotOkTap ######################################################### +function NotOkTap() { + echo "not ok ${1} - ${2}" >> "${3}" +} \ No newline at end of file From 30c83e65fea66bb4e3be83059d6fc2eb911f38e5 Mon Sep 17 00:00:00 2001 From: Gabo Date: Wed, 15 Jul 2020 16:26:25 -0500 Subject: [PATCH 29/96] Fix rubocop github version --- dependencies/Gemfile | 2 +- dependencies/Gemfile.lock | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dependencies/Gemfile b/dependencies/Gemfile index 10236e74..cf05a444 100644 --- a/dependencies/Gemfile +++ b/dependencies/Gemfile @@ -7,4 +7,4 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } gem "rubocop", "~> 0.82.0" gem "rubocop-rails", "~> 2.5" -gem "rubocop-github", "~> 0.13.0" +gem "rubocop-github", "~> 0.14.0" diff --git a/dependencies/Gemfile.lock b/dependencies/Gemfile.lock index 679edcf3..7dcdae94 100644 --- a/dependencies/Gemfile.lock +++ b/dependencies/Gemfile.lock @@ -27,11 +27,8 @@ GEM rexml ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-github (0.13.0) - rubocop (~> 0.70) - rubocop-performance (~> 1.5.0) - rubocop-performance (1.5.2) - rubocop (>= 0.71.0) + rubocop-github (0.14.0) + rubocop (~> 0.59) rubocop-rails (2.6.0) activesupport (>= 4.2.0) rack (>= 1.1) @@ -48,7 +45,7 @@ PLATFORMS DEPENDENCIES rubocop (~> 0.82.0) - rubocop-github (~> 0.13.0) + rubocop-github (~> 0.14.0) rubocop-rails (~> 2.5) BUNDLED WITH From cee9d3a95695554eb1b4664f1de5d585eb7761f9 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 15 Jul 2020 22:37:46 +0100 Subject: [PATCH 30/96] refactored AddDetailedMessageIfEnabled --- lib/worker.sh | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/lib/worker.sh b/lib/worker.sh index 1fe46a02..36ea789b 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -220,13 +220,7 @@ function LintCodebase() { ####################################################### if IsTAP ; then NotOkTap "${INDEX}" "${FILE}" "${TMPFILE}" - ########################################## - # Report the detailed message if enabled # - ########################################## - DETAILED_MSG=$(TransformTAPDetails "$LINT_CMD") - if [ -n "${DETAILED_MSG}" ] ; then - printf " ---\n message: %s\n ...\n" "$DETAILED_MSG" >> "${TMPFILE}" - fi + AddDetailedMessageIfEnabled "$LINT_CMD" "${TMPFILE}" fi else ########### @@ -476,13 +470,7 @@ function TestCodebase() { ####################################################### if IsTAP ; then NotOkTap "${TESTS_RAN}" "${FILE_NAME}" "${TMPFILE}" - ########################################## - # Report the detailed message if enabled # - ########################################## - DETAILED_MSG=$(TransformTAPDetails "$LINT_CMD") - if [ -n "${DETAILED_MSG}" ] ; then - printf " ---\n message: %s\n ...\n" "${DETAILED_MSG}" >> "${TMPFILE}" - fi + AddDetailedMessageIfEnabled "$LINT_CMD" "${TMPFILE}" fi fi done @@ -760,13 +748,7 @@ function LintAnsibleFiles() { ####################################################### if IsTAP ; then NotOkTap "${INDEX}" "${FILE}" "${TMPFILE}" - ########################################## - # Report the detailed message if enabled # - ########################################## - DETAILED_MSG=$(TransformTAPDetails "$LINT_CMD") - if [ -n "${DETAILED_MSG}" ] ; then - printf " ---\n message: %s\n ...\n" "$DETAILED_MSG" >> "${TMPFILE}" - fi + AddDetailedMessageIfEnabled "${LINT_CMD}" "${TMPFILE}" fi else @@ -838,4 +820,12 @@ function OkTap() { #### Function NotOkTap ######################################################### function NotOkTap() { echo "not ok ${1} - ${2}" >> "${3}" -} \ No newline at end of file +} +################################################################################ +#### Function AddDetailedMessageIfEnabled ###################################### +function AddDetailedMessageIfEnabled() { + DETAILED_MSG=$(TransformTAPDetails "${1}") + if [ -n "${DETAILED_MSG}" ] ; then + printf " ---\n message: %s\n ...\n" "$DETAILED_MSG" >> "${2}" + fi +} From 99f45c3b29cf88351dd08f586c40147c658d4866 Mon Sep 17 00:00:00 2001 From: Gabo Date: Wed, 15 Jul 2020 16:54:38 -0500 Subject: [PATCH 31/96] Rever to non breaking rubocop version --- dependencies/Gemfile | 2 +- dependencies/Gemfile.lock | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dependencies/Gemfile b/dependencies/Gemfile index cf05a444..525cef06 100644 --- a/dependencies/Gemfile +++ b/dependencies/Gemfile @@ -5,6 +5,6 @@ source "https://rubygems.org" git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } -gem "rubocop", "~> 0.82.0" +gem "rubocop", "~> 0.77.0" gem "rubocop-rails", "~> 2.5" gem "rubocop-github", "~> 0.14.0" diff --git a/dependencies/Gemfile.lock b/dependencies/Gemfile.lock index 7dcdae94..f98938fc 100644 --- a/dependencies/Gemfile.lock +++ b/dependencies/Gemfile.lock @@ -18,33 +18,31 @@ GEM ast (~> 2.4.1) rack (2.2.3) rainbow (3.0.0) - rexml (3.2.4) - rubocop (0.82.0) + rubocop (0.77.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) - parser (>= 2.7.0.1) + parser (>= 2.6) rainbow (>= 2.2.2, < 4.0) - rexml ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) + unicode-display_width (>= 1.4.0, < 1.7) rubocop-github (0.14.0) rubocop (~> 0.59) - rubocop-rails (2.6.0) - activesupport (>= 4.2.0) + rubocop-rails (2.5.2) + activesupport rack (>= 1.1) - rubocop (>= 0.82.0) + rubocop (>= 0.72.0) ruby-progressbar (1.10.1) thread_safe (0.3.6) tzinfo (1.2.7) thread_safe (~> 0.1) - unicode-display_width (1.7.0) + unicode-display_width (1.6.1) zeitwerk (2.4.0) PLATFORMS ruby DEPENDENCIES - rubocop (~> 0.82.0) + rubocop (~> 0.77.0) rubocop-github (~> 0.14.0) rubocop-rails (~> 2.5) From b79f67fd7413d8574e6d5bc26f5f9117184752a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2020 05:53:12 +0000 Subject: [PATCH 32/96] Bump cfn-lint from 0.33.2 to 0.34.0 in /dependencies Bumps [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint) from 0.33.2 to 0.34.0. - [Release notes](https://github.com/aws-cloudformation/cfn-python-lint/releases) - [Changelog](https://github.com/aws-cloudformation/cfn-python-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws-cloudformation/cfn-python-lint/compare/v0.33.2...v0.34.0) Signed-off-by: dependabot[bot] --- dependencies/Pipfile.lock | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/dependencies/Pipfile.lock b/dependencies/Pipfile.lock index 9baa7f9a..8da9984c 100644 --- a/dependencies/Pipfile.lock +++ b/dependencies/Pipfile.lock @@ -18,17 +18,16 @@ "default": { "argcomplete": { "hashes": [ - "sha256:5ae7b601be17bf38a749ec06aa07fb04e7b6b5fc17906948dc1866e7facf3740", - "sha256:890bdd1fcbb973ed73db241763e78b6d958580e588c2910b508c770a59ef37d7" + "sha256:2fbe5ed09fd2c1d727d4199feca96569a5b50d44c71b16da9c742201f7cc295c", + "sha256:91dc7f9c7f6281d5a0dce5e73d2e33283aaef083495c13974a7dd197a1cdc949" ], - "version": "==1.11.1" + "version": "==1.12.0" }, "astroid": { "hashes": [ "sha256:2f4078c2a41bf377eea06d71c9d2ba4eb8f6b1af2135bec27bbbb7d8f12bb703", "sha256:bc58d83eb610252fd8de6363e39d4f1d0619c894b0ed24603b881c02e64c7386" ], - "markers": "python_version >= '3.5'", "version": "==2.4.2" }, "attrs": { @@ -36,7 +35,6 @@ "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c", "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==19.3.0" }, "aws-sam-translator": { @@ -49,25 +47,25 @@ }, "boto3": { "hashes": [ - "sha256:c2a223f4b48782e8b160b2130265e2a66081df111f630a5a384d6909e29a5aa9", - "sha256:ce5a4ab6af9e993d1864209cbbb6f4812f65fbc57ad6b95e5967d8bf38b1dcfb" + "sha256:5c2fa8ac4e4a4800d02b11d75b71bb8fcc190d6fbb15d957f99661414e655e10", + "sha256:b093e00e98ab31f98d444efad1738ab4795226f0b05abc6655d747f286f9baf9" ], - "version": "==1.14.16" + "version": "==1.14.21" }, "botocore": { "hashes": [ - "sha256:99d995ef99cf77458a661f3fc64e0c3a4ce77ca30facfdf0472f44b2953dd856", - "sha256:fe0c4f7cd6b67eff3b7cb8dff6709a65d6fca10b7b7449a493b2036915e98b4c" + "sha256:9c4694e413c344ca2fb1175f33a97265dbf7f8a5943fbeafde3161d080b72308", + "sha256:fcbcda16c815744482be4206ed098f4d08f2dfddfb1fcfa0f822f4cfd94adb85" ], - "version": "==1.17.16" + "version": "==1.17.21" }, "cfn-lint": { "hashes": [ - "sha256:b29d172a0910f305162e354fd421594ab575ace6431b7b8884c245dfc5064859", - "sha256:ff9b566bda43a2e74fdd89b57cbf0f76e209e4e666cc4babe7c96cbd3fb56bfe" + "sha256:443e7c1a57a8909050b51873cbf53628e253b6a2ab00fba9d25f89e75f13f1b6", + "sha256:b2a7b9a84688d87d0d49d1dad2602382ba2a8be9d20d87278f4d42c59f71eddc" ], "index": "pypi", - "version": "==0.33.2" + "version": "==0.34.0" }, "decorator": { "hashes": [ @@ -82,7 +80,6 @@ "sha256:9e4d7ecfc600058e07ba661411a2b7de2fd0fafa17d1a7f7361cd47b1175c827", "sha256:a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99" ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==0.15.2" }, "isort": { @@ -90,7 +87,6 @@ "sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1", "sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==4.3.21" }, "jmespath": { @@ -98,7 +94,6 @@ "sha256:b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9", "sha256:cdf6525904cc597730141d61b36f2e4b8ecc257c420fa2f4549bac2c2d0cb72f" ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==0.10.0" }, "jsonpatch": { @@ -114,7 +109,6 @@ "sha256:c192ba86648e05fdae4f08a17ec25180a9aef5008d973407b581798a83975362", "sha256:ff379fa021d1b81ab539f5ec467c7745beb1a5671463f9dcc2b2d458bd361c1e" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.0" }, "jsonschema": { @@ -154,7 +148,6 @@ "sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4", "sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.4.3" }, "mccabe": { @@ -198,7 +191,6 @@ "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c", "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.8.1" }, "pyyaml": { @@ -238,7 +230,6 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.15.0" }, "toml": { From f21e5b435b7e402a0c0171888884c61118c45f2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2020 05:53:27 +0000 Subject: [PATCH 33/96] Bump @coffeelint/cli from 3.2.9 to 3.2.10 in /dependencies Bumps [@coffeelint/cli](https://github.com/coffeelint/coffeelint) from 3.2.9 to 3.2.10. - [Release notes](https://github.com/coffeelint/coffeelint/releases) - [Changelog](https://github.com/coffeelint/coffeelint/blob/master/CHANGELOG.md) - [Commits](https://github.com/coffeelint/coffeelint/compare/v3.2.9...v3.2.10) Signed-off-by: dependabot[bot] --- dependencies/package-lock.json | 53 ++++++---------------------------- dependencies/package.json | 2 +- 2 files changed, 10 insertions(+), 45 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index a097ac07..2e593a45 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -211,18 +211,23 @@ } }, "@coffeelint/cli": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/@coffeelint/cli/-/cli-3.2.9.tgz", - "integrity": "sha512-aPOUjgYG0mwrBopCUpE2hTKtwebBQABUMkEf7xfzEL1TncxbSxrtb+ESGb4WHlNXiVLLxt87v0124jzZVwPshw==", + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/@coffeelint/cli/-/cli-3.2.10.tgz", + "integrity": "sha512-CLFBTPFLjwSsB4M2Vum6LwNDHePszjW2GDWU1mgpMl5vgYmhcjAhCfJqb1qAS2NpBcD31Iwn4zvy5enAztqZUw==", "requires": { "coffeescript": "2.5.1", "glob": "^7.1.6", "ignore": "^5.1.8", "resolve": "^1.17.0", - "strip-json-comments": "^3.1.0", + "strip-json-comments": "^3.1.1", "yargs": "^15.4.1" }, "dependencies": { + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + }, "yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", @@ -524,18 +529,6 @@ } } }, - "@typescript-eslint/experimental-utils": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.0.tgz", - "integrity": "sha512-4Vdf2hvYMUnTdkCNZu+yYlFtL2v+N2R7JOynIOkFbPjf9o9wQvRwRkzUdWlFd2YiiUwJLbuuLnl5civNg5ykOQ==", - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.6.0", - "@typescript-eslint/typescript-estree": "3.6.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, "@typescript-eslint/parser": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.6.1.tgz", @@ -590,34 +583,6 @@ } } }, - "@typescript-eslint/types": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.6.0.tgz", - "integrity": "sha512-JwVj74ohUSt0ZPG+LZ7hb95fW8DFOqBuR6gE7qzq55KDI3BepqsCtHfBIoa0+Xi1AI7fq5nCu2VQL8z4eYftqg==" - }, - "@typescript-eslint/typescript-estree": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.0.tgz", - "integrity": "sha512-G57NDSABHjvob7zVV09ehWyD1K6/YUKjz5+AufObFyjNO4DVmKejj47MHjVHHlZZKgmpJD2yyH9lfCXHrPITFg==", - "requires": { - "@typescript-eslint/types": "3.6.0", - "@typescript-eslint/visitor-keys": "3.6.0", - "debug": "^4.1.1", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.0.tgz", - "integrity": "sha512-p1izllL2Ubwunite0ITjubuMQRBGgjdVYwyG7lXPX8GbrA6qF0uwSRz9MnXZaHMxID4948gX0Ez8v9tUDi/KfQ==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, "JSV": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", diff --git a/dependencies/package.json b/dependencies/package.json index e5a2934d..949f2a72 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -1,7 +1,7 @@ { "name": "super-linter", "dependencies": { - "@coffeelint/cli": "^3.2.9", + "@coffeelint/cli": "^3.2.10", "@stoplight/spectral": "^5.4.0", "@typescript-eslint/eslint-plugin": "^3.6.1", "@typescript-eslint/parser": "^3.6.1", From 5a74a8dce124341137dc71aafab41d1348457456 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2020 05:54:29 +0000 Subject: [PATCH 34/96] Bump yamllint from 1.23.0 to 1.24.1 in /dependencies Bumps [yamllint](https://github.com/adrienverge/yamllint) from 1.23.0 to 1.24.1. - [Release notes](https://github.com/adrienverge/yamllint/releases) - [Changelog](https://github.com/adrienverge/yamllint/blob/master/CHANGELOG.rst) - [Commits](https://github.com/adrienverge/yamllint/compare/v1.23.0...v1.24.1) Signed-off-by: dependabot[bot] --- dependencies/Pipfile.lock | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/dependencies/Pipfile.lock b/dependencies/Pipfile.lock index 9baa7f9a..61f7e327 100644 --- a/dependencies/Pipfile.lock +++ b/dependencies/Pipfile.lock @@ -18,17 +18,16 @@ "default": { "argcomplete": { "hashes": [ - "sha256:5ae7b601be17bf38a749ec06aa07fb04e7b6b5fc17906948dc1866e7facf3740", - "sha256:890bdd1fcbb973ed73db241763e78b6d958580e588c2910b508c770a59ef37d7" + "sha256:2fbe5ed09fd2c1d727d4199feca96569a5b50d44c71b16da9c742201f7cc295c", + "sha256:91dc7f9c7f6281d5a0dce5e73d2e33283aaef083495c13974a7dd197a1cdc949" ], - "version": "==1.11.1" + "version": "==1.12.0" }, "astroid": { "hashes": [ "sha256:2f4078c2a41bf377eea06d71c9d2ba4eb8f6b1af2135bec27bbbb7d8f12bb703", "sha256:bc58d83eb610252fd8de6363e39d4f1d0619c894b0ed24603b881c02e64c7386" ], - "markers": "python_version >= '3.5'", "version": "==2.4.2" }, "attrs": { @@ -36,7 +35,6 @@ "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c", "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==19.3.0" }, "aws-sam-translator": { @@ -49,17 +47,17 @@ }, "boto3": { "hashes": [ - "sha256:c2a223f4b48782e8b160b2130265e2a66081df111f630a5a384d6909e29a5aa9", - "sha256:ce5a4ab6af9e993d1864209cbbb6f4812f65fbc57ad6b95e5967d8bf38b1dcfb" + "sha256:5c2fa8ac4e4a4800d02b11d75b71bb8fcc190d6fbb15d957f99661414e655e10", + "sha256:b093e00e98ab31f98d444efad1738ab4795226f0b05abc6655d747f286f9baf9" ], - "version": "==1.14.16" + "version": "==1.14.21" }, "botocore": { "hashes": [ - "sha256:99d995ef99cf77458a661f3fc64e0c3a4ce77ca30facfdf0472f44b2953dd856", - "sha256:fe0c4f7cd6b67eff3b7cb8dff6709a65d6fca10b7b7449a493b2036915e98b4c" + "sha256:9c4694e413c344ca2fb1175f33a97265dbf7f8a5943fbeafde3161d080b72308", + "sha256:fcbcda16c815744482be4206ed098f4d08f2dfddfb1fcfa0f822f4cfd94adb85" ], - "version": "==1.17.16" + "version": "==1.17.21" }, "cfn-lint": { "hashes": [ @@ -82,7 +80,6 @@ "sha256:9e4d7ecfc600058e07ba661411a2b7de2fd0fafa17d1a7f7361cd47b1175c827", "sha256:a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99" ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==0.15.2" }, "isort": { @@ -90,7 +87,6 @@ "sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1", "sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==4.3.21" }, "jmespath": { @@ -98,7 +94,6 @@ "sha256:b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9", "sha256:cdf6525904cc597730141d61b36f2e4b8ecc257c420fa2f4549bac2c2d0cb72f" ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==0.10.0" }, "jsonpatch": { @@ -114,7 +109,6 @@ "sha256:c192ba86648e05fdae4f08a17ec25180a9aef5008d973407b581798a83975362", "sha256:ff379fa021d1b81ab539f5ec467c7745beb1a5671463f9dcc2b2d458bd361c1e" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.0" }, "jsonschema": { @@ -154,7 +148,6 @@ "sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4", "sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.4.3" }, "mccabe": { @@ -198,7 +191,6 @@ "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c", "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.8.1" }, "pyyaml": { @@ -238,7 +230,6 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.15.0" }, "toml": { @@ -271,11 +262,11 @@ }, "yamllint": { "hashes": [ - "sha256:0fa69bf8a86182b7fe14918bdd3a30354c869966bbc7cbfff176af71bda9c806", - "sha256:59f3ff77f44e7f46be6aecdb985830f73a1c51e290b7082a7d38c2ae1940f4a9" + "sha256:8f92d0c1770369fea467d6c278a4556aca36f753c62b3bf95664e311227e7ebe", + "sha256:c104ff5c29511ea59236cb06a68e34a9663724a35f1fdee736657d90fcb56162" ], "index": "pypi", - "version": "==1.23.0" + "version": "==1.24.1" }, "yq": { "hashes": [ From 619fd160b63cb1012f166ab5b88f4b4022e1227f Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 16 Jul 2020 07:07:22 -0700 Subject: [PATCH 35/96] Use Docker instead of run-time build --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 746fa671..5258faa0 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ author: 'GitHub' description: 'It is a simple combination of various linters, written in bash, to help validate your source code.' runs: using: 'docker' - image: 'Dockerfile' + image: 'docker://github/super-linter' branding: icon: 'check-square' color: 'white' From 6a2d328021d20b50e9d32824302e3de53d797b38 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 16 Jul 2020 07:09:08 -0700 Subject: [PATCH 36/96] specify version --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 5258faa0..6a1284a8 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ author: 'GitHub' description: 'It is a simple combination of various linters, written in bash, to help validate your source code.' runs: using: 'docker' - image: 'docker://github/super-linter' + image: 'docker://github/super-linter:v3' branding: icon: 'check-square' color: 'white' From 7f15e0bf4e95791e78b81aaee58954fdcb3ee5fd Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 16 Jul 2020 09:56:27 -0500 Subject: [PATCH 37/96] fixing ruby --- Dockerfile | 2 +- dependencies/Gemfile | 8 ++++---- dependencies/Gemfile.lock | 29 ++++++++++++++++++----------- lib/linter.sh | 2 +- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index c3b07c9d..814061db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ ARG GLIBC_VERSION='2.31-r0' #################### # Run APK installs # #################### -RUN apk add --no-cache \ +RUN apk add --update --no-cache \ ansible-lint \ bash \ curl \ diff --git a/dependencies/Gemfile b/dependencies/Gemfile index 525cef06..bde8ce96 100644 --- a/dependencies/Gemfile +++ b/dependencies/Gemfile @@ -2,9 +2,9 @@ source "https://rubygems.org" -git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } +git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } - -gem "rubocop", "~> 0.77.0" +gem "rubocop", "~> 0.82.0" +gem "rubocop-github", "~> 0.16.0" +gem "rubocop-performance", "~>1.7.0" gem "rubocop-rails", "~> 2.5" -gem "rubocop-github", "~> 0.14.0" diff --git a/dependencies/Gemfile.lock b/dependencies/Gemfile.lock index f98938fc..cb5ca1b1 100644 --- a/dependencies/Gemfile.lock +++ b/dependencies/Gemfile.lock @@ -18,32 +18,39 @@ GEM ast (~> 2.4.1) rack (2.2.3) rainbow (3.0.0) - rubocop (0.77.0) + rexml (3.2.4) + rubocop (0.82.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) - parser (>= 2.6) + parser (>= 2.7.0.1) rainbow (>= 2.2.2, < 4.0) + rexml ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.7) - rubocop-github (0.14.0) - rubocop (~> 0.59) - rubocop-rails (2.5.2) - activesupport + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-github (0.16.0) + rubocop (<= 0.82.0) + rubocop-performance (~> 1.0) + rubocop-rails (~> 2.0) + rubocop-performance (1.7.0) + rubocop (>= 0.82.0) + rubocop-rails (2.6.0) + activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 0.72.0) + rubocop (>= 0.82.0) ruby-progressbar (1.10.1) thread_safe (0.3.6) tzinfo (1.2.7) thread_safe (~> 0.1) - unicode-display_width (1.6.1) + unicode-display_width (1.7.0) zeitwerk (2.4.0) PLATFORMS ruby DEPENDENCIES - rubocop (~> 0.77.0) - rubocop-github (~> 0.14.0) + rubocop (~> 0.82.0) + rubocop-github (~> 0.16.0) + rubocop-performance (~> 1.7.0) rubocop-rails (~> 2.5) BUNDLED WITH diff --git a/lib/linter.sh b/lib/linter.sh index 451fec90..c63df84e 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1064,7 +1064,7 @@ if [ "$VALIDATE_RUBY" == "true" ]; then # Lint the ruby files # ####################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "RUBY" "rubocop" "rubocop -c $RUBY_LINTER_RULES" ".*\.\(rb\)\$" "${FILE_ARRAY_RUBY[@]}" + LintCodebase "RUBY" "rubocop" "rubocop -c $RUBY_LINTER_RULES --force-exclusion" ".*\.\(rb\)\$" "${FILE_ARRAY_RUBY[@]}" fi ######################## From 88f4978ba3d97a5f98d06603882e27ea5db20c9e Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 16 Jul 2020 10:39:51 -0500 Subject: [PATCH 38/96] BetterRaku --- Dockerfile | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 814061db..b053d51d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,10 +29,6 @@ ARG PSSA_VERSION='latest' ARG ARM_TTK_NAME='master.zip' ARG ARM_TTK_URI='https://github.com/Azure/arm-ttk/archive/master.zip' ARG ARM_TTK_DIRECTORY='/opt/microsoft' -# Raku Linter -ARG RAKU_VER="2020.06" -ARG RAKU_INSTALL_PATH=/usr -ARG RAKUBREW_HOME=/tmp/rakubrew # Dart Linter ## stable dart sdk: https://dart.dev/get-dart#release-channels ARG DART_VERSION='2.8.4' @@ -171,17 +167,9 @@ RUN wget https://storage.googleapis.com/dart-archive/channels/stable/release/${D ################ # Install Raku # ################ -# Environment -ENV PATH="$RAKU_INSTALL_PATH/share/perl6/site/bin:${PATH}" # Basic setup, programs and init -RUN mkdir -p $RAKUBREW_HOME/bin \ - && curl -sSLo $RAKUBREW_HOME/bin/rakubrew https://rakubrew.org/perl/rakubrew \ - && chmod 755 $RAKUBREW_HOME/bin/rakubrew \ - && eval "$($RAKUBREW_HOME/bin/rakubrew init Sh)"\ - && rakubrew build moar $RAKU_VER --configure-opts='--prefix=$RAKU_INSTALL_PATH' \ - && rm -rf $RAKUBREW_HOME/versions/moar-$RAKU_VER \ - && rakubrew build-zef \ - && rm -rf $RAKUBREW_HOME +RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories \ + && apk add --update --no-cache rakudo zef ################################ # Install editorconfig-checker # From 530d643e3ce223f06cd52ae6116ec6402dd1744a Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 16 Jul 2020 11:40:55 -0500 Subject: [PATCH 39/96] found it --- .automation/upload-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index 1c982c63..321b7f1d 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -438,7 +438,7 @@ UploadImage() { exit 1 else # SUCCESS - echo -e "${NC}${F[B]}Successfully Uploaded TAGOR_TAG:${F[W]}[$MAJOR_TAG]${F[B]} Docker image to ${F[C]}$REGISTRY${F[B]}!${NC}" + echo -e "${NC}${F[B]}Successfully Uploaded TAG:${F[W]}[$MAJOR_TAG]${F[B]} of Docker image to ${F[C]}$REGISTRY${F[B]}!${NC}" fi fi } From 5f31131091a3cf0a2fe459e96f54dc56340bf45e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2020 05:26:02 +0000 Subject: [PATCH 40/96] Bump typescript from 3.9.6 to 3.9.7 in /dependencies Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.6 to 3.9.7. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v3.9.6...v3.9.7) Signed-off-by: dependabot[bot] --- dependencies/package-lock.json | 6 +++--- dependencies/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index 2e593a45..7ca7fe83 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -5130,9 +5130,9 @@ } }, "typescript": { - "version": "3.9.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", - "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==" + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==" }, "uc.micro": { "version": "1.0.6", diff --git a/dependencies/package.json b/dependencies/package.json index 949f2a72..763c0f56 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -18,6 +18,6 @@ "standard": "^14.3.4", "stylelint": "^13.6.1", "stylelint-config-standard": "^20.0.0", - "typescript": "^3.9.6" + "typescript": "^3.9.7" } } From 395e01cd20486a9e31b41e3eb8a19f57f915585e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2020 05:29:01 +0000 Subject: [PATCH 41/96] Bump yamllint from 1.24.1 to 1.24.2 in /dependencies Bumps [yamllint](https://github.com/adrienverge/yamllint) from 1.24.1 to 1.24.2. - [Release notes](https://github.com/adrienverge/yamllint/releases) - [Changelog](https://github.com/adrienverge/yamllint/blob/master/CHANGELOG.rst) - [Commits](https://github.com/adrienverge/yamllint/compare/v1.24.1...v1.24.2) Signed-off-by: dependabot[bot] --- dependencies/Pipfile.lock | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dependencies/Pipfile.lock b/dependencies/Pipfile.lock index f7e1a730..9ddf4df3 100644 --- a/dependencies/Pipfile.lock +++ b/dependencies/Pipfile.lock @@ -47,17 +47,16 @@ }, "boto3": { "hashes": [ - "sha256:5c2fa8ac4e4a4800d02b11d75b71bb8fcc190d6fbb15d957f99661414e655e10", - "sha256:b093e00e98ab31f98d444efad1738ab4795226f0b05abc6655d747f286f9baf9" + "sha256:07bd0872e9178b637baefb82aff8abb76197770c9fc60c4d6575564ba878e3e4" ], - "version": "==1.14.21" + "version": "==1.14.22" }, "botocore": { "hashes": [ - "sha256:9c4694e413c344ca2fb1175f33a97265dbf7f8a5943fbeafde3161d080b72308", - "sha256:fcbcda16c815744482be4206ed098f4d08f2dfddfb1fcfa0f822f4cfd94adb85" + "sha256:4d084dfcfcdf21ac2df17d017607ca53d53ac6c2fa17484cdd87ef78daba06b8", + "sha256:f491d3c29d7dda8c8907c520bc96d77a67a8953dfed7f55c250799849e213640" ], - "version": "==1.17.21" + "version": "==1.17.22" }, "cfn-lint": { "hashes": [ @@ -262,11 +261,11 @@ }, "yamllint": { "hashes": [ - "sha256:8f92d0c1770369fea467d6c278a4556aca36f753c62b3bf95664e311227e7ebe", - "sha256:c104ff5c29511ea59236cb06a68e34a9663724a35f1fdee736657d90fcb56162" + "sha256:40b68de6bacdccec1585dbd54072731b10da7fc2f9cfd96517a71f066208b61f", + "sha256:ad3b0d30317dca005d7af99ff27248d459cae2d931a2ff06a134b67bcd405b30" ], "index": "pypi", - "version": "==1.24.1" + "version": "==1.24.2" }, "yq": { "hashes": [ From 29ed8f3edbd5307e07dddcd9bb34126cb134f0e1 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Fri, 17 Jul 2020 13:11:41 -0500 Subject: [PATCH 42/96] Adjust handling of docker dependencies --- Dockerfile | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index b053d51d..242e066c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,17 @@ ########################################### ########################################### +######################################### +# Get dependency images as build stages # +######################################### +FROM borkdude/clj-kondo:2020.06.21 as clj-kondo +FROM dotenvlinter/dotenv-linter:2.0.0 as dotenv-linter +FROM mstruebing/editorconfig-checker:2.1.0 as editorconfig-checker +FROM golangci/golangci-lint:v1.27.0 as golangci-lint +FROM yoheimuta/protolint:v0.25.1 as protolint +FROM koalaman/shellcheck:v0.7.1 as shellcheck +FROM wata727/tflint:0.16.2 as tflint + ################## # Get base image # ################## @@ -120,32 +131,37 @@ RUN curl -sLO "${ARM_TTK_URI}" \ ###################### # Install shellcheck # ###################### -COPY --from=koalaman/shellcheck:v0.7.1 /bin/shellcheck /usr/bin/ +COPY --from=shellcheck /bin/shellcheck /usr/bin/ ##################### # Install Go Linter # ##################### -COPY --from=golangci/golangci-lint:v1.27.0 /usr/bin/golangci-lint /usr/bin/ +COPY --from=golangci-lint /usr/bin/golangci-lint /usr/bin/ ################## # Install TFLint # ################## -COPY --from=wata727/tflint:0.16.2 /usr/local/bin/tflint /usr/bin/ +COPY --from=tflint /usr/local/bin/tflint /usr/bin/ ###################### # Install protolint # ###################### -COPY --from=yoheimuta/protolint:v0.25.1 /usr/local/bin/protolint /usr/bin/ +COPY --from=protolint /usr/local/bin/protolint /usr/bin/ ######################### # Install dotenv-linter # ######################### -COPY --from=dotenvlinter/dotenv-linter:2.0.0 /dotenv-linter /usr/bin/ +COPY --from=dotenv-linter /dotenv-linter /usr/bin/ ##################### # Install clj-kondo # ##################### -COPY --from=borkdude/clj-kondo:2020.06.21 /usr/local/bin/clj-kondo /usr/bin/ +COPY --from=clj-kondo /usr/local/bin/clj-kondo /usr/bin/ + +################################ +# Install editorconfig-checker # +################################ +COPY --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker ################## # Install ktlint # @@ -171,11 +187,6 @@ RUN wget https://storage.googleapis.com/dart-archive/channels/stable/release/${D RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories \ && apk add --update --no-cache rakudo zef -################################ -# Install editorconfig-checker # -################################ -COPY --from=mstruebing/editorconfig-checker:2.1.0 /usr/bin/ec /usr/bin/editorconfig-checker - ########################################### # Load GitHub Env Vars for GitHub Actions # ########################################### From 698aa76a0f64a2674a7afa4ad2a09daa351eb9af Mon Sep 17 00:00:00 2001 From: Sebastian Kunze Date: Sat, 18 Jul 2020 16:36:05 +0200 Subject: [PATCH 43/96] Ansible: fix globbing issue and allow .yaml too --- lib/worker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/worker.sh b/lib/worker.sh index 6310891b..1f2a9bd2 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -604,7 +604,7 @@ function LintAnsibleFiles() { ################################# # Get list of all files to lint # ################################# - mapfile -t LIST_FILES < <(ls "$ANSIBLE_DIRECTORY/*.yml" 2>&1) + mapfile -t LIST_FILES < <(ls "$ANSIBLE_DIRECTORY"/*.{yaml,yml} 2>&1) ############################################################### # Set the list to empty if only MD and TXT files were changed # From 9d6838169617a9da7db47919a653ef68c6507cac Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Sun, 19 Jul 2020 20:26:20 +0100 Subject: [PATCH 44/96] Generate report for the warnings --- lib/linter.sh | 9 +++++++++ lib/worker.sh | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/lib/linter.sh b/lib/linter.sh index c63df84e..b57fc05f 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -177,6 +177,8 @@ TEST_CASE_FOLDER='.automation/test' # Folder for test c echo "${TEST_CASE_FOLDER}" > /dev/null 2>&1 || true # Workaround SC2034 DEFAULT_ANSIBLE_DIRECTORY="$GITHUB_WORKSPACE/ansible" # Default Ansible Directory echo "${DEFAULT_ANSIBLE_DIRECTORY}" > /dev/null 2>&1 || true # Workaround SC2034 +WARNING_ARRAY_TEST=() # Array of warning linters that did not have an expected test result. +echo "${WARNING_ARRAY_TEST[*]}" > /dev/null 2>&1 || true # Workaround SC2034 ############## # Format # @@ -784,6 +786,13 @@ Footer() { fi done + ################################ + # Prints for warnings if found # + ################################ + for TEST in "${WARNING_ARRAY_TEST[@]}"; do + echo -e "${NC}${F[Y]}WARN!${NC} Expected file to compare with was not found for ${TEST}${NC}" + done + ################################## # Exit with 0 if errors disabled # ################################## diff --git a/lib/worker.sh b/lib/worker.sh index 918f5361..721d7022 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -504,6 +504,10 @@ function TestCodebase() { else echo -e "${NC}${F[Y]}WARN!${NC} No TAP expected file found at:[$EXPECTED_FILE]${NC}" echo "skipping report assertions" + ##################################### + # Append the file type to the array # + ##################################### + WARNING_ARRAY_TEST+=("${FILE_TYPE}") fi fi From 0bc699a72ff60259eaf3c2d150437f5e3911ec99 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Sun, 19 Jul 2020 20:38:18 +0100 Subject: [PATCH 45/96] Add more expected reports validations --- .automation/test/arm/reports/expected-ARM.tap | 7 ++++++ .automation/test/cfn/reports/expected-CFN.tap | 22 +++++++++++++++++++ .../reports/expected-CLOJURE.tap.ignored | 7 ++++++ .automation/test/css/reports/expected-CSS.tap | 7 ++++++ .../test/dart/reports/expected-DART.tap | 7 ++++++ .automation/test/env/reports/expected-ENV.tap | 7 ++++++ .../golang/reports/expected-GO.tap.ignored | 7 ++++++ .../html/reports/expected-HTML.tap.ignored | 7 ++++++ .../test/json/reports/expected-JSON.tap | 2 +- .../test/openapi/reports/expected-OPENAPI.tap | 12 ++++++++++ .../reports/expected-POWERSHELL.tap.ignored | 17 ++++++++++++++ .../protobuf/reports/expected-PROTOBUF.tap | 7 ++++++ .../test/raku/reports/expected-RAKU.tap | 7 ++++++ .../test/ruby/reports/expected-RUBY.tap | 2 +- .../terraform/reports/expected-TERRAFORM.tap | 7 ++++++ 15 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 .automation/test/arm/reports/expected-ARM.tap create mode 100644 .automation/test/cfn/reports/expected-CFN.tap create mode 100644 .automation/test/clojure/reports/expected-CLOJURE.tap.ignored create mode 100644 .automation/test/css/reports/expected-CSS.tap create mode 100644 .automation/test/dart/reports/expected-DART.tap create mode 100644 .automation/test/env/reports/expected-ENV.tap create mode 100644 .automation/test/golang/reports/expected-GO.tap.ignored create mode 100644 .automation/test/html/reports/expected-HTML.tap.ignored create mode 100644 .automation/test/openapi/reports/expected-OPENAPI.tap create mode 100644 .automation/test/powershell/reports/expected-POWERSHELL.tap.ignored create mode 100644 .automation/test/protobuf/reports/expected-PROTOBUF.tap create mode 100644 .automation/test/raku/reports/expected-RAKU.tap create mode 100644 .automation/test/terraform/reports/expected-TERRAFORM.tap diff --git a/.automation/test/arm/reports/expected-ARM.tap b/.automation/test/arm/reports/expected-ARM.tap new file mode 100644 index 00000000..1866f179 --- /dev/null +++ b/.automation/test/arm/reports/expected-ARM.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - arm_bad_1.json + --- + message: \nValidating arm\arm_bad_1.json\n deploymentTemplate\n [+] adminUsername Should Not Be A Literal (109 ms)\n [+] apiVersions Should Be Recent (121 ms)\n [+] artifacts parameter (13 ms)\n [+] DependsOn Best Practices (7 ms)\n [+] Deployment Resources Must Not Be Debug (6 ms)\n [+] DeploymentTemplate Schema Is Correct (4 ms)\n [+] Dynamic Variable References Should Not Use Concat (8 ms)\n [+] IDs Should Be Derived From ResourceIDs (40 ms)\n [?] Location Should Not Be Hardcoded (5 ms)\n Skipped because IsMainTemplate was missing\n\n [+] ManagedIdentityExtension must not be used (54 ms)\n [+] Min And Max Value Are Numbers (6 ms)\n [+] Outputs Must Not Contain Secrets (15 ms)\n [+] Parameters Must Be Referenced (9 ms)\n [+] Parameters Property Must Exist (2 ms)\n [+] providers apiVersions Is Not Permitted (2 ms)\n [+] ResourceIds should not contain (14 ms)\n [+] Resources Should Have Location (3 ms)\n [+] Secure String Parameters Cannot Have Default (4 ms)\n [-] Template Should Not Contain Blanks (33 ms)\n Empty property [] found on line 28 Index 1331\n Empty property "" found on line 3 Index 121\n\n [-] Variables Must Be Referenced (35 ms)\n Unreferenced variable Network.Location\n Unreferenced variable Test.Blank.Variable\n\n [+] Virtual Machines Should Not Be Preview (17 ms)\n [+] VM Images Should Use Latest Version (1 ms)\n [+] VM Size Should Be A Parameter (15 ms)\n \n + ... +ok 2 - arm_good_1.json diff --git a/.automation/test/cfn/reports/expected-CFN.tap b/.automation/test/cfn/reports/expected-CFN.tap new file mode 100644 index 00000000..98466237 --- /dev/null +++ b/.automation/test/cfn/reports/expected-CFN.tap @@ -0,0 +1,22 @@ +TAP version 13 +1..8 +not ok 1 - cfn_bad_1.json + --- + message: E3001 Invalid or unsupported Type AWS Route53 HostedZonee for resource DNS in us-east-1\n/tmp/lint/.automation/test/cfn/cfn_bad_1.json 6 10\n + ... +not ok 2 - cfn_bad_2.yaml + --- + message: E3001 Invalid or unsupported Type AWS Route53 HostedZonee for resource DNS in us-east-1\n/tmp/lint/.automation/test/cfn/cfn_bad_2.yaml 5 5\n + ... +not ok 3 - cfn_bad_3.json + --- + message: E3002 Invalid Property Resources/myDNSRecord/Properties/Ttl\n/tmp/lint/.automation/test/cfn/cfn_bad_3.json 11 13\n + ... +not ok 4 - cfn_bad_4.yaml + --- + message: E3002 Invalid Property Resources/myDNSRecord/Properties/Ttl\n/tmp/lint/.automation/test/cfn/cfn_bad_4.yaml 9 7\n + ... +ok 5 - cfn_good_1.json +ok 6 - cfn_good_2.yaml +ok 7 - cfn_good_3.json +ok 8 - cfn_good_4.yaml diff --git a/.automation/test/clojure/reports/expected-CLOJURE.tap.ignored b/.automation/test/clojure/reports/expected-CLOJURE.tap.ignored new file mode 100644 index 00000000..63784819 --- /dev/null +++ b/.automation/test/clojure/reports/expected-CLOJURE.tap.ignored @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - clojure_bad_1.clj + --- + message: /tmp/lint/.automation/test/clojure/clojure_bad_1.clj 5 5 warning namespace clojure.set is required but never used\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 8 2 error unresolved symbol but-last\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 12 1 error clojure.string/join is called with 0 args but expects 1 or 2\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 15 17 warning unused binding y\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 17 3 warning redundant do\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 19 5 warning inline def\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 22 7 warning Redundant let expression.\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 22 13 warning unused binding z\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 24 9 error y is called with 1 arg but expects 0\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 26 9 error recur argument count mismatch (expected 2, got 0)\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 29 9 error h is called with 1 arg but expects 0\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 30 9 error f is called with 1 arg but expects 0\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 34 1 warning redefined var #'foo/private-fn\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 34 8 warning Unused private var foo/private-fn\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 38 6 error Expected number, received keyword.\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 42 1 error java.lang.Thread/sleep is called with 3 args but expects 1 or 2\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 48 1 error foo/foo-fn is called with 0 args but expects 2\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 51 1 error #'foo/private-fn is private\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 54 7 error duplicate key a\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 56 5 error duplicate set element 1\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 58 7 error missing value for key b\n/tmp/lint/.automation/test/clojure/clojure_bad_1.clj 64 3 warning missing test assertion\nlinting took 18ms, errors 13, warnings 9\n + ... +ok 2 - clojure_good_1.clj diff --git a/.automation/test/css/reports/expected-CSS.tap b/.automation/test/css/reports/expected-CSS.tap new file mode 100644 index 00000000..98d94702 --- /dev/null +++ b/.automation/test/css/reports/expected-CSS.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - css_bad_01.css + --- + message: \ncss/css_bad_01.css\n 2 1 ✖ Expected empty line before comment comment-empty-line-before\n 3 1 ✖ Expected empty line before comment comment-empty-line-before\n 5 5 ✖ Expected indentation of 2 spaces indentation \n 5 33 ✖ Expected "#FFFFFF" to be "#ffffff" color-hex-case \n 5 33 ✖ Expected "#FFFFFF" to be "#FFF" color-hex-length \n 6 5 ✖ Expected indentation of 2 spaces indentation \n 7 5 ✖ Expected indentation of 2 spaces indentation \n 8 5 ✖ Expected indentation of 2 spaces indentation \n 8 12 ✖ Expected "#AAAAAA" to be "#aaaaaa" color-hex-case \n 8 12 ✖ Expected "#AAAAAA" to be "#AAA" color-hex-length\n + ... +ok 2 - css_good_01.css diff --git a/.automation/test/dart/reports/expected-DART.tap b/.automation/test/dart/reports/expected-DART.tap new file mode 100644 index 00000000..6ca0aa21 --- /dev/null +++ b/.automation/test/dart/reports/expected-DART.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - dart_bad_1.dart + --- + message: Analyzing /tmp/lint/.automation/test/dart/dart_bad_1.dart...\n lint • Use `;` instead of `{}` for empty constructor bodies. • dart/dart_bad_1.dart 4 25 • empty_constructor_bodies\n1 lint found.\n + ... +ok 2 - dart_good_1.dart diff --git a/.automation/test/env/reports/expected-ENV.tap b/.automation/test/env/reports/expected-ENV.tap new file mode 100644 index 00000000..73030e1c --- /dev/null +++ b/.automation/test/env/reports/expected-ENV.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - env_bad_1.env + --- + message: env/env_bad_1.env 1 LeadingCharacter Invalid leading character detected\nenv/env_bad_1.env 2 KeyWithoutValue The MY_ENV key should be with a value or have an equal sign\nenv/env_bad_1.env 3 IncorrectDelimiter The DB-NAME key has incorrect delimiter\nenv/env_bad_1.env 3 UnorderedKey The DB-NAME key should go before the LOGGER_LEVEL key\nenv/env_bad_1.env 4 LowercaseKey The DEbUG_hTTP key should be in uppercase\nenv/env_bad_1.env 4 UnorderedKey The DEbUG_hTTP key should go before the LOGGER_LEVEL key\nenv/env_bad_1.env 5 UnorderedKey The DB_NAME key should go before the DEbUG_hTTP key\n + ... +ok 2 - env_good_1.env diff --git a/.automation/test/golang/reports/expected-GO.tap.ignored b/.automation/test/golang/reports/expected-GO.tap.ignored new file mode 100644 index 00000000..13d6c1a7 --- /dev/null +++ b/.automation/test/golang/reports/expected-GO.tap.ignored @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - golang_bad_01.go + --- + message: level=error msg="[linters context] typechecking error golang/golang_bad_01.go 1 1 expected 'package', found 'if'"\nlevel=warning msg="[runner] Can't run linter goanalysis_metalinter S1005 failed prerequisites [(inspect@command-line-arguments, isgenerated@command-line-arguments) analysis skipped errors in package [- golang/golang_bad_01.go 1 1 expected 'package', found 'if']]"\nlevel=warning msg="[runner] Can't run linter unused buildir analysis skipped errors in package [- golang/golang_bad_01.go 1 1 expected 'package', found 'if']"\nlevel=error msg="Running error buildir analysis skipped errors in package [- golang/golang_bad_01.go 1 1 expected 'package', found 'if']"\n + ... +ok 2 - golang_good_01.go diff --git a/.automation/test/html/reports/expected-HTML.tap.ignored b/.automation/test/html/reports/expected-HTML.tap.ignored new file mode 100644 index 00000000..68a1d69f --- /dev/null +++ b/.automation/test/html/reports/expected-HTML.tap.ignored @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - html_bad_01.html + --- + message: \n Config loaded /tmp/lint/.github/linters/.htmlhintrc\n\n /tmp/lint/.automation/test/html/html_bad_01.html\n L8 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L8 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L8 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L9 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L9 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L9 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L10 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L10 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L10 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L11 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L11 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L11 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L12 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L12 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L12 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L13 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L13 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L13 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L14 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L14 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L14 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L15 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L15 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L15 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L16 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L16 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L16 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L17 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L17 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L17 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L18 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L18 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L18 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L19 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L19 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L19 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L20 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L20 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L20 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L21 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L21 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L21 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L22 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L22 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L22 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L23 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L23 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L23 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L24 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L24 |
\n ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)\n L24 |
\n ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)\n L25 | \n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L26 |
\n ^ Special characters must be escaped [ < ]. (spec-char-escape)\n L26 |
\n ^ Special characters must be escaped [ > ]. (spec-char-escape)\n L28 |
\n ^ Tag must be paired, no start tag [
] (tag-pair)\n L29 | \n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L30 | \n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L31 | \n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L32 | \n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L38 |
\n ^ The value of attribute [ class ] must be in double quotes. (attr-value-double-quotes)\n L38 |
\n ^ The value of attribute [ what ] must be in double quotes. (attr-value-double-quotes)\n L38 |
\n ^ The value of attribute [ something ] must be in double quotes. (attr-value-double-quotes)\n L44 | \n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L50 |
\n ^ The value of attribute [ class ] must be in double quotes. (attr-value-double-quotes)\n L50 |
\n ^ The value of attribute [ what ] must be in double quotes. (attr-value-double-quotes)\n L50 |
\n ^ The value of attribute [ something ] must be in double quotes. (attr-value-double-quotes)\n L56 | \n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L62 |
\n ^ The value of attribute [ class ] must be in double quotes. (attr-value-double-quotes)\n L62 |
\n ^ The value of attribute [ what ] must be in double quotes. (attr-value-double-quotes)\n L62 |
\n ^ The value of attribute [ something ] must be in double quotes. (attr-value-double-quotes)\n L68 | \n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L74 |
\n ^ The value of attribute [ class ] must be in double quotes. (attr-value-double-quotes)\n L74 |
\n ^ The value of attribute [ what ] must be in double quotes. (attr-value-double-quotes)\n L74 |
\n ^ The value of attribute [ something ] must be in double quotes. (attr-value-double-quotes)\n L80 | \n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L81 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L82 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L83 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L84 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L85 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L86 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L87 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L88 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L89 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L90 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L91 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L92 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L93 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L94 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L95 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L96 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n L97 |\n ^ Tag must be paired, no start tag [ ] (tag-pair)\n\nScanned 1 files, found 92 errors in 1 files (27 ms)\n + ... +ok 2 - html_good_01.html diff --git a/.automation/test/json/reports/expected-JSON.tap b/.automation/test/json/reports/expected-JSON.tap index 2b43a1ec..e9be32b5 100644 --- a/.automation/test/json/reports/expected-JSON.tap +++ b/.automation/test/json/reports/expected-JSON.tap @@ -2,6 +2,6 @@ TAP version 13 1..2 not ok 1 - json_bad_1.json --- - message: Error Parse error on line 6 \n...ng" { "level" 'ignore', "space\n----------------------^\nExpecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'\n at Object.parseError (/usr/lib/node_modules/jsonlint/lib/jsonlint.js 55 11)\n at Object.parse (/usr/lib/node_modules/jsonlint/lib/jsonlint.js 132 22)\n at parse (/usr/lib/node_modules/jsonlint/lib/cli.js 82 14)\n at main (/usr/lib/node_modules/jsonlint/lib/cli.js 135 14)\n at Object. (/usr/lib/node_modules/jsonlint/lib/cli.js 179 1)\n at Module._compile (internal/modules/cjs/loader.js 1138 30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js 1158 10)\n at Module.load (internal/modules/cjs/loader.js 986 32)\n at Function.Module._load (internal/modules/cjs/loader.js 879 14)\n at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js 71 12)\n + message: Error Parse error on line 6 \n...ng" { "level" 'ignore', "space\n----------------------^\nExpecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'\n at Object.parseError (/node_modules/jsonlint/lib/jsonlint.js 55 11)\n at Object.parse (/node_modules/jsonlint/lib/jsonlint.js 132 22)\n at parse (/node_modules/jsonlint/lib/cli.js 82 14)\n at main (/node_modules/jsonlint/lib/cli.js 135 14)\n at Object. (/node_modules/jsonlint/lib/cli.js 179 1)\n at Module._compile (internal/modules/cjs/loader.js 1138 30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js 1158 10)\n at Module.load (internal/modules/cjs/loader.js 986 32)\n at Function.Module._load (internal/modules/cjs/loader.js 879 14)\n at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js 71 12)\n ... ok 2 - json_good_1.json diff --git a/.automation/test/openapi/reports/expected-OPENAPI.tap b/.automation/test/openapi/reports/expected-OPENAPI.tap new file mode 100644 index 00000000..a57d14bc --- /dev/null +++ b/.automation/test/openapi/reports/expected-OPENAPI.tap @@ -0,0 +1,12 @@ +TAP version 13 +1..4 +not ok 1 - openapi_bad_1.ymlopenapi + --- + message: OpenAPI 3.x detected\n\n/tmp/lint/.automation/test/openapi/openapi_bad_1.ymlopenapi\n 1 1 warning info-contact Info object should contain `contact` object.\n 1 1 warning info-description OpenAPI object info `description` must be present and non-empty string.\n 1 1 warning oas3-api-servers OpenAPI `servers` must be present and non-empty array.\n 1 1 error oas3-schema Object should have required property `info`.\n 1 1 warning openapi-tags OpenAPI object should have non-empty `tags` array.\n\n✖ 5 problems (1 error, 4 warnings, 0 infos, 0 hints)\n + ... +not ok 2 - openapi_bad_2.jsonopenapi + --- + message: OpenAPI 3.x detected\n\n/tmp/lint/.automation/test/openapi/openapi_bad_2.jsonopenapi\n 1 1 warning info-contact Info object should contain `contact` object.\n 1 1 warning info-description OpenAPI object info `description` must be present and non-empty string.\n 1 1 warning oas3-api-servers OpenAPI `servers` must be present and non-empty array.\n 1 1 error oas3-schema Object should have required property `info`.\n 1 1 warning openapi-tags OpenAPI object should have non-empty `tags` array.\n\n✖ 5 problems (1 error, 4 warnings, 0 infos, 0 hints)\n + ... +ok 3 - openapi_good_1.ymlopenapi +ok 4 - openapi_good_2.jsonopenapi diff --git a/.automation/test/powershell/reports/expected-POWERSHELL.tap.ignored b/.automation/test/powershell/reports/expected-POWERSHELL.tap.ignored new file mode 100644 index 00000000..c1ba772d --- /dev/null +++ b/.automation/test/powershell/reports/expected-POWERSHELL.tap.ignored @@ -0,0 +1,17 @@ +TAP version 13 +1..6 +not ok 1 - powershell_bad_1.ps1 + --- + message: \nRuleName Severity ScriptName Line Message\n-------- -------- ---------- ---- -------\nPSAvoidUsingEmptyCatchBlock Warning powershell 12 Empty catch b\n _bad_1.ps1 lock is used.\n Please use W\n rite-Error or\n throw statem\n ents in catch\n blocks.\nPSAvoidUsingUsernameAndPasswordPara Error powershell 4 Function 'Bad\nms _bad_1.ps1 Function' has\n both Usernam\n e and Passwor\n d parameters.\n Either set t\n he type of th\n e Password pa\n rameter to Se\n cureString or\n replace the\n Username and\n Password para\n meters with a\n Credential p\n arameter of t\n ype PSCredent\n ial. If using\n a Credential\n parameter in\n PowerShell 4\n .0 or earlier\n , please defi\n ne a credenti\n al transforma\n tion attribut\n e after the P\n SCredential t\n ype attribute\n .\nPSAvoidTrailingWhitespace Information powershell 11 Line has trai\n _bad_1.ps1 ling whitespa\n ce\nPSAvoidUsingPlainTextForPassword Warning powershell 5 Parameter '$P\n _bad_1.ps1 assword' shou\n ld use Secure\n String, other\n wise this wil\n l expose sens\n itive informa\n tion. See Con\n vertTo-Secure\n String for mo\n re informatio\n n.\nPSUseDeclaredVarsMoreThanAssignment Warning powershell 9 The variable\ns _bad_1.ps1 'VariableThat\n IsNotUsedLate\n r' is assigne\n d but never u\n sed.\n + ... +not ok 2 - powershell_bad_1.psd1 + --- + message: \nRuleName Severity ScriptName Line Message\n-------- -------- ---------- ---- -------\nTerminatorExpectedAtEndOfString ParseError powershell 2 The string is\n _bad_1.psd missing the\n 1 terminator '\n .\nMissingEndCurlyBrace ParseError powershell 1 Missing closi\n _bad_1.psd ng '}' in sta\n 1 tement block\n or type defin\n ition.\n + ... +not ok 3 - powershell_bad_1.psm1 + --- + message: \nRuleName Severity ScriptName Line Message\n-------- -------- ---------- ---- -------\nTerminatorExpectedAtEndOfString ParseError powershell 1 The string is\n _bad_1.psm missing the\n 1 terminator "\n .\n + ... +ok 4 - powershell_good_1.ps1 +ok 5 - powershell_good_1.psd1 +ok 6 - powershell_good_1.psm1 diff --git a/.automation/test/protobuf/reports/expected-PROTOBUF.tap b/.automation/test/protobuf/reports/expected-PROTOBUF.tap new file mode 100644 index 00000000..14453e36 --- /dev/null +++ b/.automation/test/protobuf/reports/expected-PROTOBUF.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - protobuf_bad_1.proto + --- + message: [protobuf/protobuf_bad_1.proto 8 1] The order of Import is invalid. Check if the file is ordered in the correct manner.\n[protobuf/protobuf_bad_1.proto 18 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 19 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 20 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 21 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 24 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 26 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 28 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 25 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 27 7] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 29 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 30 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 31 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 34 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 47 5] Found an incorrect indentation style " ". " " is correct.\n[protobuf/protobuf_bad_1.proto 3 1] The line length is 91, but it must be shorter than 80\n[protobuf/protobuf_bad_1.proto 4 1] Package name "examplePb" must only contains lowercase letters, digits and/or periods.\n[protobuf/protobuf_bad_1.proto 8 1] Imports are not sorted.\n[protobuf/protobuf_bad_1.proto 9 1] Imports are not sorted.\n[protobuf/protobuf_bad_1.proto 14 1] Imports are not sorted.\n[protobuf/protobuf_bad_1.proto 15 1] Imports are not sorted.\n[protobuf/protobuf_bad_1.proto 19 5] EnumField name "UNKNOWN" with zero value should have the suffix "UNSPECIFIED"\n[protobuf/protobuf_bad_1.proto 17 1] Enum name "enumAllowingAlias" must be UpperCamelCase\n[protobuf/protobuf_bad_1.proto 36 3] Field "inner_message" should avoid required for proto3\n[protobuf/protobuf_bad_1.proto 37 3] Group "Result" should be avoided for proto3\n[protobuf/protobuf_bad_1.proto 40 3] Group "Result" should be avoided for proto3\n[protobuf/protobuf_bad_1.proto 43 3] Group "Regular" should be avoided for proto3\n[protobuf/protobuf_bad_1.proto 29 5] Repeated field name "inner_message" must be pluralized name "inner_messages"\n[protobuf/protobuf_bad_1.proto 40 3] Repeated group name "Result" must be pluralized name "Results"\n[protobuf/protobuf_bad_1.proto 42 3] Repeated field name "paper" must be pluralized name "papers"\n[protobuf/protobuf_bad_1.proto 43 3] Repeated group name "Regular" must be pluralized name "Regulars"\n[protobuf/protobuf_bad_1.proto 23 1] Message name "outer" must be UpperCamelCase\n[protobuf/protobuf_bad_1.proto 26 5] Message name "inner" must be UpperCamelCase\n[protobuf/protobuf_bad_1.proto 47 5] RPC name "search" must be UpperCamelCase\n + ... +ok 2 - protobuf_good_1.proto diff --git a/.automation/test/raku/reports/expected-RAKU.tap b/.automation/test/raku/reports/expected-RAKU.tap new file mode 100644 index 00000000..13ce7ff5 --- /dev/null +++ b/.automation/test/raku/reports/expected-RAKU.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - raku_bad_1.raku + --- + message: ===SORRY!=== Error while compiling /tmp/lint/.automation/test/raku/raku_bad_1.raku\nVariable '$foo' is not declared. Did you mean '@foo'?\nat /tmp/lint/.automation/test/raku/raku_bad_1.raku 4\n------> ⏏$foo[1] = 42\n + ... +ok 2 - raku_good_1.raku diff --git a/.automation/test/ruby/reports/expected-RUBY.tap b/.automation/test/ruby/reports/expected-RUBY.tap index 3f0a1372..df404771 100644 --- a/.automation/test/ruby/reports/expected-RUBY.tap +++ b/.automation/test/ruby/reports/expected-RUBY.tap @@ -2,6 +2,6 @@ TAP version 13 1..2 not ok 1 - ruby_bad_1.rb --- - message: /usr/lib/ruby/gems/2.7.0/gems/rubocop-0.74.0/lib/rubocop/config_loader_resolver.rb 76 warning Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call\n/usr/lib/ruby/gems/2.7.0/gems/rubocop-0.74.0/lib/rubocop/config_loader_resolver.rb 84 warning The called method `merge' is defined here\nInspecting 1 file\nC\n\nOffenses \n\nruby/ruby_bad_1.rb 1 1 C Style/FrozenStringLiteralComment Missing magic comment # frozen_string_literal true.\nruby/ruby_bad_1.rb 11 11 C Style/StringLiterals Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.\nFile.open('/tmp/urls.txt', " w" ) do | file|\n ^^^^^^^^^^^^^^^\nruby/ruby_bad_1.rb 11 32 C Layout/SpaceInsideParens Space inside parentheses detected.\nFile.open('/tmp/urls.txt', " w" ) do | file|\n ^\nruby/ruby_bad_1.rb 11 39 C Layout/SpaceAroundBlockParameters Space before first block parameter detected.\nFile.open('/tmp/urls.txt', " w" ) do | file|\n ^\nruby/ruby_bad_1.rb 12 24 C Layout/SpaceAroundBlockParameters Space after last block parameter detected.\n Hook.active.map do |h |\n ^\nruby/ruby_bad_1.rb 13 13 C Layout/SpaceInsideArrayLiteralBrackets Do not use space inside array brackets.\n urls = [ ARRAY_OF_URLS_CALLING_INSTANCE]\n ^\n\n1 file inspected, 6 offenses detected\n + message: Inspecting 1 file\nC\n\nOffenses \n\nruby/ruby_bad_1.rb 1 1 C Style/FrozenStringLiteralComment Missing frozen string literal comment.\nruby/ruby_bad_1.rb 11 11 C Style/StringLiterals Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.\nFile.open('/tmp/urls.txt', " w" ) do | file|\n ^^^^^^^^^^^^^^^\nruby/ruby_bad_1.rb 11 32 C Layout/SpaceInsideParens Space inside parentheses detected.\nFile.open('/tmp/urls.txt', " w" ) do | file|\n ^\nruby/ruby_bad_1.rb 11 39 C Layout/SpaceAroundBlockParameters Space before first block parameter detected.\nFile.open('/tmp/urls.txt', " w" ) do | file|\n ^\nruby/ruby_bad_1.rb 12 24 C Layout/SpaceAroundBlockParameters Space after last block parameter detected.\n Hook.active.map do |h |\n ^\nruby/ruby_bad_1.rb 13 13 C Layout/SpaceInsideArrayLiteralBrackets Do not use space inside array brackets.\n urls = [ ARRAY_OF_URLS_CALLING_INSTANCE]\n ^\n\n1 file inspected, 6 offenses detected\n ... ok 2 - ruby_good_1.rb diff --git a/.automation/test/terraform/reports/expected-TERRAFORM.tap b/.automation/test/terraform/reports/expected-TERRAFORM.tap new file mode 100644 index 00000000..3434675d --- /dev/null +++ b/.automation/test/terraform/reports/expected-TERRAFORM.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - terraform_bad_1.tf + --- + message: Failed to load configurations. 1 error(s) occurred \n\nError Invalid expression\n\n on /tmp/lint/.automation/test/terraform/bad/terraform_bad_1.tf line 3, in resource "aws_instance" "bad" \n 3 instance_type = # invalid type!\n 4 }\n\nExpected the start of an expression, but found an invalid expression token.\n + ... +ok 2 - terraform_good_1.tf From 9c24338fe858ed8cadf40ba21e010a899584750c Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Sun, 19 Jul 2020 20:45:10 +0100 Subject: [PATCH 46/96] Add editor-config tests to the automation --- lib/worker.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/worker.sh b/lib/worker.sh index 1f2a9bd2..74cf5ff3 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -498,6 +498,7 @@ function RunTestCases() { # Test case languages # ####################### # TestCodebase "Language" "Linter" "Linter-command" "Regex to find files" "Test Folder" + TestCodebase "EDITORCONFIG" "editorconfig-checker" "editorconfig-checker" "^.*$" "editorconfig-checker" TestCodebase "YML" "yamllint" "yamllint -c $YAML_LINTER_RULES" ".*\.\(yml\|yaml\)\$" "yml" TestCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "json" TestCodebase "XML" "xmllint" "xmllint" ".*\.\(xml\)\$" "xml" From ef1cc10e1d6ba2eb8d34e86b7b0bf4125f329d29 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Sun, 19 Jul 2020 20:48:04 +0100 Subject: [PATCH 47/96] Alphabetic order for the TestCodebase --- lib/worker.sh | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/worker.sh b/lib/worker.sh index 74cf5ff3..c45d6465 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -498,37 +498,37 @@ function RunTestCases() { # Test case languages # ####################### # TestCodebase "Language" "Linter" "Linter-command" "Regex to find files" "Test Folder" - TestCodebase "EDITORCONFIG" "editorconfig-checker" "editorconfig-checker" "^.*$" "editorconfig-checker" - TestCodebase "YML" "yamllint" "yamllint -c $YAML_LINTER_RULES" ".*\.\(yml\|yaml\)\$" "yml" - TestCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "json" - TestCodebase "XML" "xmllint" "xmllint" ".*\.\(xml\)\$" "xml" - TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c $MD_LINTER_RULES" ".*\.\(md\)\$" "markdown" + TestCodebase "ANSIBLE" "ansible-lint" "ansible-lint -v -c $ANSIBLE_LINTER_RULES" ".*\.\(yml\|yaml\)\$" "ansible" + TestCodebase "ARM" "arm-ttk" "Import-Module $ARM_TTK_PSD1 ; \$config = \$(Import-PowerShellDataFile -Path $ARM_LINTER_RULES) ; Test-AzTemplate @config -TemplatePath" ".*\.\(json\)\$" "arm" TestCodebase "BASH" "shellcheck" "shellcheck --color" ".*\.\(sh\|bash\|dash\|ksh\)\$" "shell" - TestCodebase "PYTHON" "pylint" "pylint --rcfile $PYTHON_LINTER_RULES" ".*\.\(py\)\$" "python" - TestCodebase "PERL" "perl" "perl -Mstrict -cw" ".*\.\(pl\)\$" "perl" - TestCodebase "RAKU" "raku" "raku -c" ".*\.\(raku\|rakumod\|rakutest\|pm6\|pl6\|p6\)\$" "raku" - TestCodebase "PHP" "php" "php -l" ".*\.\(php\)\$" "php" - TestCodebase "RUBY" "rubocop" "rubocop -c $RUBY_LINTER_RULES" ".*\.\(rb\)\$" "ruby" - TestCodebase "GO" "golangci-lint" "golangci-lint run -c $GO_LINTER_RULES" ".*\.\(go\)\$" "golang" + TestCodebase "CFN" "cfn-lint" "cfn-lint --config-file $CFN_LINTER_RULES" ".*\.\(json\|yml\|yaml\)\$" "cfn" + TestCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES --lint" ".*\.\(clj\|cljs\|cljc\|edn\)\$" "clojure" TestCodebase "COFFEESCRIPT" "coffeelint" "coffeelint -f $COFFEESCRIPT_LINTER_RULES" ".*\.\(coffee\)\$" "coffeescript" + TestCodebase "CSS" "stylelint" "stylelint --config $CSS_LINTER_RULES" ".*\.\(css\)\$" "css" + TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart" + TestCodebase "DOCKER" "dockerfilelint" "dockerfilelint -c $DOCKER_LINTER_RULES" ".*\(Dockerfile\)\$" "docker" + TestCodebase "EDITORCONFIG" "editorconfig-checker" "editorconfig-checker" "^.*$" "editorconfig-checker" + TestCodebase "ENV" "dotenv-linter" "dotenv-linter" ".*\.\(env\)\$" "env" + TestCodebase "GO" "golangci-lint" "golangci-lint run -c $GO_LINTER_RULES" ".*\.\(go\)\$" "golang" + TestCodebase "HTML" "htmlhint" "htmlhint --config $HTML_LINTER_RULES" ".*\.\(html\)\$" "html" TestCodebase "JAVASCRIPT_ES" "eslint" "eslint --no-eslintrc -c $JAVASCRIPT_LINTER_RULES" ".*\.\(js\)\$" "javascript" TestCodebase "JAVASCRIPT_STANDARD" "standard" "standard $JAVASCRIPT_STANDARD_LINTER_RULES" ".*\.\(js\)\$" "javascript" + TestCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "json" + TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin" + TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c $MD_LINTER_RULES" ".*\.\(md\)\$" "markdown" + TestCodebase "PERL" "perl" "perl -Mstrict -cw" ".*\.\(pl\)\$" "perl" + TestCodebase "PHP" "php" "php -l" ".*\.\(php\)\$" "php" + TestCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" ".*\.\(ymlopenapi\|jsonopenapi\)\$" "openapi" + TestCodebase "POWERSHELL" "pwsh" "Invoke-ScriptAnalyzer -EnableExit -Settings $POWERSHELL_LINTER_RULES -Path" ".*\.\(ps1\|psm1\|psd1\|ps1xml\|pssc\|psrc\|cdxml\)\$" "powershell" + TestCodebase "PROTOBUF" "protolint" "protolint lint --config_path $PROTOBUF_LINTER_RULES" ".*\.\(proto\)\$" "protobuf" + TestCodebase "PYTHON" "pylint" "pylint --rcfile $PYTHON_LINTER_RULES" ".*\.\(py\)\$" "python" + TestCodebase "RAKU" "raku" "raku -c" ".*\.\(raku\|rakumod\|rakutest\|pm6\|pl6\|p6\)\$" "raku" + TestCodebase "RUBY" "rubocop" "rubocop -c $RUBY_LINTER_RULES" ".*\.\(rb\)\$" "ruby" + TestCodebase "TERRAFORM" "tflint" "tflint -c $TERRAFORM_LINTER_RULES" ".*\.\(tf\)\$" "terraform" TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(ts\)\$" "typescript" TestCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin $TYPESCRIPT_STANDARD_LINTER_RULES" ".*\.\(ts\)\$" "typescript" - TestCodebase "DOCKER" "dockerfilelint" "dockerfilelint -c $DOCKER_LINTER_RULES" ".*\(Dockerfile\)\$" "docker" - TestCodebase "ANSIBLE" "ansible-lint" "ansible-lint -v -c $ANSIBLE_LINTER_RULES" ".*\.\(yml\|yaml\)\$" "ansible" - TestCodebase "TERRAFORM" "tflint" "tflint -c $TERRAFORM_LINTER_RULES" ".*\.\(tf\)\$" "terraform" - TestCodebase "CFN" "cfn-lint" "cfn-lint --config-file $CFN_LINTER_RULES" ".*\.\(json\|yml\|yaml\)\$" "cfn" - TestCodebase "POWERSHELL" "pwsh" "Invoke-ScriptAnalyzer -EnableExit -Settings $POWERSHELL_LINTER_RULES -Path" ".*\.\(ps1\|psm1\|psd1\|ps1xml\|pssc\|psrc\|cdxml\)\$" "powershell" - TestCodebase "ARM" "arm-ttk" "Import-Module $ARM_TTK_PSD1 ; \$config = \$(Import-PowerShellDataFile -Path $ARM_LINTER_RULES) ; Test-AzTemplate @config -TemplatePath" ".*\.\(json\)\$" "arm" - TestCodebase "CSS" "stylelint" "stylelint --config $CSS_LINTER_RULES" ".*\.\(css\)\$" "css" - TestCodebase "ENV" "dotenv-linter" "dotenv-linter" ".*\.\(env\)\$" "env" - TestCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES --lint" ".*\.\(clj\|cljs\|cljc\|edn\)\$" "clojure" - TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin" - TestCodebase "PROTOBUF" "protolint" "protolint lint --config_path $PROTOBUF_LINTER_RULES" ".*\.\(proto\)\$" "protobuf" - TestCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" ".*\.\(ymlopenapi\|jsonopenapi\)\$" "openapi" - TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart" - TestCodebase "HTML" "htmlhint" "htmlhint --config $HTML_LINTER_RULES" ".*\.\(html\)\$" "html" + TestCodebase "XML" "xmllint" "xmllint" ".*\.\(xml\)\$" "xml" + TestCodebase "YML" "yamllint" "yamllint -c $YAML_LINTER_RULES" ".*\.\(yml\|yaml\)\$" "yml" ################# # Footer prints # From c7887882ae07c779c2f565a86e05acc6fc3af23e Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Sun, 19 Jul 2020 20:54:41 +0100 Subject: [PATCH 48/96] ARM linting uses the execution time --- .../arm/reports/{expected-ARM.tap => expected-ARM.tap.ignored} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .automation/test/arm/reports/{expected-ARM.tap => expected-ARM.tap.ignored} (100%) diff --git a/.automation/test/arm/reports/expected-ARM.tap b/.automation/test/arm/reports/expected-ARM.tap.ignored similarity index 100% rename from .automation/test/arm/reports/expected-ARM.tap rename to .automation/test/arm/reports/expected-ARM.tap.ignored From 866d22d78700511d9e5103c4c297c8de9ea77841 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Sun, 19 Jul 2020 20:50:40 +0100 Subject: [PATCH 49/96] Add extension for the editor-config test files --- lib/worker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/worker.sh b/lib/worker.sh index c45d6465..ce98fc35 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -507,7 +507,7 @@ function RunTestCases() { TestCodebase "CSS" "stylelint" "stylelint --config $CSS_LINTER_RULES" ".*\.\(css\)\$" "css" TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart" TestCodebase "DOCKER" "dockerfilelint" "dockerfilelint -c $DOCKER_LINTER_RULES" ".*\(Dockerfile\)\$" "docker" - TestCodebase "EDITORCONFIG" "editorconfig-checker" "editorconfig-checker" "^.*$" "editorconfig-checker" + TestCodebase "EDITORCONFIG" "editorconfig-checker" "editorconfig-checker" ".*\.ext$" "editorconfig-checker" TestCodebase "ENV" "dotenv-linter" "dotenv-linter" ".*\.\(env\)\$" "env" TestCodebase "GO" "golangci-lint" "golangci-lint run -c $GO_LINTER_RULES" ".*\.\(go\)\$" "golang" TestCodebase "HTML" "htmlhint" "htmlhint --config $HTML_LINTER_RULES" ".*\.\(html\)\$" "html" From 3ecfdee03520897df6f7bbc3a2ca9c78350f33dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2020 06:02:01 +0000 Subject: [PATCH 50/96] Bump rubocop-performance from 1.7.0 to 1.7.1 in /dependencies Bumps [rubocop-performance](https://github.com/rubocop-hq/rubocop-performance) from 1.7.0 to 1.7.1. - [Release notes](https://github.com/rubocop-hq/rubocop-performance/releases) - [Changelog](https://github.com/rubocop-hq/rubocop-performance/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop-hq/rubocop-performance/compare/v1.7.0...v1.7.1) Signed-off-by: dependabot[bot] --- dependencies/Gemfile | 2 +- dependencies/Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies/Gemfile b/dependencies/Gemfile index bde8ce96..ab2a0684 100644 --- a/dependencies/Gemfile +++ b/dependencies/Gemfile @@ -6,5 +6,5 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } gem "rubocop", "~> 0.82.0" gem "rubocop-github", "~> 0.16.0" -gem "rubocop-performance", "~>1.7.0" +gem "rubocop-performance", "~>1.7.1" gem "rubocop-rails", "~> 2.5" diff --git a/dependencies/Gemfile.lock b/dependencies/Gemfile.lock index cb5ca1b1..12f9f0d7 100644 --- a/dependencies/Gemfile.lock +++ b/dependencies/Gemfile.lock @@ -31,7 +31,7 @@ GEM rubocop (<= 0.82.0) rubocop-performance (~> 1.0) rubocop-rails (~> 2.0) - rubocop-performance (1.7.0) + rubocop-performance (1.7.1) rubocop (>= 0.82.0) rubocop-rails (2.6.0) activesupport (>= 4.2.0) @@ -50,7 +50,7 @@ PLATFORMS DEPENDENCIES rubocop (~> 0.82.0) rubocop-github (~> 0.16.0) - rubocop-performance (~> 1.7.0) + rubocop-performance (~> 1.7.1) rubocop-rails (~> 2.5) BUNDLED WITH From dc582f17d250aad42245327ed7e524d434a8b49c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2020 06:06:42 +0000 Subject: [PATCH 51/96] Bump eslint from 7.4.0 to 7.5.0 in /dependencies Bumps [eslint](https://github.com/eslint/eslint) from 7.4.0 to 7.5.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.4.0...v7.5.0) Signed-off-by: dependabot[bot] --- dependencies/package-lock.json | 29 +++++++++++++++++------------ dependencies/package.json | 2 +- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index 7ca7fe83..74f6fe6a 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -1629,9 +1629,9 @@ } }, "eslint": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.4.0.tgz", - "integrity": "sha512-gU+lxhlPHu45H3JkEGgYhWhkR9wLHHEXC9FbWFnTlEkbKyZKWgWRLgf61E8zWmBuI6g5xKBph9ltg3NtZMVF8g==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.5.0.tgz", + "integrity": "sha512-vlUP10xse9sWt9SGRtcr1LAC67BENcQMFeV+w5EvLEoFe3xJ8cF1Skd0msziRx/VMC+72B4DxreCE+OR12OA6Q==", "requires": { "@babel/code-frame": "^7.0.0", "ajv": "^6.10.0", @@ -1641,9 +1641,9 @@ "doctrine": "^3.0.0", "enquirer": "^2.3.5", "eslint-scope": "^5.1.0", - "eslint-utils": "^2.0.0", - "eslint-visitor-keys": "^1.2.0", - "espree": "^7.1.0", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^1.3.0", + "espree": "^7.2.0", "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", @@ -1657,7 +1657,7 @@ "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.14", + "lodash": "^4.17.19", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", @@ -1698,6 +1698,11 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" + }, "supports-color": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", @@ -1957,13 +1962,13 @@ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" }, "espree": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.1.0.tgz", - "integrity": "sha512-dcorZSyfmm4WTuTnE5Y7MEN1DyoPYy1ZR783QW1FJoenn7RailyWFsq/UL6ZAAA7uXurN9FIpYyUs3OfiIW+Qw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", + "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", "requires": { - "acorn": "^7.2.0", + "acorn": "^7.3.1", "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.2.0" + "eslint-visitor-keys": "^1.3.0" } }, "esprima": { diff --git a/dependencies/package.json b/dependencies/package.json index 763c0f56..eff0a75c 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -7,7 +7,7 @@ "@typescript-eslint/parser": "^3.6.1", "babel-eslint": "^10.1.0", "dockerfilelint": "^1.5.0", - "eslint": "^7.4.0", + "eslint": "^7.5.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-jest": "^23.18.0", "htmlhint": "^0.14.1", From 3327bab09fd8ed24c414bd93e444fe50ffef9b52 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 20 Jul 2020 08:14:40 -0500 Subject: [PATCH 52/96] Adding some additional details --- lib/worker.sh | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/lib/worker.sh b/lib/worker.sh index 721d7022..3c1c82c3 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -813,23 +813,61 @@ function TransformTAPDetails() { ################################################################################ #### Function HeaderTap ######################################################## function HeaderTap() { - printf "TAP version 13\n1..%s\n" "${1}" > "${2}" + ################ + # Pull in Vars # + ################ + INDEX="$1" # File being validated + OUTPUT_FILE="$2" # Output location + + ################### + # Print the goods # + ################### + printf "TAP version 13\n1..%s\n" "${INDEX}" > "${OUTPUT_FILE}" } ################################################################################ #### Function OkTap ############################################################ function OkTap() { - echo "ok ${1} - ${2}" >> "${3}" + ################ + # Pull in Vars # + ################ + INDEX="$1" # Location + FILE="$2" # File being validated + TEMP_FILE="$3" # Temp file location + + ################### + # Print the goods # + ################### + echo "ok ${INDEX} - ${FILE}" >> "${TEMP_FILE}" } ################################################################################ #### Function NotOkTap ######################################################### function NotOkTap() { - echo "not ok ${1} - ${2}" >> "${3}" + ################ + # Pull in Vars # + ################ + INDEX="$1" # Location + FILE="$2" # File being validated + TEMP_FILE="$3" # Temp file location + + ################### + # Print the goods # + ################### + echo "not ok ${INDEX} - ${FILE}" >> "${TEMP_FILE}" } ################################################################################ #### Function AddDetailedMessageIfEnabled ###################################### function AddDetailedMessageIfEnabled() { - DETAILED_MSG=$(TransformTAPDetails "${1}") + ################ + # Pull in Vars # + ################ + LINT_CMD="$1" # Linter command + TEMP_FILE="$2" # Temp file + + #################### + # Check the return # + #################### + DETAILED_MSG=$(TransformTAPDetails "${LINT_CMD}") if [ -n "${DETAILED_MSG}" ] ; then - printf " ---\n message: %s\n ...\n" "$DETAILED_MSG" >> "${2}" + printf " ---\n message: %s\n ...\n" "$DETAILED_MSG" >> "${TEMP_FILE}" fi } From 3d8c51f768f412592f37c74dcecbf3b2f15e0713 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:07:56 -0500 Subject: [PATCH 53/96] adding the code --- README.md | 5 +- lib/linter.sh | 270 ++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 198 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index 14396934..9ad35000 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ To use this **GitHub** Action you will need to complete the following: 5. Enjoy your more *stable*, and *cleaner* code base 6. Check out the [Wiki](https://github.com/github/super-linter/wiki) for customization options +**NOTE:** You will need the *Environment* variable `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` set in your workflow file to be able to use the multiple status API returns. There is no need to set the **GitHub** Secret, it only needs to be passed. + ### Example connecting GitHub Action Workflow In your repository you should have a `.github/workflows` folder with **GitHub** Action similar to below: @@ -132,6 +134,7 @@ jobs: env: VALIDATE_ALL_CODEBASE: false DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ... ``` @@ -197,7 +200,7 @@ and won't run anything unexpected. | **OUTPUT_FORMAT** | `none` | The report format to be generated, besides the stdout one. Output format of tap is currently using v13 of the specification. Supported formats: tap | | **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. Output folder must not previously exist. | | **OUTPUT_DETAILS** | `simpler` | What level of details to be reported. Supported formats: simpler or detailed. | - +| **MULTI_STATUS** | `true` | A status API is made for each language that is linted to make visual parsing easier. | ### Template rules files You can use the **GitHub** **Super-Linter** *with* or *without* your own personal rules sets. This allows for greater flexibility for each individual code base. The Template rules all try to follow the standards we believe should be enabled at the basic level. diff --git a/lib/linter.sh b/lib/linter.sh index b57fc05f..77a996f1 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -111,43 +111,47 @@ LANGUAGE_ARRAY=('YML' 'JSON' 'XML' 'MARKDOWN' 'BASH' 'PERL' 'RAKU' 'PHP' 'RUBY' GITHUB_SHA="${GITHUB_SHA}" # GitHub sha from the commit GITHUB_EVENT_PATH="${GITHUB_EVENT_PATH}" # Github Event Path GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # Github Workspace +GITHUB_TOKEN="${GITHUB_TOKEN}" # GitHub Token passed from environment +GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system +GITHUB_RUN_ID="${GITHUB_RUN_ID}" # GitHub RUn ID to point to logs DEFAULT_BRANCH="${DEFAULT_BRANCH:-master}" # Default Git Branch to use (master by default) +MULTI_STATUS="${MULTI_STATUS:-true}" # Multiple status are created for each check ran ANSIBLE_DIRECTORY="${ANSIBLE_DIRECTORY}" # Ansible Directory VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files -VALIDATE_YAML="${VALIDATE_YAML}" # Boolean to validate language -VALIDATE_JSON="${VALIDATE_JSON}" # Boolean to validate language -VALIDATE_XML="${VALIDATE_XML}" # Boolean to validate language -VALIDATE_MD="${VALIDATE_MD}" # Boolean to validate language -VALIDATE_BASH="${VALIDATE_BASH}" # Boolean to validate language -VALIDATE_PERL="${VALIDATE_PERL}" # Boolean to validate language -VALIDATE_RAKU="${VALIDATE_RAKU}" # Boolean to validate language -VALIDATE_PHP="${VALIDATE_PHP}" # Boolean to validate language -VALIDATE_PYTHON="${VALIDATE_PYTHON}" # Boolean to validate language -VALIDATE_CLOUDFORMATION="${VALIDATE_CLOUDFORMATION}" # Boolean to validate language -VALIDATE_RUBY="${VALIDATE_RUBY}" # Boolean to validate language -VALIDATE_COFFEE="${VALIDATE_COFFEE}" # Boolean to validate language VALIDATE_ANSIBLE="${VALIDATE_ANSIBLE}" # Boolean to validate language +VALIDATE_ARM="${VALIDATE_ARM}" # Boolean to validate language +VALIDATE_BASH="${VALIDATE_BASH}" # Boolean to validate language +VALIDATE_CLOUDFORMATION="${VALIDATE_CLOUDFORMATION}" # Boolean to validate language +VALIDATE_CLOJURE="${VALIDATE_CLOJURE}" # Boolean to validate language +VALIDATE_COFFEE="${VALIDATE_COFFEE}" # Boolean to validate language +VALIDATE_CSS="${VALIDATE_CSS}" # Boolean to validate language +VALIDATE_DART="${VALIDATE_DART}" # Boolean to validate language +VALIDATE_DOCKER="${VALIDATE_DOCKER}" # Boolean to validate language +VALIDATE_EDITORCONFIG="${VALIDATE_EDITORCONFIG}" # Boolean to validate files with editorconfig +VALIDATE_ENV="${VALIDATE_ENV}" # Boolean to validate language +VALIDATE_GO="${VALIDATE_GO}" # Boolean to validate language +VALIDATE_HTML="${VALIDATE_HTML}" # Boolean to validate language VALIDATE_JAVASCRIPT_ES="${VALIDATE_JAVASCRIPT_ES}" # Boolean to validate language VALIDATE_JAVASCRIPT_STANDARD="${VALIDATE_JAVASCRIPT_STANDARD}" # Boolean to validate language -VALIDATE_JSX="${VALIDATE_JSX}" # Boolean to validate jsx files -VALIDATE_TSX="${VALIDATE_TSX}" # Boolean to validate tsx files +VALIDATE_JSON="${VALIDATE_JSON}" # Boolean to validate language +VALIDATE_JSX="${VALIDATE_JSX}" # Boolean to validate language +VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language +VALIDATE_MD="${VALIDATE_MD}" # Boolean to validate language +VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language +VALIDATE_PERL="${VALIDATE_PERL}" # Boolean to validate language +VALIDATE_PHP="${VALIDATE_PHP}" # Boolean to validate language +VALIDATE_POWERSHELL="${VALIDATE_POWERSHELL}" # Boolean to validate language +VALIDATE_PYTHON="${VALIDATE_PYTHON}" # Boolean to validate language +VALIDATE_RAKU="${VALIDATE_RAKU}" # Boolean to validate language +VALIDATE_RUBY="${VALIDATE_RUBY}" # Boolean to validate language +VALIDATE_TERRAFORM="${VALIDATE_TERRAFORM}" # Boolean to validate language +VALIDATE_TSX="${VALIDATE_TSX}" # Boolean to validate language VALIDATE_TYPESCRIPT_ES="${VALIDATE_TYPESCRIPT_ES}" # Boolean to validate language VALIDATE_TYPESCRIPT_STANDARD="${VALIDATE_TYPESCRIPT_STANDARD}" # Boolean to validate language -VALIDATE_DOCKER="${VALIDATE_DOCKER}" # Boolean to validate language -VALIDATE_GO="${VALIDATE_GO}" # Boolean to validate language -VALIDATE_CSS="${VALIDATE_CSS}" # Boolean to validate language -VALIDATE_ENV="${VALIDATE_ENV}" # Boolean to validate language -VALIDATE_CLOJURE="${VALIDATE_CLOJURE}" # Boolean to validate language -VALIDATE_TERRAFORM="${VALIDATE_TERRAFORM}" # Boolean to validate language -VALIDATE_POWERSHELL="${VALIDATE_POWERSHELL}" # Boolean to validate language -VALIDATE_ARM="${VALIDATE_ARM}" # Boolean to validate language -VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language -VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language -VALIDATE_DART="${VALIDATE_DART}" # Boolean to validate language -VALIDATE_EDITORCONFIG="${VALIDATE_EDITORCONFIG}" # Boolean to validate files with editorconfig +VALIDATE_XML="${VALIDATE_XML}" # Boolean to validate language +VALIDATE_YAML="${VALIDATE_YAML}" # 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 -VALIDATE_HTML="${VALIDATE_HTML}" # Boolean to validate language ############## # Debug Vars # @@ -191,73 +195,73 @@ REPORT_OUTPUT_FOLDER="${DEFAULT_WORKSPACE}/${OUTPUT_FOLDER}" ########################## # Array of changed files # ########################## -FILE_ARRAY_YML=() # Array of files to check -FILE_ARRAY_JSON=() # Array of files to check -FILE_ARRAY_XML=() # Array of files to check -FILE_ARRAY_MD=() # Array of files to check +FILE_ARRAY_ARM=() # Array of files to check FILE_ARRAY_BASH=() # Array of files to check -FILE_ARRAY_PERL=() # Array of files to check -FILE_ARRAY_RAKU=() # Array of files to check -FILE_ARRAY_PHP=() # Array of files to check -FILE_ARRAY_RUBY=() # Array of files to check -FILE_ARRAY_PYTHON=() # Array of files to check FILE_ARRAY_CFN=() # Array of files to check +FILE_ARRAY_CLOJURE=() # Array of files to check FILE_ARRAY_COFFEESCRIPT=() # Array of files to check +FILE_ARRAY_CSS=() # Array of files to check +FILE_ARRAY_DART=() # Array of files to check +FILE_ARRAY_DOCKER=() # Array of files to check +FILE_ARRAY_ENV=() # Array of files to check +FILE_ARRAY_GO=() # Array of files to check +FILE_ARRAY_HTML=() # Array of files to check FILE_ARRAY_JAVASCRIPT_ES=() # Array of files to check FILE_ARRAY_JAVASCRIPT_STANDARD=() # Array of files to check +FILE_ARRAY_JSON=() # Array of files to check FILE_ARRAY_JSX=() # Array of files to check +FILE_ARRAY_KOTLIN=() # Array of files to check +FILE_ARRAY_MD=() # Array of files to check +FILE_ARRAY_OPENAPI=() # Array of files to check +FILE_ARRAY_PERL=() # Array of files to check +FILE_ARRAY_PHP=() # Array of files to check +FILE_ARRAY_POWERSHELL=() # Array of files to check +FILE_ARRAY_PROTOBUF=() # Array of files to check +FILE_ARRAY_PYTHON=() # Array of files to check +FILE_ARRAY_RAKU=() # Array of files to check +FILE_ARRAY_RUBY=() # Array of files to check +FILE_ARRAY_TERRAFORM=() # Array of files to check FILE_ARRAY_TSX=() # Array of files to check FILE_ARRAY_TYPESCRIPT_ES=() # Array of files to check FILE_ARRAY_TYPESCRIPT_STANDARD=() # Array of files to check -FILE_ARRAY_DOCKER=() # Array of files to check -FILE_ARRAY_GO=() # Array of files to check -FILE_ARRAY_TERRAFORM=() # Array of files to check -FILE_ARRAY_POWERSHELL=() # Array of files to check -FILE_ARRAY_ARM=() # Array of files to check -FILE_ARRAY_CSS=() # Array of files to check -FILE_ARRAY_ENV=() # Array of files to check -FILE_ARRAY_CLOJURE=() # Array of files to check -FILE_ARRAY_KOTLIN=() # Array of files to check -FILE_ARRAY_PROTOBUF=() # Array of files to check -FILE_ARRAY_OPENAPI=() # Array of files to check -FILE_ARRAY_DART=() # Array of files to check -FILE_ARRAY_HTML=() # Array of files to check +FILE_ARRAY_XML=() # Array of files to check +FILE_ARRAY_YML=() # Array of files to check ############ # Counters # ############ -ERRORS_FOUND_YML=0 # Count of errors found -ERRORS_FOUND_JSON=0 # Count of errors found -ERRORS_FOUND_XML=0 # Count of errors found -ERRORS_FOUND_MARKDOWN=0 # Count of errors found -ERRORS_FOUND_BASH=0 # Count of errors found -ERRORS_FOUND_PERL=0 # Count of errors found -ERRORS_FOUND_RAKU=0 # Count of errors found -ERRORS_FOUND_PHP=0 # Count of errors found -ERRORS_FOUND_RUBY=0 # Count of errors found -ERRORS_FOUND_PYTHON=0 # Count of errors found -ERRORS_FOUND_CFN=0 # Count of errors found -ERRORS_FOUND_COFFEESCRIPT=0 # Count of errors found ERRORS_FOUND_ANSIBLE=0 # Count of errors found +ERRORS_FOUND_ARM=0 # Count of errors found +ERRORS_FOUND_BASH=0 # Count of errors found +ERRORS_FOUND_CFN=0 # Count of errors found +ERRORS_FOUND_CLOJURE=0 # Count of errors found +ERRORS_FOUND_CSS=0 # Count of errors found +ERRORS_FOUND_COFFEESCRIPT=0 # Count of errors found +ERRORS_FOUND_DART=0 # Count of errors found +ERRORS_FOUND_DOCKER=0 # Count of errors found +ERRORS_FOUND_ENV=0 # Count of errors found +ERRORS_FOUND_GO=0 # Count of errors found +ERRORS_FOUND_HTML=0 # Count of errors found ERRORS_FOUND_JAVASCRIPT_STANDARD=0 # Count of errors found ERRORS_FOUND_JAVASCRIPT_ES=0 # Count of errors found +ERRORS_FOUND_JSON=0 # Count of errors found ERRORS_FOUND_JSX=0 # Count of errors found +ERRORS_FOUND_KOTLIN=0 # Count of errors found +ERRORS_FOUND_MARKDOWN=0 # Count of errors found +ERRORS_FOUND_OPENAPI=0 # Count of errors found +ERRORS_FOUND_PERL=0 # Count of errors found +ERRORS_FOUND_PHP=0 # Count of errors found +ERRORS_FOUND_POWERSHELL=0 # Count of errors found +ERRORS_FOUND_PROTOBUF=0 # Count of errors found +ERRORS_FOUND_PYTHON=0 # Count of errors found +ERRORS_FOUND_RAKU=0 # Count of errors found +ERRORS_FOUND_RUBY=0 # Count of errors found +ERRORS_FOUND_TERRAFORM=0 # Count of errors found ERRORS_FOUND_TSX=0 # Count of errors found ERRORS_FOUND_TYPESCRIPT_STANDARD=0 # Count of errors found ERRORS_FOUND_TYPESCRIPT_ES=0 # Count of errors found -ERRORS_FOUND_DOCKER=0 # Count of errors found -ERRORS_FOUND_GO=0 # Count of errors found -ERRORS_FOUND_TERRAFORM=0 # Count of errors found -ERRORS_FOUND_POWERSHELL=0 # Count of errors found -ERRORS_FOUND_ARM=0 # Count of errors found -ERRORS_FOUND_CSS=0 # Count of errors found -ERRORS_FOUND_ENV=0 # Count of errors found -ERRORS_FOUND_CLOJURE=0 # Count of errors found -ERRORS_FOUND_KOTLIN=0 # Count of errors found -ERRORS_FOUND_PROTOBUF=0 # Count of errors found -ERRORS_FOUND_OPENAPI=0 # Count of errors found -ERRORS_FOUND_DART=0 # Count of errors found -ERRORS_FOUND_HTML=0 # Count of errors found +ERRORS_FOUND_XML=0 # Count of errors found +ERRORS_FOUND_YML=0 # Count of errors found ################################################################################ ########################## FUNCTIONS BELOW ##################################### @@ -708,6 +712,49 @@ GetGitHubVars() { echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_REPO]${F[B]}, value:${F[W]}[$GITHUB_REPO]${NC}" fi fi + + ############################ + # Validate we have a value # + ############################ + if [ -z "$GITHUB_TOKEN" ]; then + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_TOKEN]!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_TOKEN]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!${NC}" + else + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_TOKEN]${NC}" + fi + + ############################### + # Convert string to lowercase # + ############################### + MULTI_STATUS=$(echo "$MULTI_STATUS" | awk '{print tolower($0)}') + + ####################################################################### + # Check to see if the multi status is set, and we have a token to use # + ####################################################################### + if [ "$MULTI_STATUS" == "true" ] && [ -n "$GITHUB_TOKEN" ]; then + ############################ + # Validate we have a value # + ############################ + if [ -z "$GITHUB_REPOSITORY" ]; then + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_REPOSITORY]!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_REPOSITORY]${NC}" + exit 1 + else + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_REPOSITORY]${F[B]}, value:${F[W]}[$GITHUB_REPOSITORY]${NC}" + fi + + ############################ + # Validate we have a value # + ############################ + if [ -z "$GITHUB_RUN_ID" ]; then + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_RUN_ID]!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_RUN_ID]${NC}" + exit 1 + else + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_RUN_ID]${F[B]}, value:${F[W]}[$GITHUB_RUN_ID]${NC}" + fi + fi } ################################################################################ #### Function ValidatePowershellModules ######################################## @@ -751,6 +798,57 @@ function ValidatePowershellModules() { fi } ################################################################################ +#### Function CallStatusAPI #################################################### +CallStatusAPI() { + #################### + # Pull in the vars # + #################### + LANGUAGE="$1" # langauge that was validated + STATUS="$2" # success | error + SUCCESS_MSG='No errors were found in the linting process' + FAIL_MSG='Errors were detected, please view logs' + MESSAGE='' # Message to send to status API + + ###################################### + # Check the status to create message # + ###################################### + if [ "$STATUS" == "success" ]; then + # Success + MESSAGE="$SUCCESS_MSG" + else + # Failure + MESSAGE="$FAIL_MSG" + fi + + ############################################## + # Call the status API to create status check # + ############################################## + SEND_STATUS_CMD=$(curl -X -s -f POST \ + --url "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + -H 'accept: application/vnd.github.v3+json' \ + -H "authorization: Bearer $GITHUB_TOKEN" \ + -H 'content-type: application/json' \ + -d "{ \"state\": \"$STATUS\", + \"target_url\": \"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\", + \"description\": \"$MESSAGE\", \"context\": \" --> Lint-Language/$LANGUAGE\" + }" 2>&1) + + ####################### + # Load the error code # + ####################### + ERROR_CODE=$? + + ############################## + # Check the shell for errors # + ############################## + if [ "$ERROR_CODE" -ne 0 ]; then + # ERROR + echo "ERROR! Failed to call GitHub Status API!" + echo "ERROR:[$SEND_STATUS_CMD]" + # Not going to fail the script on this yet... + fi +} +################################################################################ #### Function Footer ########################################################### Footer() { echo "" @@ -781,9 +879,23 @@ Footer() { # Print if not 0 # ################## if [ "${!ERROR_COUNTER}" -ne 0 ]; then - # Print the goods + # We found errors + + ################### + # Print the goods # + ################### echo -e "${NC}${B[R]}${F[W]}ERRORS FOUND${NC} in $LANGUAGE:[${!ERROR_COUNTER}]${NC}" - fi + + ######################################### + # Create status API for Failed language # + ######################################### + CallStatusAPI "$LANGUAGE" "error" + else + # No errors found + ######################################### + # Create status API for Failed language # + ######################################### + CallStatusAPI "$LANGUAGE" "success" done ################################ @@ -934,6 +1046,12 @@ fi # Check to see if this is a test case run # ########################################### if [[ $TEST_CASE_RUN != "false" ]]; then + + ############################################# + # Set the multi status to off for test runs # + ############################################# + MULTI_STATUS='false' + ########################### # Run only the test cases # ########################### From 2b478cc1cd214158f8eea303e4ef7b1f7e381c8d Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:13:26 -0500 Subject: [PATCH 54/96] close the loop --- lib/linter.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/linter.sh b/lib/linter.sh index 77a996f1..e6a180e4 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -896,6 +896,7 @@ Footer() { # Create status API for Failed language # ######################################### CallStatusAPI "$LANGUAGE" "success" + fi done ################################ From 4b6d5433f199d0d645b295852b700697b812be22 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:29:03 -0500 Subject: [PATCH 55/96] more clean --- lib/linter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index e6a180e4..a4371723 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -823,8 +823,8 @@ CallStatusAPI() { ############################################## # Call the status API to create status check # ############################################## - SEND_STATUS_CMD=$(curl -X -s -f POST \ - --url "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + SEND_STATUS_CMD=$(curl -f -s -X POST \ + --url "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ -H 'accept: application/vnd.github.v3+json' \ -H "authorization: Bearer $GITHUB_TOKEN" \ -H 'content-type: application/json' \ From 7e89fa681c9acdb5aee99f460d5033b696c5d01a Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:52:56 -0500 Subject: [PATCH 56/96] fixed langauge logic --- lib/linter.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index a4371723..41abb56f 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -830,7 +830,7 @@ CallStatusAPI() { -H 'content-type: application/json' \ -d "{ \"state\": \"$STATUS\", \"target_url\": \"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\", - \"description\": \"$MESSAGE\", \"context\": \" --> Lint-Language/$LANGUAGE\" + \"description\": \"$MESSAGE\", \"context\": \"--> Linted: $LANGUAGE\" }" 2>&1) ####################### @@ -892,10 +892,18 @@ Footer() { CallStatusAPI "$LANGUAGE" "error" else # No errors found - ######################################### - # Create status API for Failed language # - ######################################### - CallStatusAPI "$LANGUAGE" "success" + + ############################################### + # Create Validate language var from Var input # + ############################################### + VALIDATE_LANGUAGE="VALIDATE_${LANGUAGE}" + + ###################################### + # Check if we validated the langauge # + ###################################### + if [ "${!VALIDATE_LANGUAGE}" == "true" ]; then + CallStatusAPI "$LANGUAGE" "success" + fi fi done From e2ed325d4eb2c32a66c69b7989ce287771f77960 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 20 Jul 2020 15:09:34 -0500 Subject: [PATCH 57/96] found a bug --- lib/linter.sh | 4 ++-- lib/validation.sh | 50 +++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 41abb56f..eb0587da 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -896,12 +896,12 @@ Footer() { ############################################### # Create Validate language var from Var input # ############################################### - VALIDATE_LANGUAGE="VALIDATE_${LANGUAGE}" + VALIDATE_LANGUAGE_ARRAY="FILE_ARRAY_${LANGUAGE}" ###################################### # Check if we validated the langauge # ###################################### - if [ "${!VALIDATE_LANGUAGE}" == "true" ]; then + if [ "${!VALIDATE_LANGUAGE_ARRAY}" -gt 0 ]; then CallStatusAPI "$LANGUAGE" "success" fi fi diff --git a/lib/validation.sh b/lib/validation.sh index cc25f430..3750d28f 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -46,38 +46,38 @@ function GetValidationInfo() { ################################ # Convert strings to lowercase # ################################ - VALIDATE_YAML=$(echo "$VALIDATE_YAML" | awk '{print tolower($0)}') - VALIDATE_JSON=$(echo "$VALIDATE_JSON" | awk '{print tolower($0)}') - VALIDATE_XML=$(echo "$VALIDATE_XML" | awk '{print tolower($0)}') - VALIDATE_MD=$(echo "$VALIDATE_MD" | awk '{print tolower($0)}') - VALIDATE_BASH=$(echo "$VALIDATE_BASH" | awk '{print tolower($0)}') - VALIDATE_PERL=$(echo "$VALIDATE_PERL" | awk '{print tolower($0)}') - VALIDATE_RAKU=$(echo "$VALIDATE_RAKU" | awk '{print tolower($0)}') - VALIDATE_PHP=$(echo "$VALIDATE_PHP" | awk '{print tolower($0)}') - VALIDATE_PYTHON=$(echo "$VALIDATE_PYTHON" | awk '{print tolower($0)}') - VALIDATE_RUBY=$(echo "$VALIDATE_RUBY" | awk '{print tolower($0)}') - VALIDATE_COFFEE=$(echo "$VALIDATE_COFFEE" | awk '{print tolower($0)}') VALIDATE_ANSIBLE=$(echo "$VALIDATE_ANSIBLE" | awk '{print tolower($0)}') + VALIDATE_ARM=$(echo "$VALIDATE_ARM" | awk '{print tolower($0)}') + VALIDATE_BASH=$(echo "$VALIDATE_BASH" | awk '{print tolower($0)}') + VALIDATE_CLOJURE=$(echo "$VALIDATE_CLOJURE" | awk '{print tolower($0)}') + VALIDATE_COFFEE=$(echo "$VALIDATE_COFFEE" | awk '{print tolower($0)}') + VALIDATE_CSS=$(echo "$VALIDATE_CSS" | awk '{print tolower($0)}') + VALIDATE_DART=$(echo "$VALIDATE_DART" | awk '{print tolower($0)}') + VALIDATE_DOCKER=$(echo "$VALIDATE_DOCKER" | awk '{print tolower($0)}') + VALIDATE_EDITORCONFIG=$(echo "$VALIDATE_EDITORCONFIG" | awk '{print tolower($0)}') + VALIDATE_ENV=$(echo "$VALIDATE_ENV" | awk '{print tolower($0)}') + VALIDATE_GO=$(echo "$VALIDATE_GO" | awk '{print tolower($0)}') + VALIDATE_HTML=$(echo "$VALIDATE_HTML" | awk '{print tolower($0)}') VALIDATE_JAVASCRIPT_ES=$(echo "$VALIDATE_JAVASCRIPT_ES" | awk '{print tolower($0)}') VALIDATE_JAVASCRIPT_STANDARD=$(echo "$VALIDATE_JAVASCRIPT_STANDARD" | awk '{print tolower($0)}') + VALIDATE_JSON=$(echo "$VALIDATE_JSON" | awk '{print tolower($0)}') VALIDATE_JSX=$(echo "$VALIDATE_JSX" | awk '{print tolower($0)}') + VALIDATE_KOTLIN=$(echo "$VALIDATE_KOTLIN" | awk '{print tolower($0)}') + VALIDATE_MD=$(echo "$VALIDATE_MD" | awk '{print tolower($0)}') + VALIDATE_OPENAPI=$(echo "$VALIDATE_OPENAPI" | awk '{print tolower($0)}') + VALIDATE_PERL=$(echo "$VALIDATE_PERL" | awk '{print tolower($0)}') + VALIDATE_PHP=$(echo "$VALIDATE_PHP" | awk '{print tolower($0)}') + VALIDATE_POWERSHELL=$(echo "$VALIDATE_POWERSHELL" | awk '{print tolower($0)}') + VALIDATE_PROTOBUF=$(echo "$VALIDATE_PROTOBUF" | awk '{print tolower($0)}') + VALIDATE_PYTHON=$(echo "$VALIDATE_PYTHON" | awk '{print tolower($0)}') + VALIDATE_RAKU=$(echo "$VALIDATE_RAKU" | awk '{print tolower($0)}') + VALIDATE_RUBY=$(echo "$VALIDATE_RUBY" | awk '{print tolower($0)}') + VALIDATE_TERRAFORM=$(echo "$VALIDATE_TERRAFORM" | awk '{print tolower($0)}') VALIDATE_TSX=$(echo "$VALIDATE_TSX" | awk '{print tolower($0)}') VALIDATE_TYPESCRIPT_ES=$(echo "$VALIDATE_TYPESCRIPT_ES" | awk '{print tolower($0)}') VALIDATE_TYPESCRIPT_STANDARD=$(echo "$VALIDATE_TYPESCRIPT_STANDARD" | awk '{print tolower($0)}') - VALIDATE_DOCKER=$(echo "$VALIDATE_DOCKER" | awk '{print tolower($0)}') - VALIDATE_GO=$(echo "$VALIDATE_GO" | awk '{print tolower($0)}') - VALIDATE_TERRAFORM=$(echo "$VALIDATE_TERRAFORM" | awk '{print tolower($0)}') - VALIDATE_POWERSHELL=$(echo "$VALIDATE_POWERSHELL" | awk '{print tolower($0)}') - VALIDATE_ARM=$(echo "$VALIDATE_ARM" | awk '{print tolower($0)}') - VALIDATE_CSS=$(echo "$VALIDATE_CSS" | awk '{print tolower($0)}') - VALIDATE_ENV=$(echo "$VALIDATE_ENV" | awk '{print tolower($0)}') - VALIDATE_CLOJURE=$(echo "$VALIDATE_CLOJURE" | awk '{print tolower($0)}') - VALIDATE_KOTLIN=$(echo "$VALIDATE_KOTLIN" | awk '{print tolower($0)}') - VALIDATE_PROTOBUF=$(echo "$VALIDATE_PROTOBUF" | awk '{print tolower($0)}') - VALIDATE_OPENAPI=$(echo "$VALIDATE_OPENAPI" | awk '{print tolower($0)}') - VALIDATE_EDITORCONFIG=$(echo "$VALIDATE_EDITORCONFIG" | awk '{print tolower($0)}') - VALIDATE_DART=$(echo "$VALIDATE_DART" | awk '{print tolower($0)}') - VALIDATE_HTML=$(echo "$VALIDATE_HTML" | awk '{print tolower($0)}') + VALIDATE_YAML=$(echo "$VALIDATE_YAML" | awk '{print tolower($0)}') + VALIDATE_XML=$(echo "$VALIDATE_XML" | awk '{print tolower($0)}') ################################################ # Determine if any linters were explicitly set # From 195f67e1657b94465302ddbf6bbf26f14e994d19 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 20 Jul 2020 15:15:10 -0500 Subject: [PATCH 58/96] can i do this --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index eb0587da..e8b041e8 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -901,7 +901,7 @@ Footer() { ###################################### # Check if we validated the langauge # ###################################### - if [ "${!VALIDATE_LANGUAGE_ARRAY}" -gt 0 ]; then + if [ "${#!VALIDATE_LANGUAGE_ARRAY[@]}" -gt 0 ]; then CallStatusAPI "$LANGUAGE" "success" fi fi From bb6012b6443eabee266a52d51bf30dd4c6338d6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2020 06:03:04 +0000 Subject: [PATCH 59/96] Bump dotenvlinter/dotenv-linter from 2.0.0 to 2.1.0 Bumps dotenvlinter/dotenv-linter from 2.0.0 to 2.1.0. Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 242e066c..8fd8b36d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ # Get dependency images as build stages # ######################################### FROM borkdude/clj-kondo:2020.06.21 as clj-kondo -FROM dotenvlinter/dotenv-linter:2.0.0 as dotenv-linter +FROM dotenvlinter/dotenv-linter:2.1.0 as dotenv-linter FROM mstruebing/editorconfig-checker:2.1.0 as editorconfig-checker FROM golangci/golangci-lint:v1.27.0 as golangci-lint FROM yoheimuta/protolint:v0.25.1 as protolint From 3c6566c0e93143eea7e358ac0ce884b07f9600d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2020 06:03:30 +0000 Subject: [PATCH 60/96] Bump wata727/tflint from 0.16.2 to 0.18.0 Bumps wata727/tflint from 0.16.2 to 0.18.0. Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 242e066c..df1d2903 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ FROM mstruebing/editorconfig-checker:2.1.0 as editorconfig-checker FROM golangci/golangci-lint:v1.27.0 as golangci-lint FROM yoheimuta/protolint:v0.25.1 as protolint FROM koalaman/shellcheck:v0.7.1 as shellcheck -FROM wata727/tflint:0.16.2 as tflint +FROM wata727/tflint:0.18.0 as tflint ################## # Get base image # From d7f5b684bc53a599a32f8c585a3d4b5b2d67f092 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2020 06:03:31 +0000 Subject: [PATCH 61/96] Bump golangci/golangci-lint from v1.27.0 to v1.29.0 Bumps golangci/golangci-lint from v1.27.0 to v1.29.0. Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 242e066c..2fd2b8b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ FROM borkdude/clj-kondo:2020.06.21 as clj-kondo FROM dotenvlinter/dotenv-linter:2.0.0 as dotenv-linter FROM mstruebing/editorconfig-checker:2.1.0 as editorconfig-checker -FROM golangci/golangci-lint:v1.27.0 as golangci-lint +FROM golangci/golangci-lint:v1.29.0 as golangci-lint FROM yoheimuta/protolint:v0.25.1 as protolint FROM koalaman/shellcheck:v0.7.1 as shellcheck FROM wata727/tflint:0.16.2 as tflint From abaf0647f1b9f2f9707df682ff1a8904a1e316f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2020 06:03:42 +0000 Subject: [PATCH 62/96] Bump @typescript-eslint/parser from 3.6.1 to 3.7.0 in /dependencies Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 3.6.1 to 3.7.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v3.7.0/packages/parser) Signed-off-by: dependabot[bot] --- dependencies/package-lock.json | 94 +++++++++++++++++----------------- dependencies/package.json | 2 +- 2 files changed, 47 insertions(+), 49 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index 74f6fe6a..5ea5f7e3 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -529,58 +529,56 @@ } } }, + "@typescript-eslint/experimental-utils": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.7.0.tgz", + "integrity": "sha512-xpfXXAfZqhhqs5RPQBfAFrWDHoNxD5+sVB5A46TF58Bq1hRfVROrWHcQHHUM9aCBdy9+cwATcvCbRg8aIRbaHQ==", + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/types": "3.7.0", + "@typescript-eslint/typescript-estree": "3.7.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, "@typescript-eslint/parser": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.6.1.tgz", - "integrity": "sha512-SLihQU8RMe77YJ/jGTqOt0lMq7k3hlPVfp7v/cxMnXA9T0bQYoMDfTsNgHXpwSJM1Iq2aAJ8WqekxUwGv5F67Q==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.7.0.tgz", + "integrity": "sha512-2LZauVUt7jAWkcIW7djUc3kyW+fSarNEuM3RF2JdLHR9BfX/nDEnyA4/uWz0wseoWVZbDXDF7iF9Jc342flNqQ==", "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.6.1", - "@typescript-eslint/types": "3.6.1", - "@typescript-eslint/typescript-estree": "3.6.1", + "@typescript-eslint/experimental-utils": "3.7.0", + "@typescript-eslint/types": "3.7.0", + "@typescript-eslint/typescript-estree": "3.7.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/types": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.7.0.tgz", + "integrity": "sha512-reCaK+hyKkKF+itoylAnLzFeNYAEktB0XVfSQvf0gcVgpz1l49Lt6Vo9x4MVCCxiDydA0iLAjTF/ODH0pbfnpg==" + }, + "@typescript-eslint/typescript-estree": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.7.0.tgz", + "integrity": "sha512-xr5oobkYRebejlACGr1TJ0Z/r0a2/HUf0SXqPvlgUMwiMqOCu/J+/Dr9U3T0IxpE5oLFSkqMx1FE/dKaZ8KsOQ==", + "requires": { + "@typescript-eslint/types": "3.7.0", + "@typescript-eslint/visitor-keys": "3.7.0", + "debug": "^4.1.1", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.7.0.tgz", + "integrity": "sha512-k5PiZdB4vklUpUX4NBncn5RBKty8G3ihTY+hqJsCdMuD0v4jofI5xuqwnVcWxfv6iTm2P/dfEa2wMUnsUY8ODw==", + "requires": { "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "@typescript-eslint/experimental-utils": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.1.tgz", - "integrity": "sha512-oS+hihzQE5M84ewXrTlVx7eTgc52eu+sVmG7ayLfOhyZmJ8Unvf3osyFQNADHP26yoThFfbxcibbO0d2FjnYhg==", - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.6.1", - "@typescript-eslint/typescript-estree": "3.6.1", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/types": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.6.1.tgz", - "integrity": "sha512-NPxd5yXG63gx57WDTW1rp0cF3XlNuuFFB5G+Kc48zZ+51ZnQn9yjDEsjTPQ+aWM+V+Z0I4kuTFKjKvgcT1F7xQ==" - }, - "@typescript-eslint/typescript-estree": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.1.tgz", - "integrity": "sha512-G4XRe/ZbCZkL1fy09DPN3U0mR6SayIv1zSeBNquRFRk7CnVLgkC2ZPj8llEMJg5Y8dJ3T76SvTGtceytniaztQ==", - "requires": { - "@typescript-eslint/types": "3.6.1", - "@typescript-eslint/visitor-keys": "3.6.1", - "debug": "^4.1.1", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.1.tgz", - "integrity": "sha512-qC8Olwz5ZyMTZrh4Wl3K4U6tfms0R/mzU4/5W3XeUZptVraGVmbptJbn6h2Ey6Rb3hOs3zWoAUebZk8t47KGiQ==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - } } }, "JSV": { diff --git a/dependencies/package.json b/dependencies/package.json index eff0a75c..cb728475 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -4,7 +4,7 @@ "@coffeelint/cli": "^3.2.10", "@stoplight/spectral": "^5.4.0", "@typescript-eslint/eslint-plugin": "^3.6.1", - "@typescript-eslint/parser": "^3.6.1", + "@typescript-eslint/parser": "^3.7.0", "babel-eslint": "^10.1.0", "dockerfilelint": "^1.5.0", "eslint": "^7.5.0", From f6c1de220cf3ef543ebbba94cd1cbc32b17e5e7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2020 06:04:24 +0000 Subject: [PATCH 63/96] Bump @typescript-eslint/eslint-plugin in /dependencies Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 3.6.1 to 3.7.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v3.7.0/packages/eslint-plugin) Signed-off-by: dependabot[bot] --- dependencies/package-lock.json | 90 +++++++++++++++++----------------- dependencies/package.json | 2 +- 2 files changed, 45 insertions(+), 47 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index 74f6fe6a..22066e50 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -475,58 +475,28 @@ "integrity": "sha512-/tiJyrc0GPcsReHzgC0SXwOmoPjLqYe01W7dLYB0yasQXMbcRee+ZIk+g8MIQhoBS8fPoBQO3Y93+aeBrI93Ug==" }, "@typescript-eslint/eslint-plugin": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.6.1.tgz", - "integrity": "sha512-06lfjo76naNeOMDl+mWG9Fh/a0UHKLGhin+mGaIw72FUMbMGBkdi/FEJmgEDzh4eE73KIYzHWvOCYJ0ak7nrJQ==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.7.0.tgz", + "integrity": "sha512-4OEcPON3QIx0ntsuiuFP/TkldmBGXf0uKxPQlGtS/W2F3ndYm8Vgdpj/woPJkzUc65gd3iR+qi3K8SDQP/obFg==", "requires": { - "@typescript-eslint/experimental-utils": "3.6.1", + "@typescript-eslint/experimental-utils": "3.7.0", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", "semver": "^7.3.2", "tsutils": "^3.17.1" - }, - "dependencies": { - "@typescript-eslint/experimental-utils": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.1.tgz", - "integrity": "sha512-oS+hihzQE5M84ewXrTlVx7eTgc52eu+sVmG7ayLfOhyZmJ8Unvf3osyFQNADHP26yoThFfbxcibbO0d2FjnYhg==", - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.6.1", - "@typescript-eslint/typescript-estree": "3.6.1", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/types": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.6.1.tgz", - "integrity": "sha512-NPxd5yXG63gx57WDTW1rp0cF3XlNuuFFB5G+Kc48zZ+51ZnQn9yjDEsjTPQ+aWM+V+Z0I4kuTFKjKvgcT1F7xQ==" - }, - "@typescript-eslint/typescript-estree": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.1.tgz", - "integrity": "sha512-G4XRe/ZbCZkL1fy09DPN3U0mR6SayIv1zSeBNquRFRk7CnVLgkC2ZPj8llEMJg5Y8dJ3T76SvTGtceytniaztQ==", - "requires": { - "@typescript-eslint/types": "3.6.1", - "@typescript-eslint/visitor-keys": "3.6.1", - "debug": "^4.1.1", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.1.tgz", - "integrity": "sha512-qC8Olwz5ZyMTZrh4Wl3K4U6tfms0R/mzU4/5W3XeUZptVraGVmbptJbn6h2Ey6Rb3hOs3zWoAUebZk8t47KGiQ==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.7.0.tgz", + "integrity": "sha512-xpfXXAfZqhhqs5RPQBfAFrWDHoNxD5+sVB5A46TF58Bq1hRfVROrWHcQHHUM9aCBdy9+cwATcvCbRg8aIRbaHQ==", + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/types": "3.7.0", + "@typescript-eslint/typescript-estree": "3.7.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { @@ -583,6 +553,34 @@ } } }, + "@typescript-eslint/types": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.7.0.tgz", + "integrity": "sha512-reCaK+hyKkKF+itoylAnLzFeNYAEktB0XVfSQvf0gcVgpz1l49Lt6Vo9x4MVCCxiDydA0iLAjTF/ODH0pbfnpg==" + }, + "@typescript-eslint/typescript-estree": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.7.0.tgz", + "integrity": "sha512-xr5oobkYRebejlACGr1TJ0Z/r0a2/HUf0SXqPvlgUMwiMqOCu/J+/Dr9U3T0IxpE5oLFSkqMx1FE/dKaZ8KsOQ==", + "requires": { + "@typescript-eslint/types": "3.7.0", + "@typescript-eslint/visitor-keys": "3.7.0", + "debug": "^4.1.1", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.7.0.tgz", + "integrity": "sha512-k5PiZdB4vklUpUX4NBncn5RBKty8G3ihTY+hqJsCdMuD0v4jofI5xuqwnVcWxfv6iTm2P/dfEa2wMUnsUY8ODw==", + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, "JSV": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", diff --git a/dependencies/package.json b/dependencies/package.json index eff0a75c..02a3b7dc 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -3,7 +3,7 @@ "dependencies": { "@coffeelint/cli": "^3.2.10", "@stoplight/spectral": "^5.4.0", - "@typescript-eslint/eslint-plugin": "^3.6.1", + "@typescript-eslint/eslint-plugin": "^3.7.0", "@typescript-eslint/parser": "^3.6.1", "babel-eslint": "^10.1.0", "dockerfilelint": "^1.5.0", From 1fe8fb5431d2b50eb5456b1b2677d33b5f434b73 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 08:12:28 -0500 Subject: [PATCH 64/96] maybe this does it --- lib/linter.sh | 28 +++++++++++++--------------- lib/worker.sh | 5 +++++ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index e8b041e8..095fbaeb 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -99,11 +99,16 @@ LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck" ############################# # Language array for prints # ############################# -LANGUAGE_ARRAY=('YML' 'JSON' 'XML' 'MARKDOWN' 'BASH' 'PERL' 'RAKU' 'PHP' 'RUBY' 'PYTHON' - 'COFFEESCRIPT' 'ANSIBLE' 'JAVASCRIPT_STANDARD' 'JAVASCRIPT_ES' 'JSX' 'TSX' - 'TYPESCRIPT_STANDARD' 'TYPESCRIPT_ES' 'DOCKER' 'GO' 'TERRAFORM' - 'CSS' 'ENV' 'POWERSHELL' 'ARM' 'KOTLIN' 'PROTOBUF' 'CLOJURE' 'OPENAPI' - 'CFN' 'DART' 'HTML') +LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'CFN' 'CLOJURE' 'COFFEESCRIPT' + 'CSS' 'DART' 'DOCKER' 'ENV' 'GO' 'HTML' + 'JAVASCRIPT_ES' 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'OPENAPI' + 'MARKDOWN' 'PERL' 'PHP' 'POWERSHELL' 'PROTOBUF' 'PYTHON' 'RAKU' 'RUBY' + 'TERRAFORM' 'TSX' 'TYPESCRIPT_ES' 'TYPESCRIPT_STANDARD' 'XML' 'YML' ) + +############################################ +# Array for all languages that were linted # +############################################ +LINTED_LANGUAGES_ARRAY=() # Will be filled at run time with all languages that were linted ################### # GitHub ENV Vars # @@ -879,8 +884,7 @@ Footer() { # Print if not 0 # ################## if [ "${!ERROR_COUNTER}" -ne 0 ]; then - # We found errors - + # We found errors in the language ################### # Print the goods # ################### @@ -891,17 +895,11 @@ Footer() { ######################################### CallStatusAPI "$LANGUAGE" "error" else - # No errors found - - ############################################### - # Create Validate language var from Var input # - ############################################### - VALIDATE_LANGUAGE_ARRAY="FILE_ARRAY_${LANGUAGE}" - + # No errors found when linting the language ###################################### # Check if we validated the langauge # ###################################### - if [ "${#!VALIDATE_LANGUAGE_ARRAY[@]}" -gt 0 ]; then + if [[ "${LINTED_LANGUAGES_ARRAY[@]}" =~ "${LANGUAGE}" ]]; then CallStatusAPI "$LANGUAGE" "success" fi fi diff --git a/lib/worker.sh b/lib/worker.sh index c75dc65a..b602ec09 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -34,6 +34,11 @@ function LintCodebase() { PRINT_ARRAY+=("----------------------------------------------") PRINT_ARRAY+=("----------------------------------------------") + ################################# + # Add the language to the array # + ################################# + LINTED_LANGUAGES_ARRAY+=("$FILE_TYPE") + ##################################### # Validate we have linter installed # ##################################### From dabf5e25c08e4ea0d7534a63c8e5871d7a4c8e79 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 08:23:32 -0500 Subject: [PATCH 65/96] this shoudl be better --- lib/linter.sh | 7 ++++++- lib/worker.sh | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 095fbaeb..4ea4892c 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -871,6 +871,11 @@ Footer() { echo "Reports generated in folder ${REPORT_OUTPUT_FOLDER}" fi + #################################################### + # Need to clean up the lanuage array of duplicates # + #################################################### + UNIQUE_LINTED_ARRAY=($(echo "${LINTED_LANGUAGES_ARRAY[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + ############################## # Prints for errors if found # ############################## @@ -899,7 +904,7 @@ Footer() { ###################################### # Check if we validated the langauge # ###################################### - if [[ "${LINTED_LANGUAGES_ARRAY[@]}" =~ "${LANGUAGE}" ]]; then + if [[ "${UNIQUE_LINTED_ARRAY[@]}" =~ "${LANGUAGE}" ]]; then CallStatusAPI "$LANGUAGE" "success" fi fi diff --git a/lib/worker.sh b/lib/worker.sh index b602ec09..41a18054 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -34,11 +34,6 @@ function LintCodebase() { PRINT_ARRAY+=("----------------------------------------------") PRINT_ARRAY+=("----------------------------------------------") - ################################# - # Add the language to the array # - ################################# - LINTED_LANGUAGES_ARRAY+=("$FILE_TYPE") - ##################################### # Validate we have linter installed # ##################################### @@ -173,6 +168,11 @@ function LintCodebase() { echo "---------------------------" echo "File:[$FILE]" + ################################# + # Add the language to the array # + ################################# + LINTED_LANGUAGES_ARRAY+=("$FILE_TYPE") + #################### # Set the base Var # #################### From 535d2aea7d12a88220bb94fd0179abcbf2f98921 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 08:52:30 -0500 Subject: [PATCH 66/96] fixing internal names --- lib/buildFileList.sh | 2 +- lib/linter.sh | 20 ++++++++++---------- lib/validation.sh | 12 ++++++------ lib/worker.sh | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index ea152a4b..7e105d32 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -183,7 +183,7 @@ function BuildFileList() { ################################ # Append the file to the array # ################################ - FILE_ARRAY_MD+=("$FILE") + FILE_ARRAY_MARKDOWN+=("$FILE") ###################### # Get the BASH files # ###################### diff --git a/lib/linter.sh b/lib/linter.sh index 4ea4892c..6e57750b 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -28,8 +28,8 @@ LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter YAML_FILE_NAME='.yaml-lint.yml' # Name of the file YAML_LINTER_RULES="$DEFAULT_RULES_LOCATION/$YAML_FILE_NAME" # Path to the yaml lint rules # MD Vars -MD_FILE_NAME='.markdown-lint.yml' # Name of the file -MD_LINTER_RULES="$DEFAULT_RULES_LOCATION/$MD_FILE_NAME" # Path to the markdown lint rules +MARKDOWN_FILE_NAME='.markdown-lint.yml' # Name of the file +MARKDOWN_LINTER_RULES="$DEFAULT_RULES_LOCATION/$MARKDOWN_FILE_NAME" # Path to the markdown lint rules # Python Vars PYTHON_FILE_NAME='.python-lint' # Name of the file PYTHON_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PYTHON_FILE_NAME" # Path to the python lint rules @@ -102,7 +102,7 @@ LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck" LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'CFN' 'CLOJURE' 'COFFEESCRIPT' 'CSS' 'DART' 'DOCKER' 'ENV' 'GO' 'HTML' 'JAVASCRIPT_ES' 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'OPENAPI' - 'MARKDOWN' 'PERL' 'PHP' 'POWERSHELL' 'PROTOBUF' 'PYTHON' 'RAKU' 'RUBY' + 'MARKDOWN' 'PERL' 'PHP' 'POWERSHELL' 'PROTOBUF' 'PYTHON' 'RAKU' 'RUBY' 'TERRAFORM' 'TSX' 'TYPESCRIPT_ES' 'TYPESCRIPT_STANDARD' 'XML' 'YML' ) ############################################ @@ -126,7 +126,7 @@ VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to vali VALIDATE_ANSIBLE="${VALIDATE_ANSIBLE}" # Boolean to validate language VALIDATE_ARM="${VALIDATE_ARM}" # Boolean to validate language VALIDATE_BASH="${VALIDATE_BASH}" # Boolean to validate language -VALIDATE_CLOUDFORMATION="${VALIDATE_CLOUDFORMATION}" # Boolean to validate language +VALIDATE_CFN="${VALIDATE_CLOUDFORMATION}" # Boolean to validate language VALIDATE_CLOJURE="${VALIDATE_CLOJURE}" # Boolean to validate language VALIDATE_COFFEE="${VALIDATE_COFFEE}" # Boolean to validate language VALIDATE_CSS="${VALIDATE_CSS}" # Boolean to validate language @@ -141,7 +141,7 @@ VALIDATE_JAVASCRIPT_STANDARD="${VALIDATE_JAVASCRIPT_STANDARD}" # Boolean to vali VALIDATE_JSON="${VALIDATE_JSON}" # Boolean to validate language VALIDATE_JSX="${VALIDATE_JSX}" # Boolean to validate language VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language -VALIDATE_MD="${VALIDATE_MD}" # Boolean to validate language +VALIDATE_MARKDOWN="${VALIDATE_MD}" # Boolean to validate language VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language VALIDATE_PERL="${VALIDATE_PERL}" # Boolean to validate language VALIDATE_PHP="${VALIDATE_PHP}" # Boolean to validate language @@ -216,7 +216,7 @@ FILE_ARRAY_JAVASCRIPT_STANDARD=() # Array of files to check FILE_ARRAY_JSON=() # Array of files to check FILE_ARRAY_JSX=() # Array of files to check FILE_ARRAY_KOTLIN=() # Array of files to check -FILE_ARRAY_MD=() # Array of files to check +FILE_ARRAY_MARKDOWN=() # Array of files to check FILE_ARRAY_OPENAPI=() # Array of files to check FILE_ARRAY_PERL=() # Array of files to check FILE_ARRAY_PHP=() # Array of files to check @@ -1012,7 +1012,7 @@ GetValidationInfo # Get YML rules GetLinterRules "YAML" # Get Markdown rules -GetLinterRules "MD" +GetLinterRules "MARKDOWN" # Get Python rules GetLinterRules "PYTHON" # Get Ruby rules @@ -1117,12 +1117,12 @@ fi #################### # MARKDOWN LINTING # #################### -if [ "$VALIDATE_MD" == "true" ]; then +if [ "$VALIDATE_MARKDOWN" == "true" ]; then ########################### # Lint the Markdown Files # ########################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "MARKDOWN" "markdownlint" "markdownlint -c $MD_LINTER_RULES" ".*\.\(md\)\$" "${FILE_ARRAY_MD[@]}" + LintCodebase "MARKDOWN" "markdownlint" "markdownlint -c $MARKDOWN_LINTER_RULES" ".*\.\(md\)\$" "${FILE_ARRAY_MARKDOWN[@]}" fi ################ @@ -1150,7 +1150,7 @@ fi ############### # CFN LINTING # ############### -if [ "$VALIDATE_CLOUDFORMATION" == "true" ]; then +if [ "$VALIDATE_CFN" == "true" ]; then ################################# # Lint the CloudFormation files # ################################# diff --git a/lib/validation.sh b/lib/validation.sh index 3750d28f..526a6e2c 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -63,7 +63,7 @@ function GetValidationInfo() { VALIDATE_JSON=$(echo "$VALIDATE_JSON" | awk '{print tolower($0)}') VALIDATE_JSX=$(echo "$VALIDATE_JSX" | awk '{print tolower($0)}') VALIDATE_KOTLIN=$(echo "$VALIDATE_KOTLIN" | awk '{print tolower($0)}') - VALIDATE_MD=$(echo "$VALIDATE_MD" | awk '{print tolower($0)}') + VALIDATE_MARKDOWN=$(echo "$VALIDATE_MARKDOWN" | awk '{print tolower($0)}') VALIDATE_OPENAPI=$(echo "$VALIDATE_OPENAPI" | awk '{print tolower($0)}') VALIDATE_PERL=$(echo "$VALIDATE_PERL" | awk '{print tolower($0)}') VALIDATE_PHP=$(echo "$VALIDATE_PHP" | awk '{print tolower($0)}') @@ -86,7 +86,7 @@ function GetValidationInfo() { if [[ -n $VALIDATE_YAML || -n \ $VALIDATE_JSON || -n \ $VALIDATE_XML || -n \ - $VALIDATE_MD || -n \ + $VALIDATE_MARKDOWN || -n \ $VALIDATE_BASH || -n \ $VALIDATE_PERL || -n \ $VALIDATE_RAKU || -n \ @@ -163,13 +163,13 @@ function GetValidationInfo() { ######################################## if [[ $ANY_SET == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_MD ]]; then + if [[ -z $VALIDATE_MARKDOWN ]]; then # MD flag was not set - default to false - VALIDATE_MD="false" + VALIDATE_MARKDOWN="false" fi else # No linter flags were set - default all to true - VALIDATE_MD="true" + VALIDATE_MARKDOWN="true" fi #################################### @@ -585,7 +585,7 @@ function GetValidationInfo() { else PRINT_ARRAY+=("- Excluding [XML] files in code base...") fi - if [[ $VALIDATE_MD == "true" ]]; then + if [[ $VALIDATE_MARKDOWN == "true" ]]; then PRINT_ARRAY+=("- Validating [MARKDOWN] files in code base...") else PRINT_ARRAY+=("- Excluding [MARKDOWN] files in code base...") diff --git a/lib/worker.sh b/lib/worker.sh index 41a18054..3a8e37c1 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +MARKDOWN_#!/usr/bin/env bash ################################################################################ ################################################################################ @@ -569,7 +569,7 @@ function RunTestCases() { TestCodebase "JAVASCRIPT_STANDARD" "standard" "standard $JAVASCRIPT_STANDARD_LINTER_RULES" ".*\.\(js\)\$" "javascript" TestCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "json" TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin" - TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c $MD_LINTER_RULES" ".*\.\(md\)\$" "markdown" + TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c $MARKDOWN_LINTER_RULES" ".*\.\(md\)\$" "markdown" TestCodebase "PERL" "perl" "perl -Mstrict -cw" ".*\.\(pl\)\$" "perl" TestCodebase "PHP" "php" "php -l" ".*\.\(php\)\$" "php" TestCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" ".*\.\(ymlopenapi\|jsonopenapi\)\$" "openapi" From 4f1493c9dd78020503d4fd7013b9dd5607e1ac4b Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 09:10:20 -0500 Subject: [PATCH 67/96] fixing errors --- lib/linter.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 6e57750b..f5e1be81 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -141,7 +141,7 @@ VALIDATE_JAVASCRIPT_STANDARD="${VALIDATE_JAVASCRIPT_STANDARD}" # Boolean to vali VALIDATE_JSON="${VALIDATE_JSON}" # Boolean to validate language VALIDATE_JSX="${VALIDATE_JSX}" # Boolean to validate language VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language -VALIDATE_MARKDOWN="${VALIDATE_MD}" # Boolean to validate language +VALIDATE_MARKDOWN="${VALIDATE_MD}" # shellcheck disable=SC2153 VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language VALIDATE_PERL="${VALIDATE_PERL}" # Boolean to validate language VALIDATE_PHP="${VALIDATE_PHP}" # Boolean to validate language @@ -874,7 +874,8 @@ Footer() { #################################################### # Need to clean up the lanuage array of duplicates # #################################################### - UNIQUE_LINTED_ARRAY=($(echo "${LINTED_LANGUAGES_ARRAY[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + mapfile -t UNIQUE_LINTED_ARRAY < <(echo "${LINTED_LANGUAGES_ARRAY[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ') + # UNIQUE_LINTED_ARRAY=($(echo "${LINTED_LANGUAGES_ARRAY[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) ############################## # Prints for errors if found # @@ -904,7 +905,7 @@ Footer() { ###################################### # Check if we validated the langauge # ###################################### - if [[ "${UNIQUE_LINTED_ARRAY[@]}" =~ "${LANGUAGE}" ]]; then + if [[ "${UNIQUE_LINTED_ARRAY[*]}" =~ ${LANGUAGE} ]]; then CallStatusAPI "$LANGUAGE" "success" fi fi From eaad677b542552e47ff3b5f318cd784035391813 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 09:14:23 -0500 Subject: [PATCH 68/96] more bugs --- lib/linter.sh | 3 ++- lib/worker.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index f5e1be81..c242aad8 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -141,7 +141,8 @@ VALIDATE_JAVASCRIPT_STANDARD="${VALIDATE_JAVASCRIPT_STANDARD}" # Boolean to vali VALIDATE_JSON="${VALIDATE_JSON}" # Boolean to validate language VALIDATE_JSX="${VALIDATE_JSX}" # Boolean to validate language VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language -VALIDATE_MARKDOWN="${VALIDATE_MD}" # shellcheck disable=SC2153 +# shellcheck disable=SC2153 +VALIDATE_MARKDOWN="${VALIDATE_MD}" # Boolean to validate language VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language VALIDATE_PERL="${VALIDATE_PERL}" # Boolean to validate language VALIDATE_PHP="${VALIDATE_PHP}" # Boolean to validate language diff --git a/lib/worker.sh b/lib/worker.sh index 3a8e37c1..17db091c 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -1,4 +1,4 @@ -MARKDOWN_#!/usr/bin/env bash +#!/usr/bin/env bash ################################################################################ ################################################################################ From 4d079ba298749a893f838c5ebfe5bacb1d9fc4a6 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 09:22:42 -0500 Subject: [PATCH 69/96] remove comment --- lib/linter.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index c242aad8..287ad6db 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -876,7 +876,6 @@ Footer() { # Need to clean up the lanuage array of duplicates # #################################################### mapfile -t UNIQUE_LINTED_ARRAY < <(echo "${LINTED_LANGUAGES_ARRAY[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ') - # UNIQUE_LINTED_ARRAY=($(echo "${LINTED_LANGUAGES_ARRAY[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) ############################## # Prints for errors if found # From 7fd749237c37e84aabb12eb79880e39192207171 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 09:53:31 -0500 Subject: [PATCH 70/96] adding it --- .github/workflows/automerge-dependabot.yml | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/automerge-dependabot.yml diff --git a/.github/workflows/automerge-dependabot.yml b/.github/workflows/automerge-dependabot.yml new file mode 100644 index 00000000..1e212ebf --- /dev/null +++ b/.github/workflows/automerge-dependabot.yml @@ -0,0 +1,47 @@ +--- +####################################### +####################################### +## Dependabot automerge dependencies ## +####################################### +####################################### + +# +# Documentation: +# https://medium.com/@toufik.airane/automerge-github-dependabot-alerts-with-github-actions-7cd6f5763750 +# + +###################### +# name of the action # +###################### +name: automerge on pull request + +############### +# When to run # +############### +on: [pull_request] + +################# +# Start the job # +################# +jobs: + automerge: + name: automerge dependabot + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: merge + uses: actions/github-script@0.2.0 + with: + script: | + github.pullRequests.createReview({ + owner: context.payload.repository.owner.login, + repo: context.payload.repository.name, + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }) + github.pullRequests.merge({ + owner: context.payload.repository.owner.login, + repo: context.payload.repository.name, + pull_number: context.payload.pull_request.number + }) + github-token: ${{github.token}} From 7cb1ab7b8e364b5f1de6c1ba48bd8d211c60fb9c Mon Sep 17 00:00:00 2001 From: Gabo Date: Tue, 21 Jul 2020 10:01:16 -0500 Subject: [PATCH 71/96] Fix wrong config --- .github/dependabot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 60bbe20b..05015ebd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -21,8 +21,7 @@ updates: directory: "/dependencies" schedule: interval: "daily" - labels: - - "Type: Maintenance" + open-pull-requests-limit: 10 # Maintain dependencies for docker - package-ecosystem: "docker" @@ -37,3 +36,4 @@ updates: schedule: interval: "daily" open-pull-requests-limit: 10 + From 6022bd2ee65953a6512136f08b20b94d12d107bb Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 10:13:15 -0500 Subject: [PATCH 72/96] Adding logic to skip status without proper data --- lib/linter.sh | 53 ++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 287ad6db..e2ec4321 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -826,32 +826,37 @@ CallStatusAPI() { MESSAGE="$FAIL_MSG" fi - ############################################## - # Call the status API to create status check # - ############################################## - SEND_STATUS_CMD=$(curl -f -s -X POST \ - --url "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ - -H 'accept: application/vnd.github.v3+json' \ - -H "authorization: Bearer $GITHUB_TOKEN" \ - -H 'content-type: application/json' \ - -d "{ \"state\": \"$STATUS\", - \"target_url\": \"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\", - \"description\": \"$MESSAGE\", \"context\": \"--> Linted: $LANGUAGE\" - }" 2>&1) + ########################################################## + # Check to see if were enabled for multi Status mesaages # + ########################################################## + if [ $MULTI_STATUS == "true" ]; then + ############################################## + # Call the status API to create status check # + ############################################## + SEND_STATUS_CMD=$(curl -f -s -X POST \ + --url "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + -H 'accept: application/vnd.github.v3+json' \ + -H "authorization: Bearer $GITHUB_TOKEN" \ + -H 'content-type: application/json' \ + -d "{ \"state\": \"$STATUS\", + \"target_url\": \"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\", + \"description\": \"$MESSAGE\", \"context\": \"--> Linted: $LANGUAGE\" + }" 2>&1) - ####################### - # Load the error code # - ####################### - ERROR_CODE=$? + ####################### + # Load the error code # + ####################### + ERROR_CODE=$? - ############################## - # Check the shell for errors # - ############################## - if [ "$ERROR_CODE" -ne 0 ]; then - # ERROR - echo "ERROR! Failed to call GitHub Status API!" - echo "ERROR:[$SEND_STATUS_CMD]" - # Not going to fail the script on this yet... + ############################## + # Check the shell for errors # + ############################## + if [ "$ERROR_CODE" -ne 0 ]; then + # ERROR + echo "ERROR! Failed to call GitHub Status API!" + echo "ERROR:[$SEND_STATUS_CMD]" + # Not going to fail the script on this yet... + fi fi } ################################################################################ From 8510e56817c31d8223d0f3038c3099346aa94226 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 10:21:08 -0500 Subject: [PATCH 73/96] fixed it --- lib/linter.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/linter.sh b/lib/linter.sh index e2ec4321..e76e5943 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -726,6 +726,11 @@ GetGitHubVars() { echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_TOKEN]!${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_TOKEN]${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!${NC}" + + ################################################################################ + # Need to set MULTI_STATUS to false as we cant hit API endpoints without token # + ################################################################################ + MULTI_STATUS='false' else echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_TOKEN]${NC}" fi From d7c8d9be359e3c17621e53492f047230af22214f Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 10:24:16 -0500 Subject: [PATCH 74/96] quotes --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index e76e5943..b9764a5f 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -834,7 +834,7 @@ CallStatusAPI() { ########################################################## # Check to see if were enabled for multi Status mesaages # ########################################################## - if [ $MULTI_STATUS == "true" ]; then + if [ "$MULTI_STATUS" == "true" ]; then ############################################## # Call the status API to create status check # ############################################## From 3a35e86775e7572696e3c84668366041cf4fa9a6 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 11:09:05 -0500 Subject: [PATCH 75/96] super clean --- lib/linter.sh | 9 +++--- lib/validation.sh | 70 +++++++++++++++++++++++------------------------ 2 files changed, 39 insertions(+), 40 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index b9764a5f..030bb170 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -141,8 +141,7 @@ VALIDATE_JAVASCRIPT_STANDARD="${VALIDATE_JAVASCRIPT_STANDARD}" # Boolean to vali VALIDATE_JSON="${VALIDATE_JSON}" # Boolean to validate language VALIDATE_JSX="${VALIDATE_JSX}" # Boolean to validate language VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language -# shellcheck disable=SC2153 -VALIDATE_MARKDOWN="${VALIDATE_MD}" # Boolean to validate language +VALIDATE_MARKDOWN="${VALIDATE_MD:-}" # Boolean to validate language VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language VALIDATE_PERL="${VALIDATE_PERL}" # Boolean to validate language VALIDATE_PHP="${VALIDATE_PHP}" # Boolean to validate language @@ -598,7 +597,7 @@ GetGitHubVars() { ############################### # Convert string to lowercase # ############################### - TEST_CASE_RUN=$(echo "$TEST_CASE_RUN" | awk '{print tolower($0)}') + TEST_CASE_RUN="${TEST_CASE_RUN,,}" ########################## # Get the run local flag # @@ -613,7 +612,7 @@ GetGitHubVars() { ############################### # Convert string to lowercase # ############################### - RUN_LOCAL=$(echo "$RUN_LOCAL" | awk '{print tolower($0)}') + RUN_LOCAL="${RUN_LOCAL,,}" ################################# # Check if were running locally # @@ -738,7 +737,7 @@ GetGitHubVars() { ############################### # Convert string to lowercase # ############################### - MULTI_STATUS=$(echo "$MULTI_STATUS" | awk '{print tolower($0)}') + MULTI_STATUS="${MULTI_STATUS,,}" ####################################################################### # Check to see if the multi status is set, and we have a token to use # diff --git a/lib/validation.sh b/lib/validation.sh index 526a6e2c..9be40a60 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -24,7 +24,7 @@ function GetValidationInfo() { ############################### # Convert string to lowercase # ############################### - VALIDATE_ALL_CODEBASE=$(echo "$VALIDATE_ALL_CODEBASE" | awk '{print tolower($0)}') + VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE,,}" ###################################### # Validate we should check all files # ###################################### @@ -46,38 +46,38 @@ function GetValidationInfo() { ################################ # Convert strings to lowercase # ################################ - VALIDATE_ANSIBLE=$(echo "$VALIDATE_ANSIBLE" | awk '{print tolower($0)}') - VALIDATE_ARM=$(echo "$VALIDATE_ARM" | awk '{print tolower($0)}') - VALIDATE_BASH=$(echo "$VALIDATE_BASH" | awk '{print tolower($0)}') - VALIDATE_CLOJURE=$(echo "$VALIDATE_CLOJURE" | awk '{print tolower($0)}') - VALIDATE_COFFEE=$(echo "$VALIDATE_COFFEE" | awk '{print tolower($0)}') - VALIDATE_CSS=$(echo "$VALIDATE_CSS" | awk '{print tolower($0)}') - VALIDATE_DART=$(echo "$VALIDATE_DART" | awk '{print tolower($0)}') - VALIDATE_DOCKER=$(echo "$VALIDATE_DOCKER" | awk '{print tolower($0)}') - VALIDATE_EDITORCONFIG=$(echo "$VALIDATE_EDITORCONFIG" | awk '{print tolower($0)}') - VALIDATE_ENV=$(echo "$VALIDATE_ENV" | awk '{print tolower($0)}') - VALIDATE_GO=$(echo "$VALIDATE_GO" | awk '{print tolower($0)}') - VALIDATE_HTML=$(echo "$VALIDATE_HTML" | awk '{print tolower($0)}') - VALIDATE_JAVASCRIPT_ES=$(echo "$VALIDATE_JAVASCRIPT_ES" | awk '{print tolower($0)}') - VALIDATE_JAVASCRIPT_STANDARD=$(echo "$VALIDATE_JAVASCRIPT_STANDARD" | awk '{print tolower($0)}') - VALIDATE_JSON=$(echo "$VALIDATE_JSON" | awk '{print tolower($0)}') - VALIDATE_JSX=$(echo "$VALIDATE_JSX" | awk '{print tolower($0)}') - VALIDATE_KOTLIN=$(echo "$VALIDATE_KOTLIN" | awk '{print tolower($0)}') - VALIDATE_MARKDOWN=$(echo "$VALIDATE_MARKDOWN" | awk '{print tolower($0)}') - VALIDATE_OPENAPI=$(echo "$VALIDATE_OPENAPI" | awk '{print tolower($0)}') - VALIDATE_PERL=$(echo "$VALIDATE_PERL" | awk '{print tolower($0)}') - VALIDATE_PHP=$(echo "$VALIDATE_PHP" | awk '{print tolower($0)}') - VALIDATE_POWERSHELL=$(echo "$VALIDATE_POWERSHELL" | awk '{print tolower($0)}') - VALIDATE_PROTOBUF=$(echo "$VALIDATE_PROTOBUF" | awk '{print tolower($0)}') - VALIDATE_PYTHON=$(echo "$VALIDATE_PYTHON" | awk '{print tolower($0)}') - VALIDATE_RAKU=$(echo "$VALIDATE_RAKU" | awk '{print tolower($0)}') - VALIDATE_RUBY=$(echo "$VALIDATE_RUBY" | awk '{print tolower($0)}') - VALIDATE_TERRAFORM=$(echo "$VALIDATE_TERRAFORM" | awk '{print tolower($0)}') - VALIDATE_TSX=$(echo "$VALIDATE_TSX" | awk '{print tolower($0)}') - VALIDATE_TYPESCRIPT_ES=$(echo "$VALIDATE_TYPESCRIPT_ES" | awk '{print tolower($0)}') - VALIDATE_TYPESCRIPT_STANDARD=$(echo "$VALIDATE_TYPESCRIPT_STANDARD" | awk '{print tolower($0)}') - VALIDATE_YAML=$(echo "$VALIDATE_YAML" | awk '{print tolower($0)}') - VALIDATE_XML=$(echo "$VALIDATE_XML" | awk '{print tolower($0)}') + VALIDATE_ANSIBLE="${VALIDATE_ANSIBLE,,}" + VALIDATE_ARM="${VALIDATE_ARM,,}" + VALIDATE_BASH="${VALIDATE_BASH,,}" + VALIDATE_CLOJURE="${VALIDATE_CLOJURE,,}" + VALIDATE_COFFEE="${VALIDATE_COFFEE,,}" + VALIDATE_CSS="${VALIDATE_CSS,,}" + VALIDATE_DART="${VALIDATE_DART,,}" + VALIDATE_DOCKER="${VALIDATE_DOCKER,,}" + VALIDATE_EDITORCONFIG="${VALIDATE_EDITORCONFIG,,}" + VALIDATE_ENV="${VALIDATE_ENV,,}" + VALIDATE_GO="${VALIDATE_GO,,}" + VALIDATE_HTML="${VALIDATE_HTML,,}" + VALIDATE_JAVASCRIPT_ES="${VALIDATE_JAVASCRIPT_ES,,}" + VALIDATE_JAVASCRIPT_STANDARD="${VALIDATE_JAVASCRIPT_STANDARD,,}" + VALIDATE_JSON="${VALIDATE_JSON,,}" + VALIDATE_JSX="${VALIDATE_JSX,,}" + VALIDATE_KOTLIN="${VALIDATE_KOTLIN,,}" + VALIDATE_MARKDOWN="${VALIDATE_MARKDOWN,,}" + VALIDATE_OPENAPI="${VALIDATE_OPENAPI,,}" + VALIDATE_PERL="${VALIDATE_PERL,,}" + VALIDATE_PHP="${VALIDATE_PHP,,}" + VALIDATE_POWERSHELL="${VALIDATE_POWERSHELL,,}" + VALIDATE_PROTOBUF="${VALIDATE_PROTOBUF,,}" + VALIDATE_PYTHON="${VALIDATE_PYTHON,,}" + VALIDATE_RAKU="${VALIDATE_RAKU,,}" + VALIDATE_RUBY="${VALIDATE_RUBY,,}" + VALIDATE_TERRAFORM="${VALIDATE_TERRAFORM,,}" + VALIDATE_TSX="${VALIDATE_TSX,,}" + VALIDATE_TYPESCRIPT_ES="${VALIDATE_TYPESCRIPT_ES,,}" + VALIDATE_TYPESCRIPT_STANDARD="${VALIDATE_TYPESCRIPT_STANDARD,,}" + VALIDATE_YAML="${VALIDATE_YAML,,}" + VALIDATE_XML="${VALIDATE_XML,,}" ################################################ # Determine if any linters were explicitly set # @@ -752,7 +752,7 @@ function GetValidationInfo() { ############################### # Convert string to lowercase # ############################### - DISABLE_ERRORS=$(echo "$DISABLE_ERRORS" | awk '{print tolower($0)}') + DISABLE_ERRORS="${DISABLE_ERRORS,,}" ############################ # Set to false if not true # @@ -774,7 +774,7 @@ function GetValidationInfo() { ############################### # Convert string to lowercase # ############################### - ACTIONS_RUNNER_DEBUG=$(echo "$ACTIONS_RUNNER_DEBUG" | awk '{print tolower($0)}') + ACTIONS_RUNNER_DEBUG="${ACTIONS_RUNNER_DEBUG,,}" ############################ # Set to true if not false # From 1d91e2604fd97940537bd54f3ab0e52392e6219d Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 21 Jul 2020 12:08:05 -0500 Subject: [PATCH 76/96] Format Markdown --- .automation/README.md | 13 +- .automation/test/README.md | 2 + .automation/test/ansible/README.md | 8 +- .automation/test/arm/README.md | 8 +- .automation/test/cfn/README.md | 6 + .automation/test/clojure/README.md | 8 +- .automation/test/coffeescript/README.md | 8 +- .automation/test/css/README.md | 8 +- .automation/test/dart/README.md | 6 + .automation/test/docker/README.md | 7 +- .../test/editorconfig-checker/README.md | 6 + .automation/test/env/README.md | 6 + .automation/test/golang/README.md | 8 +- .automation/test/html/README.md | 10 +- .automation/test/javascript/README.md | 8 +- .automation/test/json/README.md | 8 +- .automation/test/kotlin/README.md | 8 +- .automation/test/markdown/README.md | 8 +- .automation/test/openapi/README.md | 8 +- .automation/test/perl/README.md | 8 +- .automation/test/php/README.md | 8 +- .automation/test/powershell/README.md | 8 +- .automation/test/python/README.md | 8 +- .automation/test/raku/README.md | 8 +- .automation/test/ruby/README.md | 8 +- .automation/test/shell/README.md | 8 +- .automation/test/typescript/README.md | 8 +- .automation/test/xml/README.md | 8 +- .automation/test/yml/README.md | 8 +- .devcontainer/README.md | 6 +- .github/CONTRIBUTING.md | 13 +- .github/ISSUE_TEMPLATE/bug_report.md | 1 + .github/pull_request-template.md | 8 +- README.md | 222 +++++++------ TEMPLATES/README.md | 4 +- docs/disabling-linters.md | 302 ++++++++++++++---- docs/run-linter-locally.md | 14 +- lib/README.md | 3 + 38 files changed, 591 insertions(+), 206 deletions(-) diff --git a/.automation/README.md b/.automation/README.md index 485e97ec..cbb02f2e 100644 --- a/.automation/README.md +++ b/.automation/README.md @@ -1,23 +1,28 @@ # .automation + This folder holds automation scripts to help `deploy` and `cleanup` **DockerHub** images of the **Super-Linter** ## cleanup-docker.sh + This script uses **GitHub Actions** so that when a PR is merged and closed, the **GitHub Action** is triggered. It will then search **DockerHub** for the image that was deployed during the development, and remove it. ## upload-docker.sh + This script uses **GitHub Actions** so that when a push to the repository is committed, it will complete the following: + - Checkout the source code - Build the **Docker** container for **Super-Linter** using that source code - Upload the container to **DockerHub** When the script is triggered on master, it will push with the tag:**latest** which is used by all scripting for general availability. When the script is triggered in a branch, it will push with the tag:**NameOfBranch** which can be used for: -- *testing* -- *troubleshooting* -- *debugging* + +- _testing_ +- _troubleshooting_ +- _debugging_ - **Note:** The branch name will be reduced to alphanumeric for consistency and uploading ## test -This folder holds all **Test Cases** to help run the *CI/CT/CD* process for the **Super-Linter**. +This folder holds all **Test Cases** to help run the _CI/CT/CD_ process for the **Super-Linter**. diff --git a/.automation/test/README.md b/.automation/test/README.md index 9fd57345..2ebd6c71 100644 --- a/.automation/test/README.md +++ b/.automation/test/README.md @@ -1,6 +1,8 @@ # Test Cases + This folder holds `test cases` that are used to validate the sanity of the **Super-Linter**. The format: + - Each **Super-Linter** language should have its own folder - Folder(s) containing test cases for each language supported - Passing test case(s) per language denoted in naming scheme diff --git a/.automation/test/ansible/README.md b/.automation/test/ansible/README.md index b156a407..c8a0a623 100644 --- a/.automation/test/ansible/README.md +++ b/.automation/test/ansible/README.md @@ -1,13 +1,19 @@ # Ansible Test Cases -This folder holds the test cases for **Ansible**. + +This folder holds the test cases for **Ansible**. ## Additional Docs + The folder **ghe-initialize** is pulled from the **GitHub-Demo-Stack** and is a valid **Ansible** role. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/arm/README.md b/.automation/test/arm/README.md index e2746d06..e28d398a 100644 --- a/.automation/test/arm/README.md +++ b/.automation/test/arm/README.md @@ -1,13 +1,19 @@ # ARM Test Cases -This folder holds the test cases for **Azure Resource Manager (ARM)**. + +This folder holds the test cases for **Azure Resource Manager (ARM)**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/cfn/README.md b/.automation/test/cfn/README.md index ace786b4..e90eba79 100644 --- a/.automation/test/cfn/README.md +++ b/.automation/test/cfn/README.md @@ -1,13 +1,19 @@ # AWS CloudFormation Test Cases + This folder holds the test cases for **CloudFormation**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/clojure/README.md b/.automation/test/clojure/README.md index 6606ef5b..24594144 100644 --- a/.automation/test/clojure/README.md +++ b/.automation/test/clojure/README.md @@ -1,13 +1,19 @@ # Clojure Test Cases -This folder holds the test cases for **Clojure**. + +This folder holds the test cases for **Clojure**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/coffeescript/README.md b/.automation/test/coffeescript/README.md index 42a56d5a..01b401a9 100644 --- a/.automation/test/coffeescript/README.md +++ b/.automation/test/coffeescript/README.md @@ -1,13 +1,19 @@ # Coffeescript Test Cases -This folder holds the test cases for **Coffeescript**. + +This folder holds the test cases for **Coffeescript**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/css/README.md b/.automation/test/css/README.md index 04c7121a..7c284115 100644 --- a/.automation/test/css/README.md +++ b/.automation/test/css/README.md @@ -1,13 +1,19 @@ # CSS Test Cases -This folder holds the test cases for **CSS**. + +This folder holds the test cases for **CSS**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/dart/README.md b/.automation/test/dart/README.md index 21299b50..220ba3d2 100644 --- a/.automation/test/dart/README.md +++ b/.automation/test/dart/README.md @@ -1,13 +1,19 @@ # Dart Test Cases + This folder holds the test cases for **Dart**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/docker/README.md b/.automation/test/docker/README.md index 10a18447..cdc0a8a4 100644 --- a/.automation/test/docker/README.md +++ b/.automation/test/docker/README.md @@ -1,13 +1,18 @@ # Docker Test Cases -This folder holds the test cases for **Docker**. + +This folder holds the test cases for **Docker**. ## Additional Docs + Due to the nature of the naming of files, we have `2` subfolders in this directory. + - `good` is for working, and correct **Dockerfile**(s) - `bad` is for invalid, and incorrect **Dockerfile**(s) ## Good Test Cases + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/editorconfig-checker/README.md b/.automation/test/editorconfig-checker/README.md index 650f9932..d091c16e 100644 --- a/.automation/test/editorconfig-checker/README.md +++ b/.automation/test/editorconfig-checker/README.md @@ -1,13 +1,19 @@ # EDITORCONFIG_CHECKER Test Cases + This folder holds the test cases for **EDITORCONFIG_CHECKER**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/env/README.md b/.automation/test/env/README.md index d2ef659d..2aa92dc1 100644 --- a/.automation/test/env/README.md +++ b/.automation/test/env/README.md @@ -1,13 +1,19 @@ # ENV Test Cases + This folder holds the test cases for **ENV**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/golang/README.md b/.automation/test/golang/README.md index a8e7db24..159cb548 100644 --- a/.automation/test/golang/README.md +++ b/.automation/test/golang/README.md @@ -1,13 +1,19 @@ # Golang Test Cases -This folder holds the test cases for **Golang**. + +This folder holds the test cases for **Golang**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/html/README.md b/.automation/test/html/README.md index db11f6fc..1223d83b 100644 --- a/.automation/test/html/README.md +++ b/.automation/test/html/README.md @@ -1,13 +1,19 @@ # HTML Test Cases -This folder holds the test cases for **HTML**. + +This folder holds the test cases for **HTML**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. -- **Note:** They are linted utilizing the default linter rules. \ No newline at end of file + +- **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/javascript/README.md b/.automation/test/javascript/README.md index 262bf6e6..6917a7e1 100644 --- a/.automation/test/javascript/README.md +++ b/.automation/test/javascript/README.md @@ -1,13 +1,19 @@ # Javascript Test Cases -This folder holds the test cases for **Javascript**. + +This folder holds the test cases for **Javascript**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/json/README.md b/.automation/test/json/README.md index 8c2acadd..27069412 100644 --- a/.automation/test/json/README.md +++ b/.automation/test/json/README.md @@ -1,13 +1,19 @@ # Json Test Cases -This folder holds the test cases for **Json**. + +This folder holds the test cases for **Json**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/kotlin/README.md b/.automation/test/kotlin/README.md index f1fd9cfe..bec051a8 100644 --- a/.automation/test/kotlin/README.md +++ b/.automation/test/kotlin/README.md @@ -1,13 +1,19 @@ # Kotlin Test Cases -This folder holds the test cases for **Kotlin**. + +This folder holds the test cases for **Kotlin**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/markdown/README.md b/.automation/test/markdown/README.md index bdb2577a..b46cbf13 100644 --- a/.automation/test/markdown/README.md +++ b/.automation/test/markdown/README.md @@ -1,13 +1,19 @@ # Markdown Test Cases -This folder holds the test cases for **Markdown**. + +This folder holds the test cases for **Markdown**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/openapi/README.md b/.automation/test/openapi/README.md index 6f5d2c24..353663e7 100644 --- a/.automation/test/openapi/README.md +++ b/.automation/test/openapi/README.md @@ -1,14 +1,20 @@ # OpenAPI Test Cases -This folder holds the test cases for **OpenAPI**. + +This folder holds the test cases for **OpenAPI**. ## Additional Docs + The `_bad_` tests are valid `.yml`/`.json` but invalid OpenAPI specs. The test extensions used are `.ymlopenapi`/`.jsonopenapi` instead of `.yml`/`.json`. This is to prevent the [YAML] and [JSON] tests from picking them up. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/perl/README.md b/.automation/test/perl/README.md index 8122ba0b..0b5539df 100644 --- a/.automation/test/perl/README.md +++ b/.automation/test/perl/README.md @@ -1,13 +1,19 @@ # Perl Test Cases -This folder holds the test cases for **Perl**. + +This folder holds the test cases for **Perl**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/php/README.md b/.automation/test/php/README.md index 7ab89f43..e1156daf 100644 --- a/.automation/test/php/README.md +++ b/.automation/test/php/README.md @@ -1,13 +1,19 @@ # PHP Test Cases -This folder holds the test cases for **PHP**. + +This folder holds the test cases for **PHP**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/powershell/README.md b/.automation/test/powershell/README.md index 5a778c98..008b7b71 100644 --- a/.automation/test/powershell/README.md +++ b/.automation/test/powershell/README.md @@ -1,13 +1,19 @@ # PowerShell Test Cases -This folder holds the test cases for **PowerShell**. + +This folder holds the test cases for **PowerShell**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/python/README.md b/.automation/test/python/README.md index 13fbb6fa..aa9bb375 100644 --- a/.automation/test/python/README.md +++ b/.automation/test/python/README.md @@ -1,13 +1,19 @@ # Python Test Cases -This folder holds the test cases for **Python**. + +This folder holds the test cases for **Python**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/raku/README.md b/.automation/test/raku/README.md index 9e654ca1..812e8bbd 100644 --- a/.automation/test/raku/README.md +++ b/.automation/test/raku/README.md @@ -1,13 +1,19 @@ # Raku Test Cases -This folder holds the test cases for **Raku**. + +This folder holds the test cases for **Raku**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/ruby/README.md b/.automation/test/ruby/README.md index 9d921c9a..03b03125 100644 --- a/.automation/test/ruby/README.md +++ b/.automation/test/ruby/README.md @@ -1,13 +1,19 @@ # Ruby Test Cases -This folder holds the test cases for **Ruby**. + +This folder holds the test cases for **Ruby**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/shell/README.md b/.automation/test/shell/README.md index 1ca64290..a2e8300f 100644 --- a/.automation/test/shell/README.md +++ b/.automation/test/shell/README.md @@ -1,13 +1,19 @@ # Bash Test Cases -This folder holds the test cases for **Bash**. + +This folder holds the test cases for **Bash**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/typescript/README.md b/.automation/test/typescript/README.md index 78ea5efc..19cd7a3d 100644 --- a/.automation/test/typescript/README.md +++ b/.automation/test/typescript/README.md @@ -1,13 +1,19 @@ # Typescript Test Cases -This folder holds the test cases for **Typescript**. + +This folder holds the test cases for **Typescript**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/xml/README.md b/.automation/test/xml/README.md index a40d0728..6719e960 100644 --- a/.automation/test/xml/README.md +++ b/.automation/test/xml/README.md @@ -1,13 +1,19 @@ # XML Test Cases -This folder holds the test cases for **XML**. + +This folder holds the test cases for **XML**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/yml/README.md b/.automation/test/yml/README.md index 59c9ccd1..8016e848 100644 --- a/.automation/test/yml/README.md +++ b/.automation/test/yml/README.md @@ -1,13 +1,19 @@ # Yml Test Cases -This folder holds the test cases for **Yml**. + +This folder holds the test cases for **Yml**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 75057d9f..daa78051 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,10 +1,10 @@ # Devcontainer + This file specifies to vscode how to run the container For format details, see [documentation](https://aka.ms/vscode-remote/devcontainer.json) or this file's [README](https://github.com/microsoft/vscode-dev-containers/tree/v0.123.0/containers/docker-existing-dockerfile) - context: Sets the run context to one level up instead of the .devcontainer folder. dockerFile: Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. -settings: Set *default* container specific settings.json values on container create. -extensions: Add the IDs of extensions you want installed when the container is created. \ No newline at end of file +settings: Set _default_ container specific settings.json values on container create. +extensions: Add the IDs of extensions you want installed when the container is created. diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d8a0e759..e7b98517 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,11 +1,14 @@ # Contributing + :wave: Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. ## Submitting a pull request + [Pull Requests][pulls] are used for adding new playbooks, roles, and documents to the repository, or editing the existing ones. **With write access** + 1. Clone the repository (only if you have write access) 1. Create a new branch: `git checkout -b my-branch-name` 1. Make your change @@ -13,6 +16,7 @@ We're thrilled that you'd like to contribute to this project. Your help is essen 1. Pat yourself on the back and wait for your pull request to be reviewed and merged. **Without write access** + 1. [Fork][fork] and clone the repository 1. Create a new branch: `git checkout -b my-branch-name` 1. Make your change @@ -30,16 +34,20 @@ Draft pull requests are also welcome to get feedback early on, or if there is so - Open a pull request ### CI/CT/CD -The **Super-Linter** has *CI/CT/CD* configured utilizing **GitHub** Actions. + +The **Super-Linter** has _CI/CT/CD_ configured utilizing **GitHub** Actions. + - When a branch is created and code is pushed, a **GitHub** Action is triggered for building the new **Docker** container with the new codebase -- The **Docker** container is then ran against the *test cases* to validate all code sanity +- The **Docker** container is then ran against the _test cases_ to validate all code sanity - `.automation/test` contains all test cases for each language that should be validated - These **GitHub** Actions utilize the Checks API and Protected Branches to help follow the SDLC - When the Pull Request is merged to master, the **Super-Linter** **Docker** container is then updated and deployed with the new codebase - **Note:** The branch's **Docker** container is also removed from **DockerHub** to cleanup after itself ## Releasing + If you are the current maintainer of this action: + 1. If a major version number change: Update `README.md` and the wiki to reflect new version number in the example workflow file sections 2. Draft [Releases](https://help.github.com/en/github/administering-a-repository/managing-releases-in-a-repository) are created automatically. They just need to be checked over for accuracy before making it official. 3. Ensure you check the box for [publishing to the marketplace](https://help.github.com/en/actions/creating-actions/publishing-actions-in-github-marketplace#publishing-an-action) @@ -48,6 +56,7 @@ If you are the current maintainer of this action: 6. Look for approval from [CODEOWNERS](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners) ## Resources + - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) - [GitHub Help](https://help.github.com) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 160740ee..6243c15e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,6 +12,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' diff --git a/.github/pull_request-template.md b/.github/pull_request-template.md index b6470eb3..3b5d6e5e 100644 --- a/.github/pull_request-template.md +++ b/.github/pull_request-template.md @@ -1,16 +1,20 @@ + Fixes # + + ## Proposed Changes -- -- +## - + - ## Readiness Checklist + - [ ] Label as `breaking` if this is a large fundamental change - [ ] Label as either `automation`, `bug`, `documentation`, `enhancement`, `infrastructure`, or `performance` diff --git a/README.md b/README.md index 9ad35000..1b159155 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # Super-Linter + This repository is for the **GitHub Action** to run a **Super-Linter**. It is a simple combination of various linters, written in `bash`, to help validate your source code. The end goal of this tool: + - Prevent broken code from being uploaded to the default branch (Usually `master`) - Help establish coding best practices across multiple languages - Build guidelines for code layout and format @@ -10,15 +12,24 @@ The end goal of this tool: ## Table of Contents -- [How it works](#how-it-works) -- [Supported linters](#supported-linters) -- [Usage](#how-to-use) -- [Environment variables](#environment-variables) -- [Disable rules](#disabling-rules) -- [Docker Hub](#docker-hub) -- [Run Super-Linter outside GitHub Actions](#run-super-linter-outside-github-actions) -- [Limitations](#limitations) -- [Contributing](#how-to-contribute) +- [Super-Linter](#super-linter) + - [Table of Contents](#table-of-contents) + - [How it Works](#how-it-works) + - [Supported Linters](#supported-linters) + - [How to use](#how-to-use) + - [Example connecting GitHub Action Workflow](#example-connecting-github-action-workflow) + - [Environment variables](#environment-variables) + - [Template rules files](#template-rules-files) + - [Disabling rules](#disabling-rules) + - [Docker Hub](#docker-hub) + - [Run Super-Linter outside GitHub Actions](#run-super-linter-outside-github-actions) + - [Local (troubleshooting/debugging/enhancements)](#local-troubleshootingdebuggingenhancements) + - [Azure](#azure) + - [GitLab](#gitlab) + - [Visual Studio Code](#visual-studio-code) + - [Limitations](#limitations) + - [How to contribute](#how-to-contribute) + - [License](#license) ## How it Works @@ -30,52 +41,55 @@ The design of the **Super-Linter** is currently to allow linting to occur in **G Developers on **GitHub** can call the **GitHub Action** to lint their code base with the following list of linters: -| *Language* | *Linter* | -| --- | --- | -| **Ansible** | [ansible-lint](https://github.com/ansible/ansible-lint) | -| **Azure Resource Manager (ARM)** | [arm-ttk](https://github.com/azure/arm-ttk) | -| **AWS CloudFormation templates** | [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint/) | -| **CSS** | [stylelint](https://stylelint.io/) | -| **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) | -| **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) | -| **Dart** | [dartanalyzer](https://dart.dev/guides/language/analysis-options) | -| **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) | -| **EDITORCONFIG** | [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) | -| **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | -| **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) | -| **HTMLHint** | [HTMLHint](https://github.com/htmlhint/HTMLHint) | -| **JavaScript** | [eslint](https://eslint.org/) [standard js](https://standardjs.com/) | -| **JSON** | [jsonlint](https://github.com/zaach/jsonlint) | -| **Kotlin** | [ktlint](https://github.com/pinterest/ktlint) | -| **Markdown** | [markdownlint](https://github.com/igorshubovych/markdownlint-cli#readme) | -| **OpenAPI** | [spectral](https://github.com/stoplightio/spectral) | -| **Perl** | [perl](https://pkgs.alpinelinux.org/package/edge/main/x86/perl) | -| **PHP** | [PHP](https://www.php.net/) | -| **PowerShell** | [PSScriptAnalyzer](https://github.com/PowerShell/Psscriptanalyzer) | -| **Protocol Buffers** | [protolint](https://github.com/yoheimuta/protolint) | -| **Python3** | [pylint](https://www.pylint.org/) | -| **Raku** | [raku](https://raku.org) | -| **Ruby** | [RuboCop](https://github.com/rubocop-hq/rubocop) | -| **Shell** | [Shellcheck](https://github.com/koalaman/shellcheck) | -| **Terraform** | [tflint](https://github.com/terraform-linters/tflint) | -| **TypeScript** | [eslint](https://eslint.org/) [standard js](https://standardjs.com/) | -| **XML** | [LibXML](http://xmlsoft.org/) | -| **YAML** | [YamlLint](https://github.com/adrienverge/yamllint) | +| _Language_ | _Linter_ | +| -------------------------------- | ------------------------------------------------------------------------------------ | +| **Ansible** | [ansible-lint](https://github.com/ansible/ansible-lint) | +| **Azure Resource Manager (ARM)** | [arm-ttk](https://github.com/azure/arm-ttk) | +| **AWS CloudFormation templates** | [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint/) | +| **CSS** | [stylelint](https://stylelint.io/) | +| **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) | +| **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) | +| **Dart** | [dartanalyzer](https://dart.dev/guides/language/analysis-options) | +| **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) | +| **EDITORCONFIG** | [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) | +| **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | +| **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) | +| **HTMLHint** | [HTMLHint](https://github.com/htmlhint/HTMLHint) | +| **JavaScript** | [eslint](https://eslint.org/) [standard js](https://standardjs.com/) | +| **JSON** | [jsonlint](https://github.com/zaach/jsonlint) | +| **Kotlin** | [ktlint](https://github.com/pinterest/ktlint) | +| **Markdown** | [markdownlint](https://github.com/igorshubovych/markdownlint-cli#readme) | +| **OpenAPI** | [spectral](https://github.com/stoplightio/spectral) | +| **Perl** | [perl](https://pkgs.alpinelinux.org/package/edge/main/x86/perl) | +| **PHP** | [PHP](https://www.php.net/) | +| **PowerShell** | [PSScriptAnalyzer](https://github.com/PowerShell/Psscriptanalyzer) | +| **Protocol Buffers** | [protolint](https://github.com/yoheimuta/protolint) | +| **Python3** | [pylint](https://www.pylint.org/) | +| **Raku** | [raku](https://raku.org) | +| **Ruby** | [RuboCop](https://github.com/rubocop-hq/rubocop) | +| **Shell** | [Shellcheck](https://github.com/koalaman/shellcheck) | +| **Terraform** | [tflint](https://github.com/terraform-linters/tflint) | +| **TypeScript** | [eslint](https://eslint.org/) [standard js](https://standardjs.com/) | +| **XML** | [LibXML](http://xmlsoft.org/) | +| **YAML** | [YamlLint](https://github.com/adrienverge/yamllint) | ## How to use + More in-depth [tutorial](https://www.youtube.com/watch?v=EDAmFKO4Zt0&t=118s) available To use this **GitHub** Action you will need to complete the following: + 1. Create a new file in your repository called `.github/workflows/linter.yml` 2. Copy the example workflow from below into that new file, no extra configuration required 3. Commit that file to a new branch 4. Open up a pull request and observe the action working -5. Enjoy your more *stable*, and *cleaner* code base +5. Enjoy your more _stable_, and _cleaner_ code base 6. Check out the [Wiki](https://github.com/github/super-linter/wiki) for customization options -**NOTE:** You will need the *Environment* variable `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` set in your workflow file to be able to use the multiple status API returns. There is no need to set the **GitHub** Secret, it only needs to be passed. +**NOTE:** You will need the _Environment_ variable `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` set in your workflow file to be able to use the multiple status API returns. There is no need to set the **GitHub** Secret, it only needs to be passed. ### Example connecting GitHub Action Workflow + In your repository you should have a `.github/workflows` folder with **GitHub** Action similar to below: - `.github/workflows/linter.yml` @@ -135,112 +149,124 @@ jobs: VALIDATE_ALL_CODEBASE: false DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -... ``` **NOTE:** -Using the line:`uses: docker://github/super-linter:v3` will pull the image down from **DockerHub** and run the **GitHub Super-Linter**. Using the line: `uses: github/super-linter@v3` will build and compile the **GitHub Super-Linter** at build time. *This can be far more costly in time...* +Using the line:`uses: docker://github/super-linter:v3` will pull the image down from **DockerHub** and run the **GitHub Super-Linter**. Using the line: `uses: github/super-linter@v3` will build and compile the **GitHub Super-Linter** at build time. _This can be far more costly in time..._ ## Environment variables + The super-linter allows you to pass the following `ENV` variables to be able to trigger different functionality. -*Note:* All the `VALIDATE_[LANGUAGE]` variables behave in a specific way. +_Note:_ All the `VALIDATE_[LANGUAGE]` variables behave in a specific way. If none of them are passed, then they all default to true. However if any one of the variables are set, we default to leaving any unset variable to false. This means that if you run the linter "out of the box", all languages will be checked. But if you wish to select specific linters, we give you full control to choose which linters are run, and won't run anything unexpected. -| **ENV VAR** | **Default Value** | **Notes** | -| --- | --- | --- | -| **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_RULES_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. | -| **VALIDATE_MD** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_BASH** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_PERL** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_RAKU** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_PHP** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_PYTHON** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_RUBY** | `true` | Flag to enable or disable the linting process of the language. | -| **RUBY_CONFIG_FILE** | `.ruby-lint.yml` | Filename for [rubocop configuration](https://docs.rubocop.org/rubocop/configuration.html) (ex: `.ruby-lint.yml`, `.rubocop.yml`)| -| **VALIDATE_COFFEE** | `true` | Flag to enable or disable the linting process of the language . | -| **VALIDATE_ANSIBLE** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_JAVASCRIPT_ES** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: eslint) | -| **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`)| -| **VALIDATE_JAVASCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: standard) | -| **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: eslint) | -| **VALIDATE_TSX** | `true` | Flag to enable or disable the linting process for tsx files (Utilizing: eslint) | -| **VALIDATE_TYPESCRIPT_ES** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: eslint) | -| **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`)| -| **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: standard) | -| **VALIDATE_DOCKER** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_GO** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_POWERSHELL** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_ARM** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_TERRAFORM** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_HTML** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_OPENAPI** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_CLOUDFORMATION** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_PROTOBUF** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_EDITORCONFIG** | `true` | Flag to enable or disable the linting process with the editorconfig. | -| **ANSIBLE_DIRECTORY** | `/ansible` | Flag to set the root directory for Ansible file location(s). | -| **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | -| **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | -| **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | -| **OUTPUT_FORMAT** | `none` | The report format to be generated, besides the stdout one. Output format of tap is currently using v13 of the specification. Supported formats: tap | -| **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. Output folder must not previously exist. | -| **OUTPUT_DETAILS** | `simpler` | What level of details to be reported. Supported formats: simpler or detailed. | -| **MULTI_STATUS** | `true` | A status API is made for each language that is linted to make visual parsing easier. | +| **ENV VAR** | **Default Value** | **Notes** | +| -------------------------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **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_RULES_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. | +| **VALIDATE_MD** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_BASH** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_PERL** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_RAKU** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_PHP** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_PYTHON** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_RUBY** | `true` | Flag to enable or disable the linting process of the language. | +| **RUBY_CONFIG_FILE** | `.ruby-lint.yml` | Filename for [rubocop configuration](https://docs.rubocop.org/rubocop/configuration.html) (ex: `.ruby-lint.yml`, `.rubocop.yml`) | +| **VALIDATE_COFFEE** | `true` | Flag to enable or disable the linting process of the language . | +| **VALIDATE_ANSIBLE** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_JAVASCRIPT_ES** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: eslint) | +| **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) | +| **VALIDATE_JAVASCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: standard) | +| **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: eslint) | +| **VALIDATE_TSX** | `true` | Flag to enable or disable the linting process for tsx files (Utilizing: eslint) | +| **VALIDATE_TYPESCRIPT_ES** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: eslint) | +| **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`) | +| **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: standard) | +| **VALIDATE_DOCKER** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_GO** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_POWERSHELL** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_ARM** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_TERRAFORM** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_HTML** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_OPENAPI** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_CLOUDFORMATION** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_PROTOBUF** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_EDITORCONFIG** | `true` | Flag to enable or disable the linting process with the editorconfig. | +| **ANSIBLE_DIRECTORY** | `/ansible` | Flag to set the root directory for Ansible file location(s). | +| **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | +| **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | +| **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | +| **OUTPUT_FORMAT** | `none` | The report format to be generated, besides the stdout one. Output format of tap is currently using v13 of the specification. Supported formats: tap | +| **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. Output folder must not previously exist. | +| **OUTPUT_DETAILS** | `simpler` | What level of details to be reported. Supported formats: simpler or detailed. | +| **MULTI_STATUS** | `true` | A status API is made for each language that is linted to make visual parsing easier. | ### Template rules files -You can use the **GitHub** **Super-Linter** *with* or *without* your own personal rules sets. This allows for greater flexibility for each individual code base. The Template rules all try to follow the standards we believe should be enabled at the basic level. + +You can use the **GitHub** **Super-Linter** _with_ or _without_ your own personal rules sets. This allows for greater flexibility for each individual code base. The Template rules all try to follow the standards we believe should be enabled at the basic level. + - Copy **any** or **all** template rules files from `TEMPLATES/` into your repository in the location: `.github/linters/` of your repository - If your repository does not have rules files, they will fall back to defaults in [this repository's `TEMPLATE` folder](https://github.com/github/super-linter/tree/master/TEMPLATES) ## Disabling rules -If you need to disable certain *rules* and *functionality*, you can view [Disable Rules](https://github.com/github/super-linter/blob/master/docs/disabling-linters.md) + +If you need to disable certain _rules_ and _functionality_, you can view [Disable Rules](https://github.com/github/super-linter/blob/master/docs/disabling-linters.md) ## Docker Hub + The **Docker** container that is built from this repository is located at `https://hub.docker.com/r/github/super-linter` ## Run Super-Linter outside GitHub Actions + ### Local (troubleshooting/debugging/enhancements) + If you find that you need to run super-linter locally, you can follow the documentation at [Running super-linter locally](https://github.com/github/super-linter/blob/master/docs/run-linter-locally.md) Check out the [note](#how-it-works) in **How it Works** to understand more about the **Super-Linter** linting locally versus via continuous integration. ### Azure + Check out this [article](http://blog.tyang.org/2020/06/27/use-github-super-linter-in-azure-pipelines/) ### GitLab + Check out this [snippet](https://gitlab.com/snippets/1988376) ### Visual Studio Code + You can checkout this repository using [Container Remote Development](https://code.visualstudio.com/docs/remote/containers), and debug the linter using the `Test Linter` task. ![Example](https://user-images.githubusercontent.com/15258962/85165778-2d2ce700-b21b-11ea-803e-3f6709d8e609.gif) We will also support [Github Codespaces](https://github.com/features/codespaces/) once it becomes available ## Limitations + Below are a list of the known limitations for the **GitHub Super-Linter**: + - Due to being completely packaged at run time, you will not be able to update dependencies or change versions of the enclosed linters and binaries - Additional details from `package.json` are not read by the **GitHub Super-Linter** - Downloading additional codebases as dependencies from private repositories will fail due to lack of permissions ## How to contribute + If you would like to help contribute to this **GitHub** Action, please see [CONTRIBUTING](https://github.com/github/super-linter/blob/master/.github/CONTRIBUTING.md) --------------------------------------------------------------------------------- +--- ### License + - [MIT License](https://github.com/github/super-linter/blob/master/LICENSE) diff --git a/TEMPLATES/README.md b/TEMPLATES/README.md index c1ed7152..791b2c05 100644 --- a/TEMPLATES/README.md +++ b/TEMPLATES/README.md @@ -1,6 +1,6 @@ # TEMPLATES -The files in this folder are template rules for the linters that will run against your code base. If you chose to copy these to your local repository in the directory: `.github/` they will be used at runtime. If they are not present, they will be used by default in the linter run. +The files in this folder are template rules for the linters that will run against your code base. If you chose to copy these to your local repository in the directory: `.github/` they will be used at runtime. If they are not present, they will be used by default in the linter run. -The file(s) will be parsed at run time on the local branch to load all rules needed to run the **Super-Linter** **GitHub** Action. +The file(s) will be parsed at run time on the local branch to load all rules needed to run the **Super-Linter** **GitHub** Action. The **GitHub** Action will inform the user via the **Checks API** on the status and success of the process. diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index 5620860d..f7b58802 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -1,4 +1,5 @@ # Disabling linters and Rules + Linters can often require additional configuration to ensure they work with your codebase and your team's coding style, to avoid flagging false-positives. The **GitHub Super-Linter** has set up some default configurations for each linter which should work reasonably well with common code bases, but many of the linters can be configured to disable certain rules or configure the rules to ignore certain pieces of codes. To run with your own configuration for a linter, copy the relevant [`TEMPLATE` configuration file for the linter you are using from this repo](https://github.com/github/super-linter/tree/master/TEMPLATES) into the `.github/linters` folder in your own repository, and then edit it to modify, disable - or even add - rules and configuration to suit how you want your code checked. @@ -7,11 +8,12 @@ How the changes are made differ for each linter, and also how much the **Github Where a configuration file exists in your repo, it will be used in preference to the default one in the **GitHub Super-Linter** `TEMPLATES` directory (not in addition to it), and where one doesn't exist the `TEMPLATES` version will be used. So you should copy the complete configuration file you require to change from the `TEMPLATES` directory and not just the lines of config you want to change. -It is possible to have custom configurations for some linters, and continue to use the default from `TEMPLATES` directory for others, so if you use `Python` and `JavaScript` and only need to tweak the `Python` rules, then you only need to have a custom configuration for *pylint* and continue to use the default `TEMPLATE` from the main repo for *ESLint*, for example. +It is possible to have custom configurations for some linters, and continue to use the default from `TEMPLATES` directory for others, so if you use `Python` and `JavaScript` and only need to tweak the `Python` rules, then you only need to have a custom configuration for _pylint_ and continue to use the default `TEMPLATE` from the main repo for _ESLint_, for example. For some linters it is also possible to override rules on a case by case level with directives in your code. Where this is possible we try to note how to do this in the specific linter sections below, but the official linter documentation will likely give more detail on this. ## Table of Linters + - [Ruby](#ruby) - [Shell](#shell) - [Ansible](#ansible) @@ -42,23 +44,27 @@ For some linters it is also possible to override rules on a case by case level w --------------------------------------------------------------------------------- +--- ## Ruby + - [RuboCop](https://github.com/rubocop-hq/rubocop) ### RuboCop Config file + - `.github/linters/.ruby-lint.yml` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.ruby-lint.yml` - **Note:** We use the Default **GitHub** Rule set from [RuboCop-GitHub](https://github.com/github/rubocop-github) ### RuboCop disable single line + ```ruby method(argument) # rubocop:disable SomeRule, SomeOtherRule ``` ### RuboCop disable code block + ```ruby # rubocop:disable This is a long line @@ -67,6 +73,7 @@ var="this is some other stuff" ``` ### RuboCop disable entire file + If you need to ignore an entire file, you can update the `.github/linters/.ruby-lint.yml` to ignore certain files and locations ```yml @@ -85,27 +92,31 @@ AllCops: TargetRubyVersion: 2.5.1 EnabledByDefault: true Exclude: - - 'db/**/*' - - 'config/**/*' - - 'script/**/*' - - 'bin/{rails,rake}' + - "db/**/*" + - "config/**/*" + - "script/**/*" + - "bin/{rails,rake}" - !ruby/regexp /old_and_unused\.rb$/ ``` --------------------------------------------------------------------------------- +--- ## Shell + - [Shellcheck](https://github.com/koalaman/shellcheck) ### Shellcheck Config file -- There is no top level *configuration file* available at this time + +- There is no top level _configuration file_ available at this time ### Shellcheck disable single line + ```bash echo "Terrible stuff" # shellcheck disable=SC2059,SC2086 ``` ### Shellcheck disable code block + ```bash # shellcheck disable=SC2059,SC2086 echo "some hot garbage" @@ -113,7 +124,9 @@ echo "More garbage code" ``` ### Shellcheck disable entire file + - **Note:** The disable must be on the second line of the code right after the shebang + ```bash #!/bin/sh # shellcheck disable=SC2059,SC1084 @@ -122,63 +135,76 @@ echo "stuff" moreThings() ``` --------------------------------------------------------------------------------- +--- ## Ansible + - [ansible-lint](https://github.com/ansible/ansible-lint) ### Ansible-lint Config file + - `.github/linters/.ansible-lint.yml` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.ansible-lint.yml` ### Ansible-lint disable single line + ```yml - name: this would typically fire GitHasVersionRule 401 and BecomeUserWithoutBecomeRule 501 - become_user: alice # noqa 401 501 + become_user: alice # noqa 401 501 git: src=/path/to/git/repo dest=checkout ``` + ### Ansible-lint disable code block + ```yml - name: this would typically fire GitHasVersionRule 401 git: src=/path/to/git/repo dest=checkout tags: - - skip_ansible_lint + - skip_ansible_lint ``` ### Ansible-lint disable entire file + ```yml - name: this would typically fire GitHasVersionRule 401 git: src=/path/to/git/repo dest=checkout tags: - - skip_ansible_lint + - skip_ansible_lint ``` --------------------------------------------------------------------------------- + +--- ## YAML + - [YamlLint](https://github.com/adrienverge/yamllint) ### Yamllint Config file + - `.github/linters/.yaml-lint.yml` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.yaml-lint.yml` ### Yamllint disable single line + ```yml -This line is waaaaaaaaaay too long # yamllint disable-line +This line is waaaaaaaaaay too long # yamllint disable-line ``` ### Yamllint disable code block + ```yml # yamllint disable rule:colons -- Key : value - dolor : sit, - foo : bar +- Key: value + dolor: sit, + foo: bar # yamllint enable ``` ### Yamllint disable entire file + If you need to ignore an entire file, you can update the `.github/linters/.yaml-lint.yml` to ignore certain files and locations + ```yml # For all rules ignore: | @@ -197,22 +223,26 @@ rules: /ascii-art/* ``` --------------------------------------------------------------------------------- +--- ## Python3 + - [pylint](https://www.pylint.org/) ### Pylint Config file + - `.github/linters/.python-lint` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.python-lint` ### Pylint disable single line + ```python global VAR # pylint: disable=global-statement ``` ### Pylint disable code block + ```python """pylint option block-disable""" @@ -243,6 +273,7 @@ class Foo(object): ``` ### Pylint disable entire file + ```python #!/bin/python3 # pylint: skip-file @@ -250,21 +281,26 @@ class Foo(object): var = "terrible code down here..." ``` --------------------------------------------------------------------------------- +--- ## AWS CloudFormation templates + - [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint/) ### cfn-lint Config file + - `.github/linters/.cfnlintrc.yml` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.cfnlintrc.yml` ### cfn-lint disable single line + - There is currently **No** way to disable rules inline of the file(s) ### cfn-lint disable code block + You can disable both [template](https://github.com/aws-cloudformation/cfn-python-lint/#template-based-metadata) or [resource](https://github.com/aws-cloudformation/cfn-python-lint/#resource-based-metadata) via [metadata](https://github.com/aws-cloudformation/cfn-python-lint/#metadata): + ```yaml Resources: myInstance: @@ -273,149 +309,196 @@ Resources: cfn-lint: config: ignore_checks: - - E3030 + - E3030 Properties: InstanceType: nt.x4superlarge ImageId: ami-abc1234 ``` ### cfn-lint disable entire file + If you need to ignore an entire file, you can update the `.github/linters/.cfnlintrc.yml` to ignore certain files and locations + ```yaml ignore_templates: -- codebuild.yaml + - codebuild.yaml ``` --------------------------------------------------------------------------------- +--- ## JSON + - [jsonlint](https://github.com/zaach/jsonlint) ### JsonLint Config file -- There is no top level *configuration file* available at this time + +- There is no top level _configuration file_ available at this time ### JsonLint disable single line + - There is currently **No** way to disable rules inline of the file(s) ### JsonLint disable code block + - There is currently **No** way to disable rules inline of the file(s) ### JsonLint disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## Markdown + - [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli#readme) - [markdownlint rule documentation](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md) - [markdownlint inline comment syntax](https://github.com/DavidAnson/markdownlint#configuration) ### markdownlint Config file + - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.markdown-lint.yml` ### markdownlint disable single line + ```markdown ## Here is some document + Here is some random data + + any violation you want + + Here is more data ``` + ### markdownlint disable code block + ```markdown ## Here is some document + Here is some random data + + any violations you want + + Here is more data ``` ### markdownlint disable entire file -- You can encapsulate the entire file with the *code block format* to disable an entire file from being parsed --------------------------------------------------------------------------------- +- You can encapsulate the entire file with the _code block format_ to disable an entire file from being parsed + +--- ## Perl + - [perl](https://pkgs.alpinelinux.org/package/edge/main/x86/perl) ### Perl Config file -- There is no top level *configuration file* available at this time + +- There is no top level _configuration file_ available at this time ### Perl disable single line + - There is currently **No** way to disable rules inline of the file(s) ### Perl disable code block + - There is currently **No** way to disable rules inline of the file(s) ### Perl disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## Raku + - [raku](https://raku.org) ### Raku Config file -- There is no top level *configuration file* available at this time + +- There is no top level _configuration file_ available at this time ### Raku disable single line + - There is currently **No** way to disable rules inline of the file(s) ### Raku disable code block + - There is currently **No** way to disable rules inline of the file(s) ### Raku disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- +--- + +--- ## PHP + - [PHP](https://www.php.net/) ### PHP Config file -- There is no top level *configuration file* available at this time + +- There is no top level _configuration file_ available at this time ### PHP disable single line + - There is currently **No** way to disable rules inline of the file(s) ### PHP disable code block + - There is currently **No** way to disable rules inline of the file(s) ### PHP disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## XML + - [XML](http://xmlsoft.org/) ### LibXML Config file -- There is no top level *configuration file* available at this time + +- There is no top level _configuration file_ available at this time ### LibXML disable single line + - There is currently **No** way to disable rules inline of the file(s) ### LibXML disable code block + - There is currently **No** way to disable rules inline of the file(s) ### LibXML disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## Coffeescript + - [coffeelint](https://coffeelint.github.io/) ### coffeelint Config file + - `.github/linters/.coffee-lint.yml` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.coffee.yml` ### coffeelint disable single line + ```Coffeescript # coffeelint: disable=max_line_length foo = "some/huge/line/string/with/embed/#{values}.that/surpasses/the/max/column/width" @@ -423,6 +506,7 @@ foo = "some/huge/line/string/with/embed/#{values}.that/surpasses/the/max/column/ ``` ### coffeelint disable code block + ```Coffeescript # coffeelint: disable foo = "some/huge/line/string/with/embed/#{values}.that/surpasses/the/max/column/width" @@ -433,181 +517,223 @@ taz = "some/huge/line/string/with/embed/#{values}.that/surpasses/the/max/column/ ``` ### coffeelint disable entire file -- You can encapsulate the entire file with the *code block format* to disable an entire file from being parsed --------------------------------------------------------------------------------- +- You can encapsulate the entire file with the _code block format_ to disable an entire file from being parsed + +--- ## Javascript eslint + - [eslint](https://eslint.org/) ### Javascript eslint Config file + - `.github/linters/.eslintrc.yml` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.eslintrc.yml` ### Javascript eslint disable single line + ```javascript var thing = new Thing(); // eslint-disable-line no-use-before-define thing.sayHello(); function Thing() { - - this.sayHello = function() { console.log("hello"); }; - + this.sayHello = function () { + console.log("hello"); + }; } ``` ### Javascript eslint disable code block + ```javascript /*eslint-disable */ //suppress all warnings between comments -alert('foo') +alert("foo"); /*eslint-enable */ ``` + ### Javascript eslint disable entire file + - Place at the top of the file: + ```javascript /* eslint-disable */ ``` --------------------------------------------------------------------------------- +--- ## Javascript standard + - [standard js](https://standardjs.com/) ### Javascript standard Config file -- There is no top level *configuration file* available at this time + +- There is no top level _configuration file_ available at this time ### Javascript standard disable single line + - There is currently **No** way to disable rules inline of the file(s) ### Javascript standard disable code block + - There is currently **No** way to disable rules inline of the file(s) ### Javascript standard disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## Typescript eslint + - [eslint](https://eslint.org/) ### Typescript eslint Config file + - `.github/linters/.eslintrc.yml` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.eslintrc.yml` ### Typescript eslint disable single line + ```typescript var thing = new Thing(); // eslint-disable-line no-use-before-define thing.sayHello(); function Thing() { - - this.sayHello = function() { console.log("hello"); }; - + this.sayHello = function () { + console.log("hello"); + }; } ``` ### Typescript eslint disable code block + ```typescript /*eslint-disable */ //suppress all warnings between comments -alert('foo') +alert("foo"); /*eslint-enable */ ``` + ### Typescript eslint disable entire file + ```typescript /* eslint-disable */ ``` --------------------------------------------------------------------------------- +--- ## Typescript standard + - [standardjs](https://standardjs.com/) ### Typescript standard Config file -- There is no top level *configuration file* available at this time + +- There is no top level _configuration file_ available at this time ### Typescript standard disable single line + - There is currently **No** way to disable rules inline of the file(s) ### Typescript standard disable code block + - There is currently **No** way to disable rules inline of the file(s) ### Typescript standard disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## Golang + - [golangci-lint](https://github.com/golangci/golangci-lint) ### golangci-lint standard Config file + - `.github/linters/.golangci.yml` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.golangci.yml` ### golangci-lint disable single line + - There is currently **No** way to disable rules inline of the file(s) ### golangci-lint disable code block + - There is currently **No** way to disable rules inline of the file(s) ### golangci-lint disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## Dockerfile + - [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) ### Dockerfilelint standard Config file + - `.github/linters/.dockerfilelintrc` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.dockerfilelintrc` ### Dockerfilelint disable single line + - There is currently **No** way to disable rules inline of the file(s) ### Dockerfilelint disable code block + - There is currently **No** way to disable rules inline of the file(s) ### Dockerfilelint disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## Terraform + - [tflint](https://github.com/terraform-linters/tflint) ### tflint standard Config file + - `.github/linters/.tflint.hcl` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.tflint.hcl` ### tflint disable single line + - There is currently **No** way to disable rules inline of the file(s) ### tflint disable code block + - There is currently **No** way to disable rules inline of the file(s) ### tflint disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## CSS + - [stylelint](https://stylelint.io/) ### stylelint standard Config file + - `.github/linters/.stylelintrc.json` ### stylelint disable single line + ```css #id { /* stylelint-disable-next-line declaration-no-important */ @@ -616,56 +742,69 @@ alert('foo') ``` ### stylelint disable code block + ```css /* stylelint-disable */ -a {} +a { +} /* stylelint-enable */ ``` ### stylelint disable entire file + - You can disable entire files with the `ignoreFiles` property in `.stylelintrc.json` + ```json { "ignoreFiles": [ "styles/ignored/wildcards/*.css", "styles/ignored/specific-file.css" - ] + ] } ``` --------------------------------------------------------------------------------- +--- ## ENV + - [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) ### dotenv-linter Config file -- There is no top level *configuration file* available at this time + +- There is no top level _configuration file_ available at this time ### dotenv-linter disable single line + ```env # Comment line will be ignored ``` ### dotenv-linter disable code block + - There is currently **No** way to disable rules inline of the file(s) ### dotenv-linter disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## Kotlin + - [ktlint](https://github.com/pinterest/ktlint) ### ktlint Config file -- There is no top level *configuration file* available at this time + +- There is no top level _configuration file_ available at this time ### ktlint disable single line + ```kotlin import package.* // ktlint-disable no-wildcard-imports ``` ### ktlint disable code block + ```kotlin /* ktlint-disable no-wildcard-imports */ import package.a.* @@ -674,59 +813,72 @@ import package.b.* ``` ### ktlint disable entire file + - There is currently **No** way to disable rules inline of the file(s) --------------------------------------------------------------------------------- +--- ## Dart + - [dartanalyzer](https://dart.dev/tools/dartanalyzer) ### dartanalyzer standard Config file + - `.github/linters/.dart-lint.yml` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.dart-lint.yml` ### dartanalyzer disable single line + ```dart int x = ''; // ignore: invalid_assignment ``` ### dartanalyzer disable code block + - You can make [rule exceptions](https://dart.dev/guides/language/analysis-options#excluding-code-from-analysis) for the entire file. + ```dart // ignore_for_file: unused_import, unused_local_variable ``` ### dartanalyzer disable entire file + - You can disable entire files with the `analyzer.exclude` property in `.dart-lint.yml` + ```dart analyzer: exclude: - file ``` --------------------------------------------------------------------------------- +--- ## OpenAPI + - [spectral](https://github.com/stoplightio/spectral) ### OpenAPI Config file + - `.github/linters/.openapirc.yml` - You can add, extend, and disable rules - Documentation at [Spectral Custom Rulesets](https://stoplight.io/p/docs/gh/stoplightio/spectral/docs/guides/4-custom-rulesets.md) - File should be located at: `.github/linters/.openapirc.yml` ### OpenAPI disable single line + - There is currently **No** way to disable rules inline of the file(s) ### OpenAPI disable code block + - There is currently **No** way to disable rules inline of the file(s) ### OpenAPI disable entire file + - There is currently **No** way to disable rules inline of the file(s) - However, you can make [rule exceptions](https://stoplight.io/p/docs/gh/stoplightio/spectral/docs/guides/6-exceptions.md?srn=gh/stoplightio/spectral/docs/guides/6-exceptions.md) in the config for individual file(s). --------------------------------------------------------------------------------- +--- ## Protocol Buffers @@ -776,20 +928,25 @@ lint: ``` ## Clojure + - [clj-kondo](https://github.com/borkdude/clj-kondo) - Since clj-kondo approaches static analysis in a very Clojure way, it is advised to read the [configuration docs](https://github.com/borkdude/clj-kondo/blob/master/doc/config.md) ### clj-kondo standard Config file + - `.github/linters/.clj-kondo/config.edn` ### clj-kondo disable single line + - There is currently **No** way to disable rules in a single line ### clj-kondo disable code block + - There is currently **No** way to disable rules in a code block ### clj-kondo disable entire file -```clojure + +````clojure {:output {:exclude-files ["path/to/file"]}} ## EDITORCONFIG-CHECKER @@ -805,37 +962,44 @@ lint: - ```js // editorconfig-checker-disable-line -``` +```` ### editorconfig-checker disable code block + - There is currently **No** way to disable rules inline of the file(s) ### editorconfig-checker disable entire file + - + ```js // editorconfig-checker-disable-file ``` + - You can disable entire files with the `Exclude` property in `.ecrc` + ```json { - "Exclude": [ - "path/to/file", - "^regular\\/expression\\.ext$" - ] + "Exclude": ["path/to/file", "^regular\\/expression\\.ext$"] } ``` ## HTML + - [htmlhint](https://htmlhint.com/) ### htmlhint standard Config file + - `.github/linters/.htmlhintrc` ### htmlhint disable single line + - There is currently **No** way to disable rules in a single line ### htmlhint disable code block + - There is currently **No** way to disable rules in a code block ### htmlhint disable entire file + - There is currently **No** way to disable rules in an entire file diff --git a/docs/run-linter-locally.md b/docs/run-linter-locally.md index c28418b4..33b5d565 100644 --- a/docs/run-linter-locally.md +++ b/docs/run-linter-locally.md @@ -1,5 +1,7 @@ # Run Super-Linter locally to test your branch of code + If you want to test locally against the **Super-Linter** to test your branch of code, you will need to complete the following: + - Clone your testing source code to your local environment - Install Docker to your local environment - Pull the container down @@ -7,15 +9,19 @@ If you want to test locally against the **Super-Linter** to test your branch of - Debug/Troubleshoot ## Install Docker to your local machine + You can follow the link below on how to install and configure **Docker** on your local machine + - [Docker Install Documentation](https://docs.docker.com/install/) ## Download the latest Super-Linter Docker container + - Pull the latest **Docker** container down from **DockerHub** - `docker pull github/super-linter:latest` -Once the container has been downloaded to your local environment, you can then begin the process, or running the container against your codebase. + Once the container has been downloaded to your local environment, you can then begin the process, or running the container against your codebase. ## Run the container Locally + - You can run the container locally with the following **Base** flags to run your code: - `docker run -e RUN_LOCAL=true -v /path/to/local/codebase:/tmp/lint github/super-linter` - To run against a single file you can use: `docker run -e RUN_LOCAL=true -v /path/to/local/codebase/file:/tmp/lint/file github/super-linter` @@ -24,14 +30,18 @@ Once the container has been downloaded to your local environment, you can then b - **NOTE:** The flag:`RUN_LOCAL` will set: `VALIDATE_ALL_CODEBASE` to true. This means it will scan **all** the files in the directory you have mapped. If you want to only validate a subset of your codebase, map a folder with only the files you wish to have linted ### Flags for running Locally + You can add as many **Additional** flags as needed, documented in [README.md](../README.md#Environment-variables) ## Troubleshooting ### Run container and gain access to the command line + If you need to run the container locally and gain access to its command line, you can run the following command: + - `docker run -it --entrypoint /bin/bash github/super-linter` - This will drop you in the command line of the docker container for any testing or troubleshooting that may be needed. ### Found issues -If you find a *bug* or *issue*, please open a **GitHub** issue at: `https://github.com/github/super-linter/issues` + +If you find a _bug_ or _issue_, please open a **GitHub** issue at: `https://github.com/github/super-linter/issues` diff --git a/lib/README.md b/lib/README.md index 500e2142..76496541 100644 --- a/lib/README.md +++ b/lib/README.md @@ -1,10 +1,13 @@ # Super-Linter Library ## Main script + The file `linter.sh` is the main script that is called for the process and loads all other scripts as functions. ## Functions + The additional files in the folder are functions to help streamline the main build process and allow for easier maintenance. + - `possum.sh` - Official mascot of the **Super-Linter** - `buildFileList.sh` From 1cfe0d5679208fc719b6c972e441b10ed3d1e9a9 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 21 Jul 2020 12:08:50 -0500 Subject: [PATCH 77/96] yaml adjustments --- .github/workflows/deploy-DEV.yml | 6 +++--- .github/workflows/stack-linter.yml | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-DEV.yml b/.github/workflows/deploy-DEV.yml index 010d395e..7b524a22 100644 --- a/.github/workflows/deploy-DEV.yml +++ b/.github/workflows/deploy-DEV.yml @@ -18,9 +18,9 @@ ############################# on: push: - branches-ignore: - - 'master' - pull_request: [] + branches-ignore: [master] + pull_request: + branches-ignore: [] ############### # Set the Job # diff --git a/.github/workflows/stack-linter.yml b/.github/workflows/stack-linter.yml index d301d0c4..8337c088 100644 --- a/.github/workflows/stack-linter.yml +++ b/.github/workflows/stack-linter.yml @@ -15,8 +15,9 @@ ############################# on: push: - branches: master - pull_request: [] + branches: [master] + pull_request: + branches-ignore: [] ############### # Set the Job # From 9451e491c4907b18cc234205c9b5c6e7ccd65e75 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 21 Jul 2020 12:09:07 -0500 Subject: [PATCH 78/96] Variable braces --- .automation/cleanup-docker.sh | 58 +-- .../templates/ghe-config-apply.sh | 42 +- .automation/test/shell/shell_good_1.sh | 4 +- .automation/upload-docker.sh | 164 +++---- .vscode/testlinter.sh | 6 +- Dockerfile | 2 +- TEMPLATES/.powershell-psscriptanalyzer.psd1 | 4 +- lib/buildFileList.sh | 172 +++---- lib/linter.sh | 442 +++++++++--------- lib/validation.sh | 282 +++++------ lib/worker.sh | 276 +++++------ 11 files changed, 726 insertions(+), 726 deletions(-) diff --git a/.automation/cleanup-docker.sh b/.automation/cleanup-docker.sh index ab0bb546..889c4d65 100755 --- a/.automation/cleanup-docker.sh +++ b/.automation/cleanup-docker.sh @@ -51,25 +51,25 @@ ValidateInput() { ############################ # Validate GITHUB_WORKSPACE # ############################ - if [ -z "$GITHUB_WORKSPACE" ]; then + if [ -z "${GITHUB_WORKSPACE}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_WORKSPACE]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_WORKSPACE]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GITHUB_WORKSPACE}]${NC}" exit 1 else - echo "Successfully found:[GITHUB_WORKSPACE], value:[$GITHUB_WORKSPACE]" + echo "Successfully found:[GITHUB_WORKSPACE], value:[${GITHUB_WORKSPACE}]" fi ####################### # Validate IMAGE_REPO # ####################### - if [ -z "$IMAGE_REPO" ]; then + if [ -z "${IMAGE_REPO}" ]; then # No repo was pulled echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [IMAGE_REPO]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$IMAGE_REPO]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${IMAGE_REPO}]${NC}" exit 1 - elif [[ $IMAGE_REPO == "github/super-linter" ]]; then + elif [[ ${IMAGE_REPO} == "github/super-linter" ]]; then # Found our main repo - echo "Successfully found:[IMAGE_REPO], value:[$IMAGE_REPO]" + echo "Successfully found:[IMAGE_REPO], value:[${IMAGE_REPO}]" else # This is a fork and we cant pull vars or any info echo -e "${NC}${F[Y]}WARN!${NC} No image to cleanup as this is a forked branch, and not being built with current automation!${NC}" @@ -79,31 +79,31 @@ ValidateInput() { ########################## # Validate IMAGE_VERSION # ########################## - if [ -z "$IMAGE_VERSION" ]; then + if [ -z "${IMAGE_VERSION}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [IMAGE_VERSION]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$IMAGE_VERSION]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${IMAGE_VERSION}]${NC}" exit 1 else - echo "Successfully found:[IMAGE_VERSION], value:[$IMAGE_VERSION]" + echo "Successfully found:[IMAGE_VERSION], value:[${IMAGE_VERSION}]" fi ############################ # Validate DOCKER_USERNAME # ############################ - if [ -z "$DOCKER_USERNAME" ]; then + if [ -z "${DOCKER_USERNAME}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [DOCKER_USERNAME]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$DOCKER_USERNAME]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${DOCKER_USERNAME}]${NC}" exit 1 else - echo "Successfully found:[DOCKER_USERNAME], value:[$DOCKER_USERNAME]" + echo "Successfully found:[DOCKER_USERNAME], value:[${DOCKER_USERNAME}]" fi ############################ # Validate DOCKER_PASSWORD # ############################ - if [ -z "$DOCKER_PASSWORD" ]; then + if [ -z "${DOCKER_PASSWORD}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [DOCKER_PASSWORD]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$DOCKER_PASSWORD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${DOCKER_PASSWORD}]${NC}" exit 1 else echo "Successfully found:[DOCKER_PASSWORD], value:[********]" @@ -112,11 +112,11 @@ ValidateInput() { ################################################## # Check if we need to get the name of the branch # ################################################## - if [[ $IMAGE_VERSION != "latest" ]]; then + if [[ ${IMAGE_VERSION} != "latest" ]]; then ################################## # Remove non alpha-numeric chars # ################################## - IMAGE_VERSION=$(echo "$IMAGE_VERSION" | tr -cd '[:alnum:]') + IMAGE_VERSION=$(echo "${IMAGE_VERSION}" | tr -cd '[:alnum:]') else ############################################# # Image is 'latest' and we will not destroy # @@ -142,7 +142,7 @@ LoginToDocker() { ###################### # Login to DockerHub # ###################### - LOGIN_CMD=$(docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD" 2>&1) + LOGIN_CMD=$(docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" 2>&1) ####################### # Load the error code # @@ -152,10 +152,10 @@ LoginToDocker() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # ERROR echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to authenticate to DockerHub!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$LOGIN_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LOGIN_CMD}]${NC}" exit 1 else # SUCCESS @@ -170,7 +170,7 @@ RemoveImage() { ################ echo "" echo "----------------------------------------------" - echo "Removing the DockerFile image:[$IMAGE_REPO:$IMAGE_VERSION]" + echo "Removing the DockerFile image:[${IMAGE_REPO}:${IMAGE_VERSION}]" echo "----------------------------------------------" echo "" @@ -180,7 +180,7 @@ RemoveImage() { TOKEN=$(curl -s -k \ -H "Content-Type: application/json" \ -X POST \ - -d "{\"username\": \"$DOCKER_USERNAME\", \"password\": \"$DOCKER_PASSWORD\"}" \ + -d "{\"username\": \"${DOCKER_USERNAME}\", \"password\": \"${DOCKER_PASSWORD}\"}" \ "https://hub.docker.com/v2/users/login/" | jq -r .token 2>&1) ####################### @@ -191,10 +191,10 @@ RemoveImage() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # ERROR echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to gain token from DockerHub!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$TOKEN]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${TOKEN}]${NC}" exit 1 else # SUCCESS @@ -204,9 +204,9 @@ RemoveImage() { ################################# # Remove the tag from DockerHub # ################################# - REMOVE_CMD=$(curl "https://hub.docker.com/v2/repositories/$IMAGE_REPO/tags/$IMAGE_VERSION/" \ + REMOVE_CMD=$(curl "https://hub.docker.com/v2/repositories/${IMAGE_REPO}/tags/${IMAGE_VERSION}/" \ -X DELETE \ - -H "Authorization: JWT $TOKEN" 2>&1) + -H "Authorization: JWT ${TOKEN}" 2>&1) ####################### # Load the ERROR_CODE # @@ -216,14 +216,14 @@ RemoveImage() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # ERROR echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to remove tag from DockerHub!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$REMOVE_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${REMOVE_CMD}]${NC}" exit 1 else # SUCCESS - echo "Successfully [removed] Docker image tag:[$IMAGE_VERSION] from DockerHub!" + echo "Successfully [removed] Docker image tag:[${IMAGE_VERSION}] from DockerHub!" fi } ################################################################################ diff --git a/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh b/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh index 0fe1e1e0..2d4b0eec 100644 --- a/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh +++ b/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh @@ -26,23 +26,23 @@ CheckGHEPid() ################################## # Check to prevent infinite loop # ################################## - if [ $PID_CHECK -gt $PID_CHECK_LIMIT ]; then + if [ ${PID_CHECK} -gt ${PID_CHECK_LIMIT} ]; then # Over the limit, move on - echo "We have checked the pid $PID_CHECK times, moving on..." + echo "We have checked the pid ${PID_CHECK} times, moving on..." else ################################################ # Check to see if the PID is alive and running # ################################################ - if [ ! -f "$GHE_CONFIG_PID" ]; then + if [ ! -f "${GHE_CONFIG_PID}" ]; then # File not found - echo "We're good to move forward, no .pid file found at:[$GHE_CONFIG_PID]" + echo "We're good to move forward, no .pid file found at:[${GHE_CONFIG_PID}]" else # Found the pid running, need to sleep - echo "Current PID found, sleeping $SLEEP_SECONDS seconds before next check..." + echo "Current PID found, sleeping ${SLEEP_SECONDS} seconds before next check..." ################ # Sleep it off # ################ - SLEEP_CMD=$(sleep $SLEEP_SECONDS 2>&1) + SLEEP_CMD=$(sleep ${SLEEP_SECONDS} 2>&1) ####################### # Load the error code # @@ -52,9 +52,9 @@ CheckGHEPid() ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to sleep!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$SLEEP_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${SLEEP_CMD}]${NC}" echo "Will try to call apply as last effort..." #################################### # Call config apply as last effort # @@ -80,14 +80,14 @@ CheckGHEProcess() ################################## # Check to prevent infinite loop # ################################## - if [ $PROCESS_CHECK -gt $PROCESS_CHECK_LIMIT ]; then + if [ ${PROCESS_CHECK} -gt ${PROCESS_CHECK_LIMIT} ]; then # Over the limit, move on - echo "We have checked the process $PROCESS_CHECK times, moving on..." + echo "We have checked the process ${PROCESS_CHECK} times, moving on..." else #################################################### # Check to see if the process is alive and running # #################################################### - CHECK_PROCESS_CMD=$(pgrep -f "$GHE_APPLY_COMMAND" 2>&1) + CHECK_PROCESS_CMD=$(pgrep -f "${GHE_APPLY_COMMAND}" 2>&1) ####################### # Load the error code # @@ -97,16 +97,16 @@ CheckGHEProcess() ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # No process running on the system - echo "Were good to move forward, no process like:[$GHE_APPLY_COMMAND] running currently on the system" + echo "Were good to move forward, no process like:[${GHE_APPLY_COMMAND}] running currently on the system" else # Found the process running, need to sleep - echo "Current process alive:[$CHECK_PROCESS_CMD], sleeping $SLEEP_SECONDS seconds before next check..." + echo "Current process alive:[${CHECK_PROCESS_CMD}], sleeping ${SLEEP_SECONDS} seconds before next check..." ################ # Sleep it off # ################ - SLEEP_CMD=$(sleep $SLEEP_SECONDS 2>&1) + SLEEP_CMD=$(sleep ${SLEEP_SECONDS} 2>&1) ####################### # Load the error code # @@ -116,9 +116,9 @@ CheckGHEProcess() ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to sleep!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$SLEEP_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${SLEEP_CMD}]${NC}" echo "Will try to call apply as last effort..." #################################### # Call config apply as last effort # @@ -144,7 +144,7 @@ RunConfigApply() ########## # Header # ########## - echo "Running $GHE_APPLY_COMMAND to the server..." + echo "Running ${GHE_APPLY_COMMAND} to the server..." ############################################## # Run the command to apply changes to server # @@ -159,14 +159,14 @@ RunConfigApply() ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # Errors echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to run config apply command!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$APPLY_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${APPLY_CMD}]${NC}" exit 1 else # Success - echo -e "${NC}${F[B]}Successfully ran ${F[C]}$GHE_APPLY_COMMAND${NC}" + echo -e "${NC}${F[B]}Successfully ran ${F[C]}${GHE_APPLY_COMMAND}${NC}" fi } ################################################################################ diff --git a/.automation/test/shell/shell_good_1.sh b/.automation/test/shell/shell_good_1.sh index 9a1f5bc5..ee5435e5 100644 --- a/.automation/test/shell/shell_good_1.sh +++ b/.automation/test/shell/shell_good_1.sh @@ -7,11 +7,11 @@ HELLO_WORLD=$(echo "Hello World" | cut -f1 -d' ' 2>&1) ERROR_CODE=$? # Check the shell -if [ $ERROR_CODE -ne 0 ]; then +if [ ${ERROR_CODE} -ne 0 ]; then echo "We did it!" exit 0 else echo "We done goofed it..." - echo "$HELLO_WORLD" + echo "${HELLO_WORLD}" exit 1 fi diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index 321b7f1d..42ea1c65 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -37,7 +37,7 @@ UPDATE_MAJOR_TAG=0 # Flag to deploy the major tag version as Header() { echo "" echo "-------------------------------------------------------" - echo "---- GitHub Actions Upload image to [$REGISTRY] ----" + echo "---- GitHub Actions Upload image to [${REGISTRY}] ----" echo "-------------------------------------------------------" echo "" } @@ -57,46 +57,46 @@ ValidateInput() { ############################# # Validate GITHUB_WORKSPACE # ############################# - if [ -z "$GITHUB_WORKSPACE" ]; then + if [ -z "${GITHUB_WORKSPACE}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_WORKSPACE]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_WORKSPACE]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GITHUB_WORKSPACE}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_WORKSPACE]${F[B]}, value:${F[W]}[$GITHUB_WORKSPACE]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_WORKSPACE]${F[B]}, value:${F[W]}[${GITHUB_WORKSPACE}]${NC}" fi ##################### # Validate REGISTRY # ##################### - if [ -z "$REGISTRY" ]; then + if [ -z "${REGISTRY}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [REGISTRY]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$REGISTRY]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${REGISTRY}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[REGISTRY]${F[B]}, value:${F[W]}[$REGISTRY]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[REGISTRY]${F[B]}, value:${F[W]}[${REGISTRY}]${NC}" fi ##################################################### # See if we need values for GitHub package Registry # ##################################################### - if [[ $REGISTRY == "GPR" ]]; then + if [[ ${REGISTRY} == "GPR" ]]; then ######################### # Validate GPR_USERNAME # ######################### - if [ -z "$GPR_USERNAME" ]; then + if [ -z "${GPR_USERNAME}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GPR_USERNAME]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GPR_USERNAME]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GPR_USERNAME}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[GPR_USERNAME]${F[B]}, value:${F[W]}[$GPR_USERNAME]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GPR_USERNAME]${F[B]}, value:${F[W]}[${GPR_USERNAME}]${NC}" fi ###################### # Validate GPR_TOKEN # ###################### - if [ -z "$GPR_TOKEN" ]; then + if [ -z "${GPR_TOKEN}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GPR_TOKEN]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GPR_TOKEN]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GPR_TOKEN}]${NC}" exit 1 else echo -e "${NC}${F[B]}Successfully found:${F[W]}[GPR_TOKEN]${F[B]}, value:${F[W]}[********]${NC}" @@ -104,24 +104,24 @@ ValidateInput() { ######################################## # See if we need values for Ducker hub # ######################################## - elif [[ $REGISTRY == "Docker" ]]; then + elif [[ ${REGISTRY} == "Docker" ]]; then ############################ # Validate DOCKER_USERNAME # ############################ - if [ -z "$DOCKER_USERNAME" ]; then + if [ -z "${DOCKER_USERNAME}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [DOCKER_USERNAME]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$DOCKER_USERNAME]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${DOCKER_USERNAME}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[DOCKER_USERNAME]${F[B]}, value:${F[W]}[$DOCKER_USERNAME]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[DOCKER_USERNAME]${F[B]}, value:${F[W]}[${DOCKER_USERNAME}]${NC}" fi ############################ # Validate DOCKER_PASSWORD # ############################ - if [ -z "$DOCKER_PASSWORD" ]; then + if [ -z "${DOCKER_PASSWORD}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [DOCKER_PASSWORD]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$DOCKER_PASSWORD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${DOCKER_PASSWORD}]${NC}" exit 1 else echo -e "${NC}${F[B]}Successfully found:${F[W]}[DOCKER_PASSWORD]${F[B]}, value:${F[B]}[********]${NC}" @@ -131,39 +131,39 @@ ValidateInput() { ########################################### else echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to find a valid registry!${NC}" - echo "Registry:[$REGISTRY]" + echo "Registry:[${REGISTRY}]" exit 1 fi ####################### # Validate IMAGE_REPO # ####################### - if [ -z "$IMAGE_REPO" ]; then + if [ -z "${IMAGE_REPO}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [IMAGE_REPO]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$IMAGE_REPO]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${IMAGE_REPO}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[IMAGE_REPO]${F[B]}, value:${F[W]}[$IMAGE_REPO]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[IMAGE_REPO]${F[B]}, value:${F[W]}[${IMAGE_REPO}]${NC}" ############################################### # Need to see if GPR registry and update name # ############################################### - if [[ $REGISTRY == "GPR" ]]; then - NAME="docker.pkg.github.com/$IMAGE_REPO/super-linter" - IMAGE_REPO="$NAME" - echo "Updated [IMAGE_REPO] to:[$IMAGE_REPO] for GPR" + if [[ ${REGISTRY} == "GPR" ]]; then + NAME="docker.pkg.github.com/${IMAGE_REPO}/super-linter" + IMAGE_REPO="${NAME}" + echo "Updated [IMAGE_REPO] to:[${IMAGE_REPO}] for GPR" fi fi ########################## # Validate IMAGE_VERSION # ########################## - if [ -z "$IMAGE_VERSION" ]; then + if [ -z "${IMAGE_VERSION}" ]; then echo -e "${NC}${F[Y]}WARN!${NC} Failed to get [IMAGE_VERSION]!${NC}" echo "Pulling from Branch Name..." ############################## # Get the name of the branch # ############################## - BRANCH_NAME=$(git -C "$GITHUB_WORKSPACE" branch --contains "$GITHUB_SHA" | awk '{print $2}' 2>&1) + BRANCH_NAME=$(git -C "${GITHUB_WORKSPACE}" branch --contains "${GITHUB_SHA}" | awk '{print ${2}}' 2>&1) ####################### # Load the error code # @@ -173,24 +173,24 @@ ValidateInput() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get branch name!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$BRANCH_NAME]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${BRANCH_NAME}]${NC}" exit 1 fi ################################## # Remove non alpha-numeric chars # ################################## - BRANCH_NAME=$(echo "$BRANCH_NAME" | tr -cd '[:alnum:]') + BRANCH_NAME=$(echo "${BRANCH_NAME}" | tr -cd '[:alnum:]') ############################################ # Set the IMAGE_VERSION to the BRANCH_NAME # ############################################ - IMAGE_VERSION="$BRANCH_NAME" - echo "Tag:[$IMAGE_VERSION]" + IMAGE_VERSION="${BRANCH_NAME}" + echo "Tag:[${IMAGE_VERSION}]" else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[IMAGE_VERSION]${F[B]}, value:${F[W]}[$IMAGE_VERSION]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[IMAGE_VERSION]${F[B]}, value:${F[W]}[${IMAGE_VERSION}]${NC}" fi ################################## @@ -201,31 +201,31 @@ ValidateInput() { ###################################################################### # Check if this is a latest to a versioned release at create new tag # ###################################################################### - if [[ $IMAGE_VERSION =~ $REGEX ]]; then + if [[ ${IMAGE_VERSION} =~ ${REGEX} ]]; then # Need to get the major version, and set flag to update ##################### # Set the major tag # ##################### - MAJOR_TAG=$(echo "$IMAGE_VERSION" | cut -d '.' -f1) + MAJOR_TAG=$(echo "${IMAGE_VERSION}" | cut -d '.' -f1) ################################### # Set flag for updating major tag # ################################### UPDATE_MAJOR_TAG=1 - echo "- Also deploying a major tag of:[$MAJOR_TAG]" + echo "- Also deploying a major tag of:[${MAJOR_TAG}]" fi ############################ # Validate DOCKERFILE_PATH # ############################ - if [ -z "$DOCKERFILE_PATH" ]; then + if [ -z "${DOCKERFILE_PATH}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [DOCKERFILE_PATH]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$DOCKERFILE_PATH]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${DOCKERFILE_PATH}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[DOCKERFILE_PATH]${F[B]}, value:${F[W]}[$DOCKERFILE_PATH]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[DOCKERFILE_PATH]${F[B]}, value:${F[W]}[${DOCKERFILE_PATH}]${NC}" fi } ################################################################################ @@ -234,24 +234,24 @@ Authenticate() { ################ # Pull in Vars # ################ - USERNAME="$1" # Name to auth with - PASSWORD="$2" # Password to auth with - URL="$3" # Url to auth towards - NAME="$4" # name of the service + USERNAME="${1}" # Name to auth with + PASSWORD="${2}" # Password to auth with + URL="${3}" # Url to auth towards + NAME="${4}" # name of the service ################ # Print header # ################ echo "" echo "----------------------------------------------" - echo "Login to $NAME..." + echo "Login to ${NAME}..." echo "----------------------------------------------" echo "" ################### # Auth to service # ################### - LOGIN_CMD=$(docker login "$URL" --username "$USERNAME" --password "$PASSWORD" 2>&1) + LOGIN_CMD=$(docker login "${URL}" --username "${USERNAME}" --password "${PASSWORD}" 2>&1) ####################### # Load the error code # @@ -261,14 +261,14 @@ Authenticate() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # ERROR - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to authenticate to $NAME!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$LOGIN_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to authenticate to ${NAME}!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LOGIN_CMD}]${NC}" exit 1 else # SUCCESS - echo -e "${NC}${F[B]}Successfully authenticated to ${F[C]}$NAME${F[B]}!${NC}" + echo -e "${NC}${F[B]}Successfully authenticated to ${F[C]}${NAME}${F[B]}!${NC}" fi } ################################################################################ @@ -286,9 +286,9 @@ BuildImage() { ################################ # Validate the DOCKERFILE_PATH # ################################ - if [ ! -f "$DOCKERFILE_PATH" ]; then + if [ ! -f "${DOCKERFILE_PATH}" ]; then # No file found - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} failed to find Dockerfile at:[$DOCKERFILE_PATH]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} failed to find Dockerfile at:[${DOCKERFILE_PATH}]${NC}" echo "Please make sure you give full path!" echo "Example:[/configs/Dockerfile] or [Dockerfile] if at root directory" exit 1 @@ -297,7 +297,7 @@ BuildImage() { ################### # Build the image # ################### - docker build --no-cache -t "$IMAGE_REPO:$IMAGE_VERSION" -f "$DOCKERFILE_PATH" . 2>&1 + docker build --no-cache -t "${IMAGE_REPO}:${IMAGE_VERSION}" -f "${DOCKERFILE_PATH}" . 2>&1 ####################### # Load the error code # @@ -307,7 +307,7 @@ BuildImage() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # ERROR echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} failed to [build] Dockerfile!${NC}" exit 1 @@ -319,9 +319,9 @@ BuildImage() { ######################################################## # Need to see if we need to tag a major update as well # ######################################################## - if [ $UPDATE_MAJOR_TAG -eq 1 ]; then + if [ ${UPDATE_MAJOR_TAG} -eq 1 ]; then # Tag the image with the major tag as well - docker build -t "$IMAGE_REPO:$MAJOR_TAG" -f "$DOCKERFILE_PATH" . 2>&1 + docker build -t "${IMAGE_REPO}:${MAJOR_TAG}" -f "${DOCKERFILE_PATH}" . 2>&1 ####################### # Load the error code # @@ -331,7 +331,7 @@ BuildImage() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # ERROR echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} failed to [tag] Dockerfile!${NC}" exit 1 @@ -349,14 +349,14 @@ UploadImage() { ################ echo "" echo "----------------------------------------------" - echo "Uploading the DockerFile image to $REGISTRY..." + echo "Uploading the DockerFile image to ${REGISTRY}..." echo "----------------------------------------------" echo "" ############################################ # Upload the docker image that was created # ############################################ - docker push "$IMAGE_REPO:$IMAGE_VERSION" 2>&1 + docker push "${IMAGE_REPO}:${IMAGE_VERSION}" 2>&1 ####################### # Load the error code # @@ -366,20 +366,20 @@ UploadImage() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # ERROR echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} failed to [upload] Dockerfile!${NC}" exit 1 else # SUCCESS - echo -e "${NC}${F[B]}Successfully Uploaded Docker image:${F[W]}[$IMAGE_VERSION]${F[B]} to ${F[C]}$REGISTRY${F[B]}!${NC}" + echo -e "${NC}${F[B]}Successfully Uploaded Docker image:${F[W]}[${IMAGE_VERSION}]${F[B]} to ${F[C]}${REGISTRY}${F[B]}!${NC}" fi ######################### # Get Image information # ######################### IFS=$'\n' # Set the delimit to newline - GET_INFO_CMD=$(docker images | grep "$IMAGE_REPO" | grep "$IMAGE_VERSION" 2>&1) + GET_INFO_CMD=$(docker images | grep "${IMAGE_REPO}" | grep "${IMAGE_VERSION}" 2>&1) ####################### # Load the error code # @@ -389,18 +389,18 @@ UploadImage() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # ERROR echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get information about built Image!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GET_INFO_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GET_INFO_CMD}]${NC}" exit 1 else ################ # Get the data # ################ - REPO=$(echo "$GET_INFO_CMD" | awk '{print $1}') - TAG=$(echo "$GET_INFO_CMD" | awk '{print $2}') - IMAGE_ID=$(echo "$GET_INFO_CMD" | awk '{print $3}') + REPO=$(echo "${GET_INFO_CMD}" | awk '{print ${1}}') + TAG=$(echo "${GET_INFO_CMD}" | awk '{print ${2}}') + IMAGE_ID=$(echo "${GET_INFO_CMD}" | awk '{print ${3}}') SIZE="${GET_INFO_CMD##* }" ################### @@ -408,21 +408,21 @@ UploadImage() { ################### echo "----------------------------------------------" echo "Docker Image Details:" - echo "Repository:[$REPO]" - echo "Tag:[$TAG]" - echo "Image_ID:[$IMAGE_ID]" - echo "Size:[$SIZE]" + echo "Repository:[${REPO}]" + echo "Tag:[${TAG}]" + echo "Image_ID:[${IMAGE_ID}]" + echo "Size:[${SIZE}]" echo "----------------------------------------------" fi ############################################################### # Check if we need to upload the major tagged version as well # ############################################################### - if [ $UPDATE_MAJOR_TAG -eq 1 ]; then + if [ ${UPDATE_MAJOR_TAG} -eq 1 ]; then ############################################ # Upload the docker image that was created # ############################################ - docker push "$IMAGE_REPO:$MAJOR_TAG" 2>&1 + docker push "${IMAGE_REPO}:${MAJOR_TAG}" 2>&1 ####################### # Load the error code # @@ -432,13 +432,13 @@ UploadImage() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # ERROR - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} failed to [upload] MAJOR_TAG:[$MAJOR_TAG] Dockerfile!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} failed to [upload] MAJOR_TAG:[${MAJOR_TAG}] Dockerfile!${NC}" exit 1 else # SUCCESS - echo -e "${NC}${F[B]}Successfully Uploaded TAG:${F[W]}[$MAJOR_TAG]${F[B]} of Docker image to ${F[C]}$REGISTRY${F[B]}!${NC}" + echo -e "${NC}${F[B]}Successfully Uploaded TAG:${F[W]}[${MAJOR_TAG}]${F[B]} of Docker image to ${F[C]}${REGISTRY}${F[B]}!${NC}" fi fi } @@ -473,23 +473,23 @@ BuildImage ###################### # Login to DockerHub # ###################### -if [[ $REGISTRY == "Docker" ]]; then +if [[ ${REGISTRY} == "Docker" ]]; then # Authenticate "Username" "Password" "Url" "Name" - Authenticate "$DOCKER_USERNAME" "$DOCKER_PASSWORD" "" "Dockerhub" + Authenticate "${DOCKER_USERNAME}" "${DOCKER_PASSWORD}" "" "Dockerhub" #################################### # Login to GitHub Package Registry # #################################### -elif [[ $REGISTRY == "GPR" ]]; then +elif [[ ${REGISTRY} == "GPR" ]]; then # Authenticate "Username" "Password" "Url" "Name" - Authenticate "$GPR_USERNAME" "$GPR_TOKEN" "https://docker.pkg.github.com" "GitHub Package Registry" + Authenticate "${GPR_USERNAME}" "${GPR_TOKEN}" "https://docker.pkg.github.com" "GitHub Package Registry" else ######### # ERROR # ######### echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Registry not set correctly!${NC}" - echo "Registry:[$REGISTRY]" + echo "Registry:[${REGISTRY}]" exit 1 fi diff --git a/.vscode/testlinter.sh b/.vscode/testlinter.sh index 50427028..5094c89e 100644 --- a/.vscode/testlinter.sh +++ b/.vscode/testlinter.sh @@ -12,9 +12,9 @@ CODE_PATH='/tmp/lint' # Path to code base ################## # Check the path # ################## -if [ ! -L $CODE_PATH ]; then +if [ ! -L ${CODE_PATH} ]; then # Create symbolic link - ln -s "$PWD"/.automation/test $CODE_PATH + ln -s "${PWD}"/.automation/test ${CODE_PATH} fi ######################### @@ -23,4 +23,4 @@ fi export RUN_LOCAL=true # shellcheck source=/dev/null -source "$PWD"/lib/linter.sh +source "${PWD}"/lib/linter.sh diff --git a/Dockerfile b/Dockerfile index 242e066c..c4e37c19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -126,7 +126,7 @@ ENV ARM_TTK_PSD1="${ARM_TTK_DIRECTORY}/arm-ttk-master/arm-ttk/arm-ttk.psd1" RUN curl -sLO "${ARM_TTK_URI}" \ && unzip "${ARM_TTK_NAME}" -d "${ARM_TTK_DIRECTORY}" \ && rm "${ARM_TTK_NAME}" \ - && ln -sTf "$ARM_TTK_PSD1" /usr/bin/arm-ttk + && ln -sTf "${ARM_TTK_PSD1}" /usr/bin/arm-ttk ###################### # Install shellcheck # diff --git a/TEMPLATES/.powershell-psscriptanalyzer.psd1 b/TEMPLATES/.powershell-psscriptanalyzer.psd1 index ab462662..f4bbd6b5 100644 --- a/TEMPLATES/.powershell-psscriptanalyzer.psd1 +++ b/TEMPLATES/.powershell-psscriptanalyzer.psd1 @@ -6,7 +6,7 @@ # 'Error' # 'Warning' #) - #IncludeDefaultRules=$true + #IncludeDefaultRules=${true} #ExcludeRules = @( # 'PSAvoidUsingWriteHost', # 'MyCustomRuleName' @@ -15,4 +15,4 @@ # 'PSAvoidUsingWriteHost', # 'MyCustomRuleName' #) -} \ No newline at end of file +} diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index 7e105d32..11462989 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -16,7 +16,7 @@ function BuildFileList() { ################ # print header # ################ - if [[ $ACTIONS_RUNNER_DEBUG == "true" ]]; then + if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then echo "" echo "----------------------------------------------" echo "Pulling in code history and branches..." @@ -26,8 +26,8 @@ function BuildFileList() { # Switch codebase back to the default branch to get a list of all files changed # ################################################################################# SWITCH_CMD=$( - git -C "$GITHUB_WORKSPACE" pull --quiet - git -C "$GITHUB_WORKSPACE" checkout "$DEFAULT_BRANCH" 2>&1 + git -C "${GITHUB_WORKSPACE}" pull --quiet + git -C "${GITHUB_WORKSPACE}" checkout "${DEFAULT_BRANCH}" 2>&1 ) ####################### @@ -38,26 +38,26 @@ function BuildFileList() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # Error - echo "Failed to switch to $DEFAULT_BRANCH branch to get files changed!" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$SWITCH_CMD]${NC}" + echo "Failed to switch to ${DEFAULT_BRANCH} branch to get files changed!" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${SWITCH_CMD}]${NC}" exit 1 fi ################ # print header # ################ - if [[ $ACTIONS_RUNNER_DEBUG == "true" ]]; then + if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then echo "" echo "----------------------------------------------" - echo "Generating Diff with:[git diff --name-only '$DEFAULT_BRANCH..$GITHUB_SHA' --diff-filter=d]" + echo "Generating Diff with:[git diff --name-only '${DEFAULT_BRANCH}..${GITHUB_SHA}' --diff-filter=d]" fi ################################################# # Get the Array of files changed in the commits # ################################################# - mapfile -t RAW_FILE_ARRAY < <(git -C "$GITHUB_WORKSPACE" diff --name-only "$DEFAULT_BRANCH..$GITHUB_SHA" --diff-filter=d 2>&1) + mapfile -t RAW_FILE_ARRAY < <(git -C "${GITHUB_WORKSPACE}" diff --name-only "${DEFAULT_BRANCH}..${GITHUB_SHA}" --diff-filter=d 2>&1) ####################### # Load the error code # @@ -67,7 +67,7 @@ function BuildFileList() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # Error echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to gain a list of all files changed!${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${RAW_FILE_ARRAY[*]}]${NC}" @@ -86,26 +86,26 @@ function BuildFileList() { ########################### # Extract just the file and extension, reverse it, cut off extension, # reverse it back, substitute to lowercase - FILE_TYPE=$(basename "$FILE" | rev | cut -f1 -d'.' | rev | awk '{print tolower($0)}') + FILE_TYPE=$(basename "${FILE}" | rev | cut -f1 -d'.' | rev | awk '{print tolower(${0})}') ############## # Print file # ############## - echo "File:[$FILE], File_type:[$FILE_TYPE]" + echo "File:[${FILE}], File_type:[${FILE_TYPE}]" ######### # DEBUG # ######### - #echo "FILE_TYPE:[$FILE_TYPE]" + #echo "FILE_TYPE:[${FILE_TYPE}]" ##################### # Get the CFN files # ##################### - if [ "$FILE_TYPE" == "yml" ] || [ "$FILE_TYPE" == "yaml" ]; then + if [ "${FILE_TYPE}" == "yml" ] || [ "${FILE_TYPE}" == "yaml" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_YML+=("$FILE") + FILE_ARRAY_YML+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -114,11 +114,11 @@ function BuildFileList() { ##################################### # Check if the file is CFN template # ##################################### - if DetectCloudFormationFile "$FILE"; then + if DetectCloudFormationFile "${FILE}"; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_CFN+=("$FILE") + FILE_ARRAY_CFN+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # @@ -128,37 +128,37 @@ function BuildFileList() { ###################### # Get the JSON files # ###################### - elif [ "$FILE_TYPE" == "json" ]; then + elif [ "${FILE_TYPE}" == "json" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_JSON+=("$FILE") + FILE_ARRAY_JSON+=("${FILE}") ############################ # Check if file is OpenAPI # ############################ - if DetectOpenAPIFile "$FILE"; then + if DetectOpenAPIFile "${FILE}"; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_OPENAPI+=("$FILE") + FILE_ARRAY_OPENAPI+=("${FILE}") fi ############################ # Check if file is ARM # ############################ - if DetectARMFile "$FILE"; then + if DetectARMFile "${FILE}"; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_ARM+=("$FILE") + FILE_ARRAY_ARM+=("${FILE}") fi ##################################### # Check if the file is CFN template # ##################################### - if DetectCloudFormationFile "$FILE"; then + if DetectCloudFormationFile "${FILE}"; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_CFN+=("$FILE") + FILE_ARRAY_CFN+=("${FILE}") fi ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # @@ -167,11 +167,11 @@ function BuildFileList() { ##################### # Get the XML files # ##################### - elif [ "$FILE_TYPE" == "xml" ]; then + elif [ "${FILE_TYPE}" == "xml" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_XML+=("$FILE") + FILE_ARRAY_XML+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -179,19 +179,19 @@ function BuildFileList() { ########################## # Get the MARKDOWN files # ########################## - elif [ "$FILE_TYPE" == "md" ]; then + elif [ "${FILE_TYPE}" == "md" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_MARKDOWN+=("$FILE") + FILE_ARRAY_MARKDOWN+=("${FILE}") ###################### # Get the BASH files # ###################### - elif [ "$FILE_TYPE" == "sh" ]; then + elif [ "${FILE_TYPE}" == "sh" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_BASH+=("$FILE") + FILE_ARRAY_BASH+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -199,11 +199,11 @@ function BuildFileList() { ###################### # Get the PERL files # ###################### - elif [ "$FILE_TYPE" == "pl" ]; then + elif [ "${FILE_TYPE}" == "pl" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_PERL+=("$FILE") + FILE_ARRAY_PERL+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -211,13 +211,13 @@ function BuildFileList() { ###################### # Get the RAKU files # ###################### - elif [ "$FILE_TYPE" == "raku" ] || [ "$FILE_TYPE" == "rakumod" ] \ - || [ "$FILE_TYPE" == "rakutest" ] || [ "$FILE_TYPE" == "pm6" ] \ - || [ "$FILE_TYPE" == "pl6" ] || [ "$FILE_TYPE" == "p6" ] ; then + elif [ "${FILE_TYPE}" == "raku" ] || [ "${FILE_TYPE}" == "rakumod" ] \ + || [ "${FILE_TYPE}" == "rakutest" ] || [ "${FILE_TYPE}" == "pm6" ] \ + || [ "${FILE_TYPE}" == "pl6" ] || [ "${FILE_TYPE}" == "p6" ] ; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_RAKU+=("$FILE") + FILE_ARRAY_RAKU+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -225,11 +225,11 @@ function BuildFileList() { ###################### # Get the PHP files # ###################### - elif [ "$FILE_TYPE" == "php" ]; then + elif [ "${FILE_TYPE}" == "php" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_PHP+=("$FILE") + FILE_ARRAY_PHP+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -237,11 +237,11 @@ function BuildFileList() { ###################### # Get the RUBY files # ###################### - elif [ "$FILE_TYPE" == "rb" ]; then + elif [ "${FILE_TYPE}" == "rb" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_RUBY+=("$FILE") + FILE_ARRAY_RUBY+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -249,11 +249,11 @@ function BuildFileList() { ######################## # Get the PYTHON files # ######################## - elif [ "$FILE_TYPE" == "py" ]; then + elif [ "${FILE_TYPE}" == "py" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_PYTHON+=("$FILE") + FILE_ARRAY_PYTHON+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -261,11 +261,11 @@ function BuildFileList() { ######################## # Get the COFFEE files # ######################## - elif [ "$FILE_TYPE" == "coffee" ]; then + elif [ "${FILE_TYPE}" == "coffee" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_COFFEESCRIPT+=("$FILE") + FILE_ARRAY_COFFEESCRIPT+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -273,12 +273,12 @@ function BuildFileList() { ############################ # Get the JavaScript files # ############################ - elif [ "$FILE_TYPE" == "js" ]; then + elif [ "${FILE_TYPE}" == "js" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_JAVASCRIPT_ES+=("$FILE") - FILE_ARRAY_JAVASCRIPT_STANDARD+=("$FILE") + FILE_ARRAY_JAVASCRIPT_ES+=("${FILE}") + FILE_ARRAY_JAVASCRIPT_STANDARD+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -286,11 +286,11 @@ function BuildFileList() { ############################ # Get the JSX files # ############################ - elif [ "$FILE_TYPE" == "jsx" ]; then + elif [ "${FILE_TYPE}" == "jsx" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_JSX+=("$FILE") + FILE_ARRAY_JSX+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -298,11 +298,11 @@ function BuildFileList() { ############################ # Get the TSX files # ############################ - elif [ "$FILE_TYPE" == "tsx" ]; then + elif [ "${FILE_TYPE}" == "tsx" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_TSX+=("$FILE") + FILE_ARRAY_TSX+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -313,12 +313,12 @@ function BuildFileList() { ############################ # Get the TypeScript files # ############################ - elif [ "$FILE_TYPE" == "ts" ]; then + elif [ "${FILE_TYPE}" == "ts" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_TYPESCRIPT_ES+=("$FILE") - FILE_ARRAY_TYPESCRIPT_STANDARD+=("$FILE") + FILE_ARRAY_TYPESCRIPT_ES+=("${FILE}") + FILE_ARRAY_TYPESCRIPT_STANDARD+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -326,11 +326,11 @@ function BuildFileList() { ######################## # Get the Golang files # ######################## - elif [ "$FILE_TYPE" == "go" ]; then + elif [ "${FILE_TYPE}" == "go" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_GO+=("$FILE") + FILE_ARRAY_GO+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -338,11 +338,11 @@ function BuildFileList() { ########################### # Get the Terraform files # ########################### - elif [ "$FILE_TYPE" == "tf" ]; then + elif [ "${FILE_TYPE}" == "tf" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_TERRAFORM+=("$FILE") + FILE_ARRAY_TERRAFORM+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -350,34 +350,34 @@ function BuildFileList() { ########################### # Get the Powershell files # ########################### - elif [ "$FILE_TYPE" == "ps1" ]; then + elif [ "${FILE_TYPE}" == "ps1" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_POWERSHELL+=("$FILE") - elif [ "$FILE_TYPE" == "css" ]; then + FILE_ARRAY_POWERSHELL+=("${FILE}") + elif [ "${FILE_TYPE}" == "css" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_CSS+=("$FILE") + FILE_ARRAY_CSS+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 - elif [ "$FILE_TYPE" == "env" ]; then + elif [ "${FILE_TYPE}" == "env" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_ENV+=("$FILE") + FILE_ARRAY_ENV+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 - elif [ "$FILE_TYPE" == "kt" ] || [ "$FILE_TYPE" == "kts" ]; then + elif [ "${FILE_TYPE}" == "kt" ] || [ "${FILE_TYPE}" == "kts" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_KOTLIN+=("$FILE") + FILE_ARRAY_KOTLIN+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -385,47 +385,47 @@ function BuildFileList() { ############################ # Get the Protocol Buffers files # ############################ - elif [ "$FILE_TYPE" == "dart" ]; then + elif [ "${FILE_TYPE}" == "dart" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_DART+=("$FILE") + FILE_ARRAY_DART+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 - elif [ "$FILE_TYPE" == "proto" ]; then + elif [ "${FILE_TYPE}" == "proto" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_PROTOBUF+=("$FILE") + FILE_ARRAY_PROTOBUF+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 - elif [ "$FILE" == "dockerfile" ] || [ "$FILE_TYPE" == "dockerfile" ]; then + elif [ "${FILE}" == "dockerfile" ] || [ "${FILE_TYPE}" == "dockerfile" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_DOCKER+=("$FILE") + FILE_ARRAY_DOCKER+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 - elif [ "$FILE_TYPE" == "clj" ] || [ "$FILE_TYPE" == "cljs" ] || [ "$FILE_TYPE" == "cljc" ] || [ "$FILE_TYPE" == "edn" ]; then + elif [ "${FILE_TYPE}" == "clj" ] || [ "${FILE_TYPE}" == "cljs" ] || [ "${FILE_TYPE}" == "cljc" ] || [ "${FILE_TYPE}" == "edn" ]; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_CLOJURE+=("$FILE") + FILE_ARRAY_CLOJURE+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 - elif [ "$FILE_TYPE" == "html" ]; then + elif [ "${FILE_TYPE}" == "html" ]; then ################################ # Append the file to the array # ##############################p## - FILE_ARRAY_HTML+=("$FILE") + FILE_ARRAY_HTML+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -434,12 +434,12 @@ function BuildFileList() { ############################################## # Use file to see if we can parse what it is # ############################################## - GET_FILE_TYPE_CMD=$(file "$FILE" 2>&1) + GET_FILE_TYPE_CMD=$(file "${FILE}" 2>&1) ################# # Check if bash # ################# - if [[ $GET_FILE_TYPE_CMD == *"Bourne-Again shell script"* ]]; then + if [[ ${GET_FILE_TYPE_CMD} == *"Bourne-Again shell script"* ]]; then ####################### # It is a bash script # ####################### @@ -448,12 +448,12 @@ function BuildFileList() { ################################ # Append the file to the array # ################################ - FILE_ARRAY_BASH+=("$FILE") + FILE_ARRAY_BASH+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 - elif [[ $GET_FILE_TYPE_CMD == *"Ruby script"* ]]; then + elif [[ ${GET_FILE_TYPE_CMD} == *"Ruby script"* ]]; then ####################### # It is a Ruby script # ####################### @@ -462,7 +462,7 @@ function BuildFileList() { ################################ # Append the file to the array # ################################ - FILE_ARRAY_RUBY+=("$FILE") + FILE_ARRAY_RUBY+=("${FILE}") ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -471,7 +471,7 @@ function BuildFileList() { ############################ # Extension was not found! # ############################ - echo -e "${NC}${F[Y]} - WARN!${NC} Failed to get filetype for:[$FILE]!${NC}" + echo -e "${NC}${F[Y]} - WARN!${NC} Failed to get filetype for:[${FILE}]!${NC}" ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## @@ -485,7 +485,7 @@ function BuildFileList() { ######################################### # Need to switch back to branch of code # ######################################### - SWITCH2_CMD=$(git -C "$GITHUB_WORKSPACE" checkout --progress --force "$GITHUB_SHA" 2>&1) + SWITCH2_CMD=$(git -C "${GITHUB_WORKSPACE}" checkout --progress --force "${GITHUB_SHA}" 2>&1) ####################### # Load the error code # @@ -495,10 +495,10 @@ function BuildFileList() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # Error echo "Failed to switch back to branch!" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$SWITCH2_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${SWITCH2_CMD}]${NC}" exit 1 fi diff --git a/lib/linter.sh b/lib/linter.sh index 030bb170..a4310c38 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -26,66 +26,66 @@ DEFAULT_RULES_LOCATION='/action/lib/.automation' # Defaul LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory # YAML Vars YAML_FILE_NAME='.yaml-lint.yml' # Name of the file -YAML_LINTER_RULES="$DEFAULT_RULES_LOCATION/$YAML_FILE_NAME" # Path to the yaml lint rules +YAML_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${YAML_FILE_NAME}" # Path to the yaml lint rules # MD Vars MARKDOWN_FILE_NAME='.markdown-lint.yml' # Name of the file -MARKDOWN_LINTER_RULES="$DEFAULT_RULES_LOCATION/$MARKDOWN_FILE_NAME" # Path to the markdown lint rules +MARKDOWN_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${MARKDOWN_FILE_NAME}" # Path to the markdown lint rules # Python Vars PYTHON_FILE_NAME='.python-lint' # Name of the file -PYTHON_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PYTHON_FILE_NAME" # Path to the python lint rules +PYTHON_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${PYTHON_FILE_NAME}" # Path to the python lint rules # Cloudformation Vars CFN_FILE_NAME='.cfnlintrc.yml' # Name of the file -CFN_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CFN_FILE_NAME" # Path to the cloudformation lint rules +CFN_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CFN_FILE_NAME}" # Path to the cloudformation lint rules # Ruby Vars RUBY_FILE_NAME="${RUBY_CONFIG_FILE:-.ruby-lint.yml}" # Name of the file -RUBY_LINTER_RULES="$DEFAULT_RULES_LOCATION/$RUBY_FILE_NAME" # Path to the ruby lint rules +RUBY_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${RUBY_FILE_NAME}" # Path to the ruby lint rules # Coffee Vars COFFEE_FILE_NAME='.coffee-lint.json' # Name of the file -COFFEESCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$COFFEE_FILE_NAME" # Path to the coffeescript lint rules +COFFEESCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${COFFEE_FILE_NAME}" # Path to the coffeescript lint rules # Javascript Vars JAVASCRIPT_FILE_NAME="${JAVASCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file -JAVASCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$JAVASCRIPT_FILE_NAME" # Path to the Javascript lint rules +JAVASCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${JAVASCRIPT_FILE_NAME}" # Path to the Javascript lint rules JAVASCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard # Typescript Vars TYPESCRIPT_FILE_NAME="${TYPESCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file -TYPESCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$TYPESCRIPT_FILE_NAME" # Path to the Typescript lint rules +TYPESCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${TYPESCRIPT_FILE_NAME}" # Path to the Typescript lint rules TYPESCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard # Ansible Vars ANSIBLE_FILE_NAME='.ansible-lint.yml' # Name of the file -ANSIBLE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$ANSIBLE_FILE_NAME" # Path to the Ansible lint rules +ANSIBLE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${ANSIBLE_FILE_NAME}" # Path to the Ansible lint rules # Docker Vars DOCKER_FILE_NAME='.dockerfilelintrc' # Name of the file -DOCKER_LINTER_RULES="$DEFAULT_RULES_LOCATION/$DOCKER_FILE_NAME" # Path to the Docker lint rules +DOCKER_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKER_FILE_NAME}" # Path to the Docker 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 +GO_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${GO_FILE_NAME}" # Path to the Go lint rules # Terraform Vars TERRAFORM_FILE_NAME='.tflint.hcl' # Name of the file -TERRAFORM_LINTER_RULES="$DEFAULT_RULES_LOCATION/$TERRAFORM_FILE_NAME" # Path to the Terraform lint rules +TERRAFORM_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${TERRAFORM_FILE_NAME}" # Path to the Terraform lint rules # Powershell Vars POWERSHELL_FILE_NAME='.powershell-psscriptanalyzer.psd1' # Name of the file -POWERSHELL_LINTER_RULES="$DEFAULT_RULES_LOCATION/$POWERSHELL_FILE_NAME" # Path to the Powershell lint rules +POWERSHELL_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${POWERSHELL_FILE_NAME}" # Path to the Powershell lint rules # Azure Resource Manager Vars ARM_FILE_NAME='.arm-ttk.psd1' # Name of the file -ARM_LINTER_RULES="$DEFAULT_RULES_LOCATION/$ARM_FILE_NAME" # Path to the ARM lint rules +ARM_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${ARM_FILE_NAME}" # Path to the ARM lint rules # CSS Vars CSS_FILE_NAME='.stylelintrc.json' # Name of the file -CSS_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CSS_FILE_NAME" # Path to the CSS lint rules +CSS_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CSS_FILE_NAME}" # Path to the CSS lint rules # OpenAPI Vars OPENAPI_FILE_NAME='.openapirc.yml' # Name of the file -OPENAPI_LINTER_RULES="$DEFAULT_RULES_LOCATION/$OPENAPI_FILE_NAME" # Path to the OpenAPI lint rules +OPENAPI_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${OPENAPI_FILE_NAME}" # Path to the OpenAPI lint rules # Protocol Buffers Vars PROTOBUF_FILE_NAME='.protolintrc.yml' # Name of the file -PROTOBUF_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PROTOBUF_FILE_NAME" # Path to the Protocol Buffers lint rules +PROTOBUF_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${PROTOBUF_FILE_NAME}" # Path to the Protocol Buffers lint rules # Clojure Vars CLOJURE_FILE_NAME='.clj-kondo/config.edn' # Name of the file -CLOJURE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CLOJURE_FILE_NAME" # Path to the Clojure lint rules +CLOJURE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CLOJURE_FILE_NAME}" # Path to the Clojure lint rules # Dart Vars DART_FILE_NAME='analysis_options.yaml' # Name of the file -DART_LINTER_RULES="$DEFAULT_RULES_LOCATION/$DART_FILE_NAME" # Path to the DART lint rules +DART_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DART_FILE_NAME}" # Path to the DART lint rules # HTML Vars HTML_FILE_NAME='.htmlhintrc' # Name of the file -HTML_LINTER_RULES="$DEFAULT_RULES_LOCATION/$HTML_FILE_NAME" # Path to the CSS lint rules +HTML_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${HTML_FILE_NAME}" # Path to the CSS lint rules ####################################### # Linter array for information prints # @@ -171,7 +171,7 @@ DEFAULT_VALIDATE_ALL_CODEBASE='true' # Default value for validate DEFAULT_WORKSPACE="${DEFAULT_WORKSPACE:-/tmp/lint}" # Default workspace if running locally DEFAULT_RUN_LOCAL='false' # Default value for debugging locally DEFAULT_TEST_CASE_RUN='false' # Flag to tell code to run only test cases -DEFAULT_IFS="$IFS" # Get the Default IFS for updating +DEFAULT_IFS="${IFS}" # Get the Default IFS for updating ############################################################### # Default Vars that are called in Subs and need to be ignored # @@ -184,7 +184,7 @@ READ_ONLY_CHANGE_FLAG=0 # Flag set to 1 if echo "${READ_ONLY_CHANGE_FLAG}" > /dev/null 2>&1 || true # Workaround SC2034 TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore echo "${TEST_CASE_FOLDER}" > /dev/null 2>&1 || true # Workaround SC2034 -DEFAULT_ANSIBLE_DIRECTORY="$GITHUB_WORKSPACE/ansible" # Default Ansible Directory +DEFAULT_ANSIBLE_DIRECTORY="${GITHUB_WORKSPACE}/ansible" # Default Ansible Directory echo "${DEFAULT_ANSIBLE_DIRECTORY}" > /dev/null 2>&1 || true # Workaround SC2034 WARNING_ARRAY_TEST=() # Array of warning linters that did not have an expected test result. echo "${WARNING_ARRAY_TEST[*]}" > /dev/null 2>&1 || true # Workaround SC2034 @@ -309,15 +309,15 @@ GetLinterVersions() { ################### # Get the version # ################### - if [[ "$LINTER" == "arm-ttk" ]]; then + if [[ "${LINTER}" == "arm-ttk" ]]; then # Need specific command for ARM - mapfile -t GET_VERSION_CMD < <(grep -iE 'version' "$ARM_TTK_PSD1" | xargs 2>&1) - elif [[ "$LINTER" == "protolint" ]]; then + mapfile -t GET_VERSION_CMD < <(grep -iE 'version' "${ARM_TTK_PSD1}" | xargs 2>&1) + elif [[ "${LINTER}" == "protolint" ]]; then # Need specific command for Protolint mapfile -t GET_VERSION_CMD < <(echo "--version not supported") else # Standard version command - mapfile -t GET_VERSION_CMD < <("$LINTER" --version 2>&1) + mapfile -t GET_VERSION_CMD < <("${LINTER}" --version 2>&1) fi ####################### @@ -328,13 +328,13 @@ GetLinterVersions() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ] || [ -z "${GET_VERSION_CMD[*]}" ]; then - echo -e "${NC}[$LINTER]: ${F[Y]}WARN!${NC} Failed to get version info for:${NC}" + if [ ${ERROR_CODE} -ne 0 ] || [ -z "${GET_VERSION_CMD[*]}" ]; then + echo -e "${NC}[${LINTER}]: ${F[Y]}WARN!${NC} Failed to get version info for:${NC}" else ########################## # Print the version info # ########################## - echo -e "${NC}${F[B]}Successfully found version for ${F[W]}[$LINTER]${F[B]}: ${F[W]}${GET_VERSION_CMD[*]}${NC}" + echo -e "${NC}${F[B]}Successfully found version for ${F[W]}[${LINTER}]${F[B]}: ${F[W]}${GET_VERSION_CMD[*]}${NC}" fi done @@ -352,7 +352,7 @@ GetLinterRules() { ################ # Pull in vars # ################ - LANGUAGE_NAME="$1" # Name of the language were looking for + LANGUAGE_NAME="${1}" # Name of the language were looking for ####################################################### # Need to create the variables for the real variables # @@ -363,20 +363,20 @@ GetLinterRules() { ##################################### # Validate we have the linter rules # ##################################### - if [ -f "$GITHUB_WORKSPACE/$LINTER_RULES_PATH/${!LANGUAGE_FILE_NAME}" ]; then + if [ -f "${GITHUB_WORKSPACE}/${LINTER_RULES_PATH}/${!LANGUAGE_FILE_NAME}" ]; then echo "----------------------------------------------" echo "User provided file:[${!LANGUAGE_FILE_NAME}], setting rules file..." ######################################## # Update the path to the file location # ######################################## - eval "${LANGUAGE_LINTER_RULES}=$GITHUB_WORKSPACE/$LINTER_RULES_PATH/${!LANGUAGE_FILE_NAME}" + eval "${LANGUAGE_LINTER_RULES}=${GITHUB_WORKSPACE}/${LINTER_RULES_PATH}/${!LANGUAGE_FILE_NAME}" else ######################################################## # No user default provided, using the template default # ######################################################## - if [[ $ACTIONS_RUNNER_DEBUG == "true" ]]; then - echo " -> Codebase does NOT have file:[$LINTER_RULES_PATH/${!LANGUAGE_FILE_NAME}], using Default rules at:[${!LANGUAGE_LINTER_RULES}]" + if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then + echo " -> Codebase does NOT have file:[${LINTER_RULES_PATH}/${!LANGUAGE_FILE_NAME}], using Default rules at:[${!LANGUAGE_LINTER_RULES}]" fi fi } @@ -386,13 +386,13 @@ GetStandardRules() { ################ # Pull In Vars # ################ - LINTER="$1" # Type: javascript | typescript + LINTER="${1}" # Type: javascript | typescript ######################################################################### # Need to get the ENV vars from the linter rules to run in command line # ######################################################################### # Copy orig IFS to var - ORIG_IFS="$IFS" + ORIG_IFS="${IFS}" # Set the IFS to newline IFS=$'\n' @@ -401,10 +401,10 @@ GetStandardRules() { ######################################### # Only env vars that are marked as true GET_ENV_ARRAY=() - if [[ $LINTER == "javascript" ]]; then - mapfile -t GET_ENV_ARRAY < <(yq .env "$JAVASCRIPT_LINTER_RULES" | grep true) - elif [[ $LINTER == "typescript" ]]; then - mapfile -t GET_ENV_ARRAY < <(yq .env "$TYPESCRIPT_LINTER_RULES" | grep true) + if [[ ${LINTER} == "javascript" ]]; then + mapfile -t GET_ENV_ARRAY < <(yq .env "${JAVASCRIPT_LINTER_RULES}" | grep true) + elif [[ ${LINTER} == "typescript" ]]; then + mapfile -t GET_ENV_ARRAY < <(yq .env "${TYPESCRIPT_LINTER_RULES}" | grep true) fi ####################### @@ -415,7 +415,7 @@ GetStandardRules() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # ERROR echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to gain list of ENV vars to load!${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GET_ENV_ARRAY[*]}]${NC}" @@ -426,7 +426,7 @@ GetStandardRules() { # Set IFS back to normal # ########################## # Set IFS back to Orig - IFS="$ORIG_IFS" + IFS="${ORIG_IFS}" ###################### # Set the env string # @@ -445,16 +445,16 @@ GetStandardRules() { # Get the env to add to string # ################################ ENV="$(echo "${ENV}" | cut -d'"' -f2)" - # echo "ENV:[$ENV]" + # echo "ENV:[${ENV}]" ENV_STRING+="--env ${ENV} " done ######################################### # Remove trailing and ending whitespace # ######################################### - if [[ $LINTER == "javascript" ]]; then + if [[ ${LINTER} == "javascript" ]]; then JAVASCRIPT_STANDARD_LINTER_RULES="$(echo -e "${ENV_STRING}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" - elif [[ $LINTER == "typescript" ]]; then + elif [[ ${LINTER} == "typescript" ]]; then TYPESCRIPT_STANDARD_LINTER_RULES="$(echo -e "${ENV_STRING}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" fi } @@ -464,12 +464,12 @@ DetectOpenAPIFile() { ################ # Pull in vars # ################ - FILE="$1" + FILE="${1}" ############################### # Check the file for keywords # ############################### - grep -E '"openapi":|"swagger":|^openapi:|^swagger:' "$FILE" > /dev/null + grep -E '"openapi":|"swagger":|^openapi:|^swagger:' "${FILE}" > /dev/null ####################### # Load the error code # @@ -479,7 +479,7 @@ DetectOpenAPIFile() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -eq 0 ]; then + if [ ${ERROR_CODE} -eq 0 ]; then ######################## # Found string in file # ######################## @@ -497,12 +497,12 @@ DetectARMFile() { ################ # Pull in vars # ################ - FILE="$1" # Name of the file/path we are validating + FILE="${1}" # Name of the file/path we are validating ############################### # Check the file for keywords # ############################### - grep -E 'schema.management.azure.com' "$FILE" > /dev/null + grep -E 'schema.management.azure.com' "${FILE}" > /dev/null ####################### # Load the error code # @@ -512,7 +512,7 @@ DetectARMFile() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -eq 0 ]; then + if [ ${ERROR_CODE} -eq 0 ]; then ######################## # Found string in file # ######################## @@ -530,14 +530,14 @@ DetectCloudFormationFile() { ################ # Pull in Vars # ################ - FILE="$1" # File that we need to validate + FILE="${1}" # File that we need to validate # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-formats.html # AWSTemplateFormatVersion is optional ####################################### # Check if file has AWS Template info # ####################################### - if grep 'AWSTemplateFormatVersion' "$FILE" > /dev/null; then + if grep 'AWSTemplateFormatVersion' "${FILE}" > /dev/null; then # Found it return 0 fi @@ -545,7 +545,7 @@ DetectCloudFormationFile() { ################################################### # Check if file has AWSTemplateFormatVersion info # ################################################### - if shyaml --quiet get-type AWSTemplateFormatVersion > /dev/null < "$FILE"; then + if shyaml --quiet get-type AWSTemplateFormatVersion > /dev/null < "${FILE}"; then # Found it return 0 fi @@ -553,9 +553,9 @@ DetectCloudFormationFile() { ############################### # check if file has resources # ############################### - if jq -e 'has("Resources")' > /dev/null 2>&1 < "$FILE"; then + if jq -e 'has("Resources")' > /dev/null 2>&1 < "${FILE}"; then # Check if AWS Alexa or custom - if jq ".Resources[].Type" 2> /dev/null | grep -q -E "(AWS|Alexa|Custom)" < "$FILE"; then + if jq ".Resources[].Type" 2> /dev/null | grep -q -E "(AWS|Alexa|Custom)" < "${FILE}"; then # Found it return 0 fi @@ -564,7 +564,7 @@ DetectCloudFormationFile() { ################################ # See if it contains resources # ################################ - if shyaml values-0 Resources 2> /dev/null | grep -q -E "Type: (AWS|Alexa|Custom)" < "$FILE"; then + if shyaml values-0 Resources 2> /dev/null | grep -q -E "Type: (AWS|Alexa|Custom)" < "${FILE}"; then # Found it return 0 fi @@ -587,11 +587,11 @@ GetGitHubVars() { ############################### # Get the Run test cases flag # ############################### - if [ -z "$TEST_CASE_RUN" ]; then + if [ -z "${TEST_CASE_RUN}" ]; then ################################## # No flag passed, set to default # ################################## - TEST_CASE_RUN="$DEFAULT_TEST_CASE_RUN" + TEST_CASE_RUN="${DEFAULT_TEST_CASE_RUN}" fi ############################### @@ -602,11 +602,11 @@ GetGitHubVars() { ########################## # Get the run local flag # ########################## - if [ -z "$RUN_LOCAL" ]; then + if [ -z "${RUN_LOCAL}" ]; then ################################## # No flag passed, set to default # ################################## - RUN_LOCAL="$DEFAULT_RUN_LOCAL" + RUN_LOCAL="${DEFAULT_RUN_LOCAL}" fi ############################### @@ -617,7 +617,7 @@ GetGitHubVars() { ################################# # Check if were running locally # ################################# - if [[ $RUN_LOCAL != "false" ]]; then + if [[ ${RUN_LOCAL} != "false" ]]; then ########################################## # We are running locally for a debug run # ########################################## @@ -627,16 +627,16 @@ GetGitHubVars() { ############################ # Set the GITHUB_WORKSPACE # ############################ - if [ -z "$GITHUB_WORKSPACE" ]; then - GITHUB_WORKSPACE="$DEFAULT_WORKSPACE" + if [ -z "${GITHUB_WORKSPACE}" ]; then + GITHUB_WORKSPACE="${DEFAULT_WORKSPACE}" fi - if [ ! -d "$GITHUB_WORKSPACE" ]; then + if [ ! -d "${GITHUB_WORKSPACE}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Provided volume is not a directory!${NC}" exit 1 fi - echo "Linting all files in mapped directory:[$DEFAULT_WORKSPACE]" + echo "Linting all files in mapped directory:[${DEFAULT_WORKSPACE}]" # No need to touch or set the GITHUB_SHA # No need to touch or set the GITHUB_EVENT_PATH @@ -646,39 +646,39 @@ GetGitHubVars() { ################################# # Set the VALIDATE_ALL_CODEBASE # ################################# - VALIDATE_ALL_CODEBASE="$DEFAULT_VALIDATE_ALL_CODEBASE" + VALIDATE_ALL_CODEBASE="${DEFAULT_VALIDATE_ALL_CODEBASE}" else ############################ # Validate we have a value # ############################ - if [ -z "$GITHUB_SHA" ]; then + if [ -z "${GITHUB_SHA}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_SHA]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_SHA]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GITHUB_SHA}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_SHA]${F[B]}, value:${F[W]}[$GITHUB_SHA]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_SHA]${F[B]}, value:${F[W]}[${GITHUB_SHA}]${NC}" fi ############################ # Validate we have a value # ############################ - if [ -z "$GITHUB_WORKSPACE" ]; then + if [ -z "${GITHUB_WORKSPACE}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_WORKSPACE]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_WORKSPACE]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GITHUB_WORKSPACE}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_WORKSPACE]${F[B]}, value:${F[W]}[$GITHUB_WORKSPACE]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_WORKSPACE]${F[B]}, value:${F[W]}[${GITHUB_WORKSPACE}]${NC}" fi ############################ # Validate we have a value # ############################ - if [ -z "$GITHUB_EVENT_PATH" ]; then + if [ -z "${GITHUB_EVENT_PATH}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_EVENT_PATH]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_EVENT_PATH]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GITHUB_EVENT_PATH}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_EVENT_PATH]${F[B]}, value:${F[W]}[$GITHUB_EVENT_PATH]${F[B]}${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_EVENT_PATH]${F[B]}, value:${F[W]}[${GITHUB_EVENT_PATH}]${F[B]}${NC}" fi ################################################## @@ -688,42 +688,42 @@ GetGitHubVars() { ###################### # Get the GitHub Org # ###################### - GITHUB_ORG=$(jq -r '.repository.owner.login' < "$GITHUB_EVENT_PATH") + GITHUB_ORG=$(jq -r '.repository.owner.login' < "${GITHUB_EVENT_PATH}") ############################ # Validate we have a value # ############################ - if [ -z "$GITHUB_ORG" ]; then + if [ -z "${GITHUB_ORG}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_ORG]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_ORG]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GITHUB_ORG}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_ORG]${F[B]}, value:${F[W]}[$GITHUB_ORG]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_ORG]${F[B]}, value:${F[W]}[${GITHUB_ORG}]${NC}" fi ####################### # Get the GitHub Repo # ####################### - GITHUB_REPO=$(jq -r '.repository.name' < "$GITHUB_EVENT_PATH") + GITHUB_REPO=$(jq -r '.repository.name' < "${GITHUB_EVENT_PATH}") ############################ # Validate we have a value # ############################ - if [ -z "$GITHUB_REPO" ]; then + if [ -z "${GITHUB_REPO}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_REPO]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_REPO]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GITHUB_REPO}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_REPO]${F[B]}, value:${F[W]}[$GITHUB_REPO]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_REPO]${F[B]}, value:${F[W]}[${GITHUB_REPO}]${NC}" fi fi ############################ # Validate we have a value # ############################ - if [ -z "$GITHUB_TOKEN" ]; then + if [ -z "${GITHUB_TOKEN}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_TOKEN]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_TOKEN]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GITHUB_TOKEN}]${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!${NC}" ################################################################################ @@ -742,27 +742,27 @@ GetGitHubVars() { ####################################################################### # Check to see if the multi status is set, and we have a token to use # ####################################################################### - if [ "$MULTI_STATUS" == "true" ] && [ -n "$GITHUB_TOKEN" ]; then + if [ "${MULTI_STATUS}" == "true" ] && [ -n "${GITHUB_TOKEN}" ]; then ############################ # Validate we have a value # ############################ - if [ -z "$GITHUB_REPOSITORY" ]; then + if [ -z "${GITHUB_REPOSITORY}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_REPOSITORY]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_REPOSITORY]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GITHUB_REPOSITORY}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_REPOSITORY]${F[B]}, value:${F[W]}[$GITHUB_REPOSITORY]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_REPOSITORY]${F[B]}, value:${F[W]}[${GITHUB_REPOSITORY}]${NC}" fi ############################ # Validate we have a value # ############################ - if [ -z "$GITHUB_RUN_ID" ]; then + if [ -z "${GITHUB_RUN_ID}" ]; then echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to get [GITHUB_RUN_ID]!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$GITHUB_RUN_ID]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${GITHUB_RUN_ID}]${NC}" exit 1 else - echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_RUN_ID]${F[B]}, value:${F[W]}[$GITHUB_RUN_ID]${NC}" + echo -e "${NC}${F[B]}Successfully found:${F[W]}[GITHUB_RUN_ID]${F[B]}, value:${F[W]}[${GITHUB_RUN_ID}]${NC}" fi fi } @@ -771,7 +771,7 @@ GetGitHubVars() { function ValidatePowershellModules() { VALIDATE_PSSA_MODULE=$(pwsh -c "(Get-Module -Name PSScriptAnalyzer -ListAvailable | Select-Object -First 1).Name" 2>&1) # If module found, ensure Invoke-ScriptAnalyzer command is available - if [[ $VALIDATE_PSSA_MODULE == "PSScriptAnalyzer" ]]; then + if [[ ${VALIDATE_PSSA_MODULE} == "PSScriptAnalyzer" ]]; then VALIDATE_PSSA_CMD=$(pwsh -c "(Get-Command Invoke-ScriptAnalyzer | Select-Object -First 1).Name" 2>&1) else # Failed to find module @@ -781,7 +781,7 @@ function ValidatePowershellModules() { ######################################### # validate we found the script analyzer # ######################################### - if [[ $VALIDATE_PSSA_CMD != "Invoke-ScriptAnalyzer" ]]; then + if [[ ${VALIDATE_PSSA_CMD} != "Invoke-ScriptAnalyzer" ]]; then # Failed to find module exit 1 fi @@ -794,16 +794,16 @@ function ValidatePowershellModules() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # Failed - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed find module [PSScriptAnalyzer] for [$LINTER_NAME] in system!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[PSSA_MODULE $VALIDATE_PSSA_MODULE] [PSSA_CMD $VALIDATE_PSSA_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed find module [PSScriptAnalyzer] for [${LINTER_NAME}] in system!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[PSSA_MODULE ${VALIDATE_PSSA_MODULE}] [PSSA_CMD ${VALIDATE_PSSA_CMD}]${NC}" exit 1 else # Success - if [[ $ACTIONS_RUNNER_DEBUG == "true" ]]; then - echo -e "${NC}${F[B]}Successfully found module ${F[W]}[$VALIDATE_PSSA_MODULE]${F[B]} in system${NC}" - echo -e "${NC}${F[B]}Successfully found command ${F[W]}[$VALIDATE_PSSA_CMD]${F[B]} in system${NC}" + if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then + echo -e "${NC}${F[B]}Successfully found module ${F[W]}[${VALIDATE_PSSA_MODULE}]${F[B]} in system${NC}" + echo -e "${NC}${F[B]}Successfully found command ${F[W]}[${VALIDATE_PSSA_CMD}]${F[B]} in system${NC}" fi fi } @@ -813,8 +813,8 @@ CallStatusAPI() { #################### # Pull in the vars # #################### - LANGUAGE="$1" # langauge that was validated - STATUS="$2" # success | error + LANGUAGE="${1}" # langauge that was validated + STATUS="${2}" # success | error SUCCESS_MSG='No errors were found in the linting process' FAIL_MSG='Errors were detected, please view logs' MESSAGE='' # Message to send to status API @@ -822,29 +822,29 @@ CallStatusAPI() { ###################################### # Check the status to create message # ###################################### - if [ "$STATUS" == "success" ]; then + if [ "${STATUS}" == "success" ]; then # Success - MESSAGE="$SUCCESS_MSG" + MESSAGE="${SUCCESS_MSG}" else # Failure - MESSAGE="$FAIL_MSG" + MESSAGE="${FAIL_MSG}" fi ########################################################## # Check to see if were enabled for multi Status mesaages # ########################################################## - if [ "$MULTI_STATUS" == "true" ]; then + if [ "${MULTI_STATUS}" == "true" ]; then ############################################## # Call the status API to create status check # ############################################## SEND_STATUS_CMD=$(curl -f -s -X POST \ - --url "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + --url "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}" \ -H 'accept: application/vnd.github.v3+json' \ - -H "authorization: Bearer $GITHUB_TOKEN" \ + -H "authorization: Bearer ${GITHUB_TOKEN}" \ -H 'content-type: application/json' \ - -d "{ \"state\": \"$STATUS\", - \"target_url\": \"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\", - \"description\": \"$MESSAGE\", \"context\": \"--> Linted: $LANGUAGE\" + -d "{ \"state\": \"${STATUS}\", + \"target_url\": \"https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}\", + \"description\": \"${MESSAGE}\", \"context\": \"--> Linted: ${LANGUAGE}\" }" 2>&1) ####################### @@ -855,10 +855,10 @@ CallStatusAPI() { ############################## # Check the shell for errors # ############################## - if [ "$ERROR_CODE" -ne 0 ]; then + if [ "${ERROR_CODE}" -ne 0 ]; then # ERROR echo "ERROR! Failed to call GitHub Status API!" - echo "ERROR:[$SEND_STATUS_CMD]" + echo "ERROR:[${SEND_STATUS_CMD}]" # Not going to fail the script on this yet... fi fi @@ -893,7 +893,7 @@ Footer() { ########################### # Build the error counter # ########################### - ERROR_COUNTER="ERRORS_FOUND_$LANGUAGE" + ERROR_COUNTER="ERRORS_FOUND_${LANGUAGE}" ################## # Print if not 0 # @@ -903,19 +903,19 @@ Footer() { ################### # Print the goods # ################### - echo -e "${NC}${B[R]}${F[W]}ERRORS FOUND${NC} in $LANGUAGE:[${!ERROR_COUNTER}]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERRORS FOUND${NC} in ${LANGUAGE}:[${!ERROR_COUNTER}]${NC}" ######################################### # Create status API for Failed language # ######################################### - CallStatusAPI "$LANGUAGE" "error" + CallStatusAPI "${LANGUAGE}" "error" else # No errors found when linting the language ###################################### # Check if we validated the langauge # ###################################### if [[ "${UNIQUE_LINTED_ARRAY[*]}" =~ ${LANGUAGE} ]]; then - CallStatusAPI "$LANGUAGE" "success" + CallStatusAPI "${LANGUAGE}" "success" fi fi done @@ -930,44 +930,44 @@ Footer() { ################################## # Exit with 0 if errors disabled # ################################## - if [ "$DISABLE_ERRORS" == "true" ]; then - echo -e "${NC}${F[Y]}WARN!${NC} Exiting with exit code:[0] as:[DISABLE_ERRORS] was set to:[$DISABLE_ERRORS]${NC}" + if [ "${DISABLE_ERRORS}" == "true" ]; then + echo -e "${NC}${F[Y]}WARN!${NC} Exiting with exit code:[0] as:[DISABLE_ERRORS] was set to:[${DISABLE_ERRORS}]${NC}" exit 0 ############################### # Exit with 1 if errors found # ############################### - elif [ "$ERRORS_FOUND_YML" -ne 0 ] || - [ "$ERRORS_FOUND_JSON" -ne 0 ] || - [ "$ERRORS_FOUND_XML" -ne 0 ] || - [ "$ERRORS_FOUND_MARKDOWN" -ne 0 ] || - [ "$ERRORS_FOUND_BASH" -ne 0 ] || - [ "$ERRORS_FOUND_PERL" -ne 0 ] || - [ "$ERRORS_FOUND_RAKU" -ne 0 ] || - [ "$ERRORS_FOUND_PHP" -ne 0 ] || - [ "$ERRORS_FOUND_PYTHON" -ne 0 ] || - [ "$ERRORS_FOUND_COFFEESCRIPT" -ne 0 ] || - [ "$ERRORS_FOUND_ANSIBLE" -ne 0 ] || - [ "$ERRORS_FOUND_JAVASCRIPT_ES" -ne 0 ] || - [ "$ERRORS_FOUND_JAVASCRIPT_STANDARD" -ne 0 ] || - [ "$ERRORS_FOUND_JSX" -ne 0 ] || - [ "$ERRORS_FOUND_TSX" -ne 0 ] || - [ "$ERRORS_FOUND_TYPESCRIPT_ES" -ne 0 ] || - [ "$ERRORS_FOUND_TYPESCRIPT_STANDARD" -ne 0 ] || - [ "$ERRORS_FOUND_DOCKER" -ne 0 ] || - [ "$ERRORS_FOUND_GO" -ne 0 ] || - [ "$ERRORS_FOUND_TERRAFORM" -ne 0 ] || - [ "$ERRORS_FOUND_POWERSHELL" -ne 0 ] || - [ "$ERRORS_FOUND_ARM" -ne 0 ] || - [ "$ERRORS_FOUND_RUBY" -ne 0 ] || - [ "$ERRORS_FOUND_CSS" -ne 0 ] || - [ "$ERRORS_FOUND_CFN" -ne 0 ] || - [ "$ERRORS_FOUND_ENV" -ne 0 ] || - [ "$ERRORS_FOUND_OPENAPI" -ne 0 ] || - [ "$ERRORS_FOUND_PROTOBUF" -ne 0 ] || - [ "$ERRORS_FOUND_CLOJURE" -ne 0 ] || - [ "$ERRORS_FOUND_KOTLIN" -ne 0 ] || - [ "$ERRORS_FOUND_DART" -ne 0 ] || - [ "$ERRORS_FOUND_HTML" -ne 0 ]; then + elif [ "${ERRORS_FOUND_YML}" -ne 0 ] || + [ "${ERRORS_FOUND_JSON}" -ne 0 ] || + [ "${ERRORS_FOUND_XML}" -ne 0 ] || + [ "${ERRORS_FOUND_MARKDOWN}" -ne 0 ] || + [ "${ERRORS_FOUND_BASH}" -ne 0 ] || + [ "${ERRORS_FOUND_PERL}" -ne 0 ] || + [ "${ERRORS_FOUND_RAKU}" -ne 0 ] || + [ "${ERRORS_FOUND_PHP}" -ne 0 ] || + [ "${ERRORS_FOUND_PYTHON}" -ne 0 ] || + [ "${ERRORS_FOUND_COFFEESCRIPT}" -ne 0 ] || + [ "${ERRORS_FOUND_ANSIBLE}" -ne 0 ] || + [ "${ERRORS_FOUND_JAVASCRIPT_ES}" -ne 0 ] || + [ "${ERRORS_FOUND_JAVASCRIPT_STANDARD}" -ne 0 ] || + [ "${ERRORS_FOUND_JSX}" -ne 0 ] || + [ "${ERRORS_FOUND_TSX}" -ne 0 ] || + [ "${ERRORS_FOUND_TYPESCRIPT_ES}" -ne 0 ] || + [ "${ERRORS_FOUND_TYPESCRIPT_STANDARD}" -ne 0 ] || + [ "${ERRORS_FOUND_DOCKER}" -ne 0 ] || + [ "${ERRORS_FOUND_GO}" -ne 0 ] || + [ "${ERRORS_FOUND_TERRAFORM}" -ne 0 ] || + [ "${ERRORS_FOUND_POWERSHELL}" -ne 0 ] || + [ "${ERRORS_FOUND_ARM}" -ne 0 ] || + [ "${ERRORS_FOUND_RUBY}" -ne 0 ] || + [ "${ERRORS_FOUND_CSS}" -ne 0 ] || + [ "${ERRORS_FOUND_CFN}" -ne 0 ] || + [ "${ERRORS_FOUND_ENV}" -ne 0 ] || + [ "${ERRORS_FOUND_OPENAPI}" -ne 0 ] || + [ "${ERRORS_FOUND_PROTOBUF}" -ne 0 ] || + [ "${ERRORS_FOUND_CLOJURE}" -ne 0 ] || + [ "${ERRORS_FOUND_KOTLIN}" -ne 0 ] || + [ "${ERRORS_FOUND_DART}" -ne 0 ] || + [ "${ERRORS_FOUND_HTML}" -ne 0 ]; then # Failed exit echo -e "${NC}${F[R]}Exiting with errors found!${NC}" exit 1 @@ -1057,7 +1057,7 @@ GetLinterRules "HTML" ################################# # Check if were in verbose mode # ################################# -if [[ $ACTIONS_RUNNER_DEBUG == "true" ]]; then +if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then ################################## # Get and print all version info # ################################## @@ -1067,7 +1067,7 @@ fi ########################################### # Check to see if this is a test case run # ########################################### -if [[ $TEST_CASE_RUN != "false" ]]; then +if [[ ${TEST_CASE_RUN} != "false" ]]; then ############################################# # Set the multi status to off for test runs # @@ -1084,7 +1084,7 @@ fi ############################################# # check flag for validation of all codebase # ############################################# -if [ "$VALIDATE_ALL_CODEBASE" == "false" ]; then +if [ "${VALIDATE_ALL_CODEBASE}" == "false" ]; then ######################################## # Get list of files changed if env set # ######################################## @@ -1094,18 +1094,18 @@ fi ############### # YML LINTING # ############### -if [ "$VALIDATE_YAML" == "true" ]; then +if [ "${VALIDATE_YAML}" == "true" ]; then ###################### # Lint the Yml Files # ###################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "YML" "yamllint" "yamllint -c $YAML_LINTER_RULES" ".*\.\(yml\|yaml\)\$" "${FILE_ARRAY_YML[@]}" + LintCodebase "YML" "yamllint" "yamllint -c ${YAML_LINTER_RULES}" ".*\.\(yml\|yaml\)\$" "${FILE_ARRAY_YML[@]}" fi ################ # JSON LINTING # ################ -if [ "$VALIDATE_JSON" == "true" ]; then +if [ "${VALIDATE_JSON}" == "true" ]; then ####################### # Lint the json files # ####################### @@ -1116,7 +1116,7 @@ fi ############### # XML LINTING # ############### -if [ "$VALIDATE_XML" == "true" ]; then +if [ "${VALIDATE_XML}" == "true" ]; then ###################### # Lint the XML Files # ###################### @@ -1127,18 +1127,18 @@ fi #################### # MARKDOWN LINTING # #################### -if [ "$VALIDATE_MARKDOWN" == "true" ]; then +if [ "${VALIDATE_MARKDOWN}" == "true" ]; then ########################### # Lint the Markdown Files # ########################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "MARKDOWN" "markdownlint" "markdownlint -c $MARKDOWN_LINTER_RULES" ".*\.\(md\)\$" "${FILE_ARRAY_MARKDOWN[@]}" + LintCodebase "MARKDOWN" "markdownlint" "markdownlint -c ${MARKDOWN_LINTER_RULES}" ".*\.\(md\)\$" "${FILE_ARRAY_MARKDOWN[@]}" fi ################ # BASH LINTING # ################ -if [ "$VALIDATE_BASH" == "true" ]; then +if [ "${VALIDATE_BASH}" == "true" ]; then ####################### # Lint the bash files # ####################### @@ -1149,29 +1149,29 @@ fi ################## # PYTHON LINTING # ################## -if [ "$VALIDATE_PYTHON" == "true" ]; then +if [ "${VALIDATE_PYTHON}" == "true" ]; then ######################### # Lint the python files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "PYTHON" "pylint" "pylint --rcfile $PYTHON_LINTER_RULES" ".*\.\(py\)\$" "${FILE_ARRAY_PYTHON[@]}" + LintCodebase "PYTHON" "pylint" "pylint --rcfile ${PYTHON_LINTER_RULES}" ".*\.\(py\)\$" "${FILE_ARRAY_PYTHON[@]}" fi ############### # CFN LINTING # ############### -if [ "$VALIDATE_CFN" == "true" ]; then +if [ "${VALIDATE_CFN}" == "true" ]; then ################################# # Lint the CloudFormation files # ################################# # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "CFN" "cfn-lint" "cfn-lint --config-file $CFN_LINTER_RULES" ".*\.\(json\|yml\|yaml\)\$" "${FILE_ARRAY_CFN[@]}" + LintCodebase "CFN" "cfn-lint" "cfn-lint --config-file ${CFN_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "${FILE_ARRAY_CFN[@]}" fi ################ # PERL LINTING # ################ -if [ "$VALIDATE_PERL" == "true" ]; then +if [ "${VALIDATE_PERL}" == "true" ]; then ####################### # Lint the perl files # ####################### @@ -1182,22 +1182,22 @@ fi ################ # RAKU LINTING # ################ -if [ "$VALIDATE_RAKU" == "true" ]; then +if [ "${VALIDATE_RAKU}" == "true" ]; then ####################### # Lint the raku files # ####################### - echo "$GITHUB_WORKSPACE/META6.json" - if [ -e "$GITHUB_WORKSPACE/META6.json" ]; then - cd "$GITHUB_WORKSPACE" && zef install --deps-only --/test . + echo "${GITHUB_WORKSPACE}/META6.json" + if [ -e "${GITHUB_WORKSPACE}/META6.json" ]; then + cd "${GITHUB_WORKSPACE}" && zef install --deps-only --/test . fi # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "RAKU" "raku" "raku -I $GITHUB_WORKSPACE/lib -c" ".*\.\(raku\|rakumod\|rakutest\|pm6\|pl6\|p6\)\$" "${FILE_ARRAY_RAKU[@]}" + LintCodebase "RAKU" "raku" "raku -I ${GITHUB_WORKSPACE}/lib -c" ".*\.\(raku\|rakumod\|rakutest\|pm6\|pl6\|p6\)\$" "${FILE_ARRAY_RAKU[@]}" fi ################ # PHP LINTING # ################ -if [ "$VALIDATE_PHP" == "true" ]; then +if [ "${VALIDATE_PHP}" == "true" ]; then ####################### # Lint the PHP files # ####################### @@ -1208,75 +1208,75 @@ fi ################ # RUBY LINTING # ################ -if [ "$VALIDATE_RUBY" == "true" ]; then +if [ "${VALIDATE_RUBY}" == "true" ]; then ####################### # Lint the ruby files # ####################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "RUBY" "rubocop" "rubocop -c $RUBY_LINTER_RULES --force-exclusion" ".*\.\(rb\)\$" "${FILE_ARRAY_RUBY[@]}" + LintCodebase "RUBY" "rubocop" "rubocop -c ${RUBY_LINTER_RULES} --force-exclusion" ".*\.\(rb\)\$" "${FILE_ARRAY_RUBY[@]}" fi ######################## # COFFEESCRIPT LINTING # ######################## -if [ "$VALIDATE_COFFEE" == "true" ]; then +if [ "${VALIDATE_COFFEE}" == "true" ]; then ######################### # Lint the coffee files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "COFFEESCRIPT" "coffeelint" "coffeelint -f $COFFEESCRIPT_LINTER_RULES" ".*\.\(coffee\)\$" "${FILE_ARRAY_COFFEESCRIPT[@]}" + LintCodebase "COFFEESCRIPT" "coffeelint" "coffeelint -f ${COFFEESCRIPT_LINTER_RULES}" ".*\.\(coffee\)\$" "${FILE_ARRAY_COFFEESCRIPT[@]}" fi ################## # GOLANG LINTING # ################## -if [ "$VALIDATE_GO" == "true" ]; then +if [ "${VALIDATE_GO}" == "true" ]; then ######################### # Lint the golang files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "GO" "golangci-lint" "golangci-lint run -c $GO_LINTER_RULES" ".*\.\(go\)\$" "${FILE_ARRAY_GO[@]}" + LintCodebase "GO" "golangci-lint" "golangci-lint run -c ${GO_LINTER_RULES}" ".*\.\(go\)\$" "${FILE_ARRAY_GO[@]}" fi ##################### # TERRAFORM LINTING # ##################### -if [ "$VALIDATE_TERRAFORM" == "true" ]; then +if [ "${VALIDATE_TERRAFORM}" == "true" ]; then ############################ # Lint the Terraform files # ############################ # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "TERRAFORM" "tflint" "tflint -c $TERRAFORM_LINTER_RULES" ".*\.\(tf\)\$" "${FILE_ARRAY_TERRAFORM[@]}" + LintCodebase "TERRAFORM" "tflint" "tflint -c ${TERRAFORM_LINTER_RULES}" ".*\.\(tf\)\$" "${FILE_ARRAY_TERRAFORM[@]}" fi ################### # ANSIBLE LINTING # ################### -if [ "$VALIDATE_ANSIBLE" == "true" ]; then +if [ "${VALIDATE_ANSIBLE}" == "true" ]; then ########################## # Lint the Ansible files # ########################## # Due to the nature of how we want to validate Ansible, we cannot use the # standard loop, since it looks for an ansible folder, excludes certain # files, and looks for additional changes, it should be an outlier - LintAnsibleFiles "$ANSIBLE_LINTER_RULES" # Passing rules but not needed, dont want to exclude unused var + LintAnsibleFiles "${ANSIBLE_LINTER_RULES}" # Passing rules but not needed, dont want to exclude unused var fi ###################### # JAVASCRIPT LINTING # ###################### -if [ "$VALIDATE_JAVASCRIPT_ES" == "true" ]; then +if [ "${VALIDATE_JAVASCRIPT_ES}" == "true" ]; then ############################# # Lint the Javascript files # ############################# # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "JAVASCRIPT_ES" "eslint" "eslint --no-eslintrc -c $JAVASCRIPT_LINTER_RULES" ".*\.\(js\)\$" "${FILE_ARRAY_JAVASCRIPT_ES[@]}" + LintCodebase "JAVASCRIPT_ES" "eslint" "eslint --no-eslintrc -c ${JAVASCRIPT_LINTER_RULES}" ".*\.\(js\)\$" "${FILE_ARRAY_JAVASCRIPT_ES[@]}" fi ###################### # JAVASCRIPT LINTING # ###################### -if [ "$VALIDATE_JAVASCRIPT_STANDARD" == "true" ]; then +if [ "${VALIDATE_JAVASCRIPT_STANDARD}" == "true" ]; then ################################# # Get Javascript standard rules # ################################# @@ -1285,44 +1285,44 @@ if [ "$VALIDATE_JAVASCRIPT_STANDARD" == "true" ]; then # Lint the Javascript files # ############################# # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "JAVASCRIPT_STANDARD" "standard" "standard $JAVASCRIPT_STANDARD_LINTER_RULES" ".*\.\(js\)\$" "${FILE_ARRAY_JAVASCRIPT_STANDARD[@]}" + LintCodebase "JAVASCRIPT_STANDARD" "standard" "standard ${JAVASCRIPT_STANDARD_LINTER_RULES}" ".*\.\(js\)\$" "${FILE_ARRAY_JAVASCRIPT_STANDARD[@]}" fi ###################### # JSX LINTING # ###################### -if [ "$VALIDATE_JSX" == "true" ]; then +if [ "${VALIDATE_JSX}" == "true" ]; then ############################# # Lint the JSX files # ############################# # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "JSX" "eslint" "eslint --no-eslintrc -c $JAVASCRIPT_LINTER_RULES" ".*\.\(jsx\)\$" "${FILE_ARRAY_JSX[@]}" + LintCodebase "JSX" "eslint" "eslint --no-eslintrc -c ${JAVASCRIPT_LINTER_RULES}" ".*\.\(jsx\)\$" "${FILE_ARRAY_JSX[@]}" fi ###################### # TSX LINTING # ###################### -if [ "$VALIDATE_TSX" == "true" ]; then +if [ "${VALIDATE_TSX}" == "true" ]; then ############################# # Lint the TSX files # ############################# - LintCodebase "TSX" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(tsx\)\$" "${FILE_ARRAY_TSX[@]}" + LintCodebase "TSX" "eslint" "eslint --no-eslintrc -c ${TYPESCRIPT_LINTER_RULES}" ".*\.\(tsx\)\$" "${FILE_ARRAY_TSX[@]}" fi ###################### # TYPESCRIPT LINTING # ###################### -if [ "$VALIDATE_TYPESCRIPT_ES" == "true" ]; then +if [ "${VALIDATE_TYPESCRIPT_ES}" == "true" ]; then ############################# # Lint the Typescript files # ############################# - LintCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(ts\)\$" "${FILE_ARRAY_TYPESCRIPT_ES[@]}" + LintCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c ${TYPESCRIPT_LINTER_RULES}" ".*\.\(ts\)\$" "${FILE_ARRAY_TYPESCRIPT_ES[@]}" fi ###################### # TYPESCRIPT LINTING # ###################### -if [ "$VALIDATE_TYPESCRIPT_STANDARD" == "true" ]; then +if [ "${VALIDATE_TYPESCRIPT_STANDARD}" == "true" ]; then ################################# # Get Typescript standard rules # ################################# @@ -1330,13 +1330,13 @@ if [ "$VALIDATE_TYPESCRIPT_STANDARD" == "true" ]; then ############################# # Lint the Typescript files # ############################# - LintCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin $TYPESCRIPT_STANDARD_LINTER_RULES" ".*\.\(ts\)\$" "${FILE_ARRAY_TYPESCRIPT_STANDARD[@]}" + LintCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin ${TYPESCRIPT_STANDARD_LINTER_RULES}" ".*\.\(ts\)\$" "${FILE_ARRAY_TYPESCRIPT_STANDARD[@]}" fi ############### # CSS LINTING # ############### -if [ "$VALIDATE_CSS" == "true" ]; then +if [ "${VALIDATE_CSS}" == "true" ]; then ################################# # Get CSS standard rules # ################################# @@ -1344,13 +1344,13 @@ if [ "$VALIDATE_CSS" == "true" ]; then ############################# # Lint the CSS files # ############################# - LintCodebase "CSS" "stylelint" "stylelint --config $CSS_LINTER_RULES" ".*\.\(css\)\$" "${FILE_ARRAY_CSS[@]}" + LintCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\)\$" "${FILE_ARRAY_CSS[@]}" fi ############### # ENV LINTING # ############### -if [ "$VALIDATE_ENV" == "true" ]; then +if [ "${VALIDATE_ENV}" == "true" ]; then ####################### # Lint the env files # ####################### @@ -1361,7 +1361,7 @@ fi ################## # KOTLIN LINTING # ################## -if [ "$VALIDATE_KOTLIN" == "true" ]; then +if [ "${VALIDATE_KOTLIN}" == "true" ]; then ####################### # Lint the Kotlin files # ####################### @@ -1372,7 +1372,7 @@ fi ######################## # EDITORCONFIG LINTING # ######################## -if [ "$VALIDATE_EDITORCONFIG" == "true" ]; then +if [ "${VALIDATE_EDITORCONFIG}" == "true" ]; then #################################### # Lint the files with editorconfig # #################################### @@ -1383,30 +1383,30 @@ fi ################## # DART LINTING # ################## -if [ "$VALIDATE_DART" == "true" ]; then +if [ "${VALIDATE_DART}" == "true" ]; then ####################### # Lint the Dart files # ####################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "DART" "dart" "pub get || true && dartanalyzer --fatal-infos --fatal-warnings --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "${FILE_ARRAY_DART[@]}" + LintCodebase "DART" "dart" "pub get || true && dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "${FILE_ARRAY_DART[@]}" fi ################## # DOCKER LINTING # ################## -if [ "$VALIDATE_DOCKER" == "true" ]; then +if [ "${VALIDATE_DOCKER}" == "true" ]; then ######################### # Lint the docker files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" # NOTE: dockerfilelint's "-c" option expects the folder *containing* the DOCKER_LINTER_RULES file - LintCodebase "DOCKER" "dockerfilelint" "dockerfilelint -c $(dirname $DOCKER_LINTER_RULES)" ".*\(Dockerfile\)\$" "${FILE_ARRAY_DOCKER[@]}" + LintCodebase "DOCKER" "dockerfilelint" "dockerfilelint -c $(dirname ${DOCKER_LINTER_RULES})" ".*\(Dockerfile\)\$" "${FILE_ARRAY_DOCKER[@]}" fi ################### # CLOJURE LINTING # ################### -if [ "$VALIDATE_CLOJURE" == "true" ]; then +if [ "${VALIDATE_CLOJURE}" == "true" ]; then ################################# # Get Clojure standard rules # ################################# @@ -1414,24 +1414,24 @@ if [ "$VALIDATE_CLOJURE" == "true" ]; then ######################### # Lint the Clojure files # ######################### - LintCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES --lint" ".*\.\(clj\|cljs\|cljc\|edn\)\$" "${FILE_ARRAY_CLOJURE[@]}" + LintCodebase "CLOJURE" "clj-kondo" "clj-kondo --config ${CLOJURE_LINTER_RULES} --lint" ".*\.\(clj\|cljs\|cljc\|edn\)\$" "${FILE_ARRAY_CLOJURE[@]}" fi ################## # PROTOBUF LINTING # ################## -if [ "$VALIDATE_PROTOBUF" == "true" ]; then +if [ "${VALIDATE_PROTOBUF}" == "true" ]; then ####################### # Lint the Protocol Buffers files # ####################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "PROTOBUF" "protolint" "protolint lint --config_path $PROTOBUF_LINTER_RULES" ".*\.\(proto\)\$" "${FILE_ARRAY_PROTOBUF[@]}" + LintCodebase "PROTOBUF" "protolint" "protolint lint --config_path ${PROTOBUF_LINTER_RULES}" ".*\.\(proto\)\$" "${FILE_ARRAY_PROTOBUF[@]}" fi ###################### # POWERSHELL LINTING # ###################### -if [ "$VALIDATE_POWERSHELL" == "true" ]; then +if [ "${VALIDATE_POWERSHELL}" == "true" ]; then ############################################################### # For POWERSHELL, ensure PSScriptAnalyzer module is available # ############################################################### @@ -1441,55 +1441,55 @@ if [ "$VALIDATE_POWERSHELL" == "true" ]; then # Lint the powershell files # ############################# # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "POWERSHELL" "pwsh" "Invoke-ScriptAnalyzer -EnableExit -Settings $POWERSHELL_LINTER_RULES -Path" ".*\.\(ps1\|psm1\|psd1\|ps1xml\|pssc\|psrc\|cdxml\)\$" "${FILE_ARRAY_POWERSHELL[@]}" + LintCodebase "POWERSHELL" "pwsh" "Invoke-ScriptAnalyzer -EnableExit -Settings ${POWERSHELL_LINTER_RULES} -Path" ".*\.\(ps1\|psm1\|psd1\|ps1xml\|pssc\|psrc\|cdxml\)\$" "${FILE_ARRAY_POWERSHELL[@]}" fi ######################## # ARM Template LINTING # ######################## -if [ "$VALIDATE_ARM" == "true" ]; then +if [ "${VALIDATE_ARM}" == "true" ]; then ############################### # Lint the ARM Template files # ############################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "ARM" "arm-ttk" "Import-Module $ARM_TTK_PSD1 ; \$config = \$(Import-PowerShellDataFile -Path $ARM_LINTER_RULES) ; Test-AzTemplate @config -TemplatePath" ".*\.\(json\)\$" "${FILE_ARRAY_ARM[@]}" + LintCodebase "ARM" "arm-ttk" "Import-Module ${ARM_TTK_PSD1} ; \${config} = \$(Import-PowerShellDataFile -Path ${ARM_LINTER_RULES}) ; Test-AzTemplate @config -TemplatePath" ".*\.\(json\)\$" "${FILE_ARRAY_ARM[@]}" fi ################### # OPENAPI LINTING # ################### -if [ "$VALIDATE_OPENAPI" == "true" ]; then +if [ "${VALIDATE_OPENAPI}" == "true" ]; then # If we are validating all codebase we need to build file list because not every yml/json file is an OpenAPI file - if [ "$VALIDATE_ALL_CODEBASE" == "true" ]; then + if [ "${VALIDATE_ALL_CODEBASE}" == "true" ]; then ############################################################################### # Set the file seperator to newline to allow for grabbing objects with spaces # ############################################################################### IFS=$'\n' - mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE" -type f -regex ".*\.\(yml\|yaml\|json\)\$" 2>&1) + mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -type f -regex ".*\.\(yml\|yaml\|json\)\$" 2>&1) for FILE in "${LIST_FILES[@]}"; do - if DetectOpenAPIFile "$FILE"; then - FILE_ARRAY_OPENAPI+=("$FILE") + if DetectOpenAPIFile "${FILE}"; then + FILE_ARRAY_OPENAPI+=("${FILE}") fi done ########################### # Set IFS back to default # ########################### - IFS="$DEFAULT_IFS" + IFS="${DEFAULT_IFS}" fi ########################## # Lint the OpenAPI files # ########################## # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" "disabledfileext" "${FILE_ARRAY_OPENAPI[@]}" + LintCodebase "OPENAPI" "spectral" "spectral lint -r ${OPENAPI_LINTER_RULES}" "disabledfileext" "${FILE_ARRAY_OPENAPI[@]}" fi ################ # HTML LINTING # ################ -if [ "$VALIDATE_HTML" == "true" ]; then +if [ "${VALIDATE_HTML}" == "true" ]; then ################################# # Get HTML standard rules # ################################# @@ -1497,7 +1497,7 @@ if [ "$VALIDATE_HTML" == "true" ]; then ############################# # Lint the HTML files # ############################# - LintCodebase "HTML" "htmlhint" "htmlhint --config $HTML_LINTER_RULES" ".*\.\(html\)\$" "${FILE_ARRAY_HTML[@]}" + LintCodebase "HTML" "htmlhint" "htmlhint --config ${HTML_LINTER_RULES}" ".*\.\(html\)\$" "${FILE_ARRAY_HTML[@]}" fi ########## diff --git a/lib/validation.sh b/lib/validation.sh index 9be40a60..326a7a94 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -20,7 +20,7 @@ function GetValidationInfo() { ########################################### # Skip validation if were running locally # ########################################### - if [[ $RUN_LOCAL != "true" ]]; then + if [[ ${RUN_LOCAL} != "true" ]]; then ############################### # Convert string to lowercase # ############################### @@ -28,9 +28,9 @@ function GetValidationInfo() { ###################################### # Validate we should check all files # ###################################### - if [[ $VALIDATE_ALL_CODEBASE != "false" ]]; then + if [[ ${VALIDATE_ALL_CODEBASE} != "false" ]]; then # Set to true - VALIDATE_ALL_CODEBASE="$DEFAULT_VALIDATE_ALL_CODEBASE" + VALIDATE_ALL_CODEBASE="${DEFAULT_VALIDATE_ALL_CODEBASE}" echo "- Validating ALL files in code base..." else # Its false @@ -83,45 +83,45 @@ function GetValidationInfo() { # Determine if any linters were explicitly set # ################################################ ANY_SET="false" - if [[ -n $VALIDATE_YAML || -n \ - $VALIDATE_JSON || -n \ - $VALIDATE_XML || -n \ - $VALIDATE_MARKDOWN || -n \ - $VALIDATE_BASH || -n \ - $VALIDATE_PERL || -n \ - $VALIDATE_RAKU || -n \ - $VALIDATE_PHP || -n \ - $VALIDATE_PYTHON || -n \ - $VALIDATE_RUBY || -n \ - $VALIDATE_COFFEE || -n \ - $VALIDATE_ANSIBLE || -n \ - $VALIDATE_JAVASCRIPT_ES || -n \ - $VALIDATE_JAVASCRIPT_STANDARD || -n \ - $VALIDATE_TYPESCRIPT_ES || -n \ - $VALIDATE_TYPESCRIPT_STANDARD || -n \ - $VALIDATE_DOCKER || -n \ - $VALIDATE_GO || -n \ - $VALIDATE_TERRAFORM || -n \ - $VALIDATE_POWERSHELL || -n \ - $VALIDATE_ARM || -n \ - $VALIDATE_CSS || -n \ - $VALIDATE_ENV || -n \ - $VALIDATE_CLOJURE || -n \ - $VALIDATE_PROTOBUF || -n \ - $VALIDATE_OPENAPI || -n \ - $VALIDATE_KOTLIN || -n \ - $VALIDATE_DART || -n \ - $VALIDATE_EDITORCONFIG || -n \ - $VALIDATE_HTML ]]; then + if [[ -n ${VALIDATE_YAML} || -n \ + ${VALIDATE_JSON} || -n \ + ${VALIDATE_XML} || -n \ + ${VALIDATE_MARKDOWN} || -n \ + ${VALIDATE_BASH} || -n \ + ${VALIDATE_PERL} || -n \ + ${VALIDATE_RAKU} || -n \ + ${VALIDATE_PHP} || -n \ + ${VALIDATE_PYTHON} || -n \ + ${VALIDATE_RUBY} || -n \ + ${VALIDATE_COFFEE} || -n \ + ${VALIDATE_ANSIBLE} || -n \ + ${VALIDATE_JAVASCRIPT_ES} || -n \ + ${VALIDATE_JAVASCRIPT_STANDARD} || -n \ + ${VALIDATE_TYPESCRIPT_ES} || -n \ + ${VALIDATE_TYPESCRIPT_STANDARD} || -n \ + ${VALIDATE_DOCKER} || -n \ + ${VALIDATE_GO} || -n \ + ${VALIDATE_TERRAFORM} || -n \ + ${VALIDATE_POWERSHELL} || -n \ + ${VALIDATE_ARM} || -n \ + ${VALIDATE_CSS} || -n \ + ${VALIDATE_ENV} || -n \ + ${VALIDATE_CLOJURE} || -n \ + ${VALIDATE_PROTOBUF} || -n \ + ${VALIDATE_OPENAPI} || -n \ + ${VALIDATE_KOTLIN} || -n \ + ${VALIDATE_DART} || -n \ + ${VALIDATE_EDITORCONFIG} || -n \ + ${VALIDATE_HTML} ]]; then ANY_SET="true" fi #################################### # Validate if we should check YAML # #################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_YAML ]]; then + if [[ -z ${VALIDATE_YAML} ]]; then # YAML flag was not set - default to false VALIDATE_YAML="false" fi @@ -133,9 +133,9 @@ function GetValidationInfo() { #################################### # Validate if we should check JSON # #################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_JSON ]]; then + if [[ -z ${VALIDATE_JSON} ]]; then # JSON flag was not set - default to false VALIDATE_JSON="false" fi @@ -147,9 +147,9 @@ function GetValidationInfo() { ################################### # Validate if we should check XML # ################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_XML ]]; then + if [[ -z ${VALIDATE_XML} ]]; then # XML flag was not set - default to false VALIDATE_XML="false" fi @@ -161,9 +161,9 @@ function GetValidationInfo() { ######################################## # Validate if we should check MARKDOWN # ######################################## - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_MARKDOWN ]]; then + if [[ -z ${VALIDATE_MARKDOWN} ]]; then # MD flag was not set - default to false VALIDATE_MARKDOWN="false" fi @@ -175,9 +175,9 @@ function GetValidationInfo() { #################################### # Validate if we should check BASH # #################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_BASH ]]; then + if [[ -z ${VALIDATE_BASH} ]]; then # BASH flag was not set - default to false VALIDATE_BASH="false" fi @@ -189,9 +189,9 @@ function GetValidationInfo() { #################################### # Validate if we should check PERL # #################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_PERL ]]; then + if [[ -z ${VALIDATE_PERL} ]]; then # PERL flag was not set - default to false VALIDATE_PERL="false" fi @@ -203,9 +203,9 @@ function GetValidationInfo() { #################################### # Validate if we should check RAKU # #################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_RAKU ]]; then + if [[ -z ${VALIDATE_RAKU} ]]; then # RAKU flag was not set - default to false VALIDATE_RAKU="false" fi @@ -217,9 +217,9 @@ function GetValidationInfo() { #################################### # Validate if we should check PHP # #################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_PHP ]]; then + if [[ -z ${VALIDATE_PHP} ]]; then # PHP flag was not set - default to false VALIDATE_PHP="false" fi @@ -231,9 +231,9 @@ function GetValidationInfo() { ###################################### # Validate if we should check PYTHON # ###################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_PYTHON ]]; then + if [[ -z ${VALIDATE_PYTHON} ]]; then # PYTHON flag was not set - default to false VALIDATE_PYTHON="false" fi @@ -245,9 +245,9 @@ function GetValidationInfo() { #################################### # Validate if we should check RUBY # #################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_RUBY ]]; then + if [[ -z ${VALIDATE_RUBY} ]]; then # RUBY flag was not set - default to false VALIDATE_RUBY="false" fi @@ -259,9 +259,9 @@ function GetValidationInfo() { ###################################### # Validate if we should check COFFEE # ###################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_COFFEE ]]; then + if [[ -z ${VALIDATE_COFFEE} ]]; then # COFFEE flag was not set - default to false VALIDATE_COFFEE="false" fi @@ -273,9 +273,9 @@ function GetValidationInfo() { ####################################### # Validate if we should check ANSIBLE # ####################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_ANSIBLE ]]; then + if [[ -z ${VALIDATE_ANSIBLE} ]]; then # ANSIBLE flag was not set - default to false VALIDATE_ANSIBLE="false" fi @@ -287,9 +287,9 @@ function GetValidationInfo() { ############################################# # Validate if we should check JAVASCRIPT_ES # ############################################# - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_JAVASCRIPT_ES ]]; then + if [[ -z ${VALIDATE_JAVASCRIPT_ES} ]]; then # JAVASCRIPT_ES flag was not set - default to false VALIDATE_JAVASCRIPT_ES="false" fi @@ -301,9 +301,9 @@ function GetValidationInfo() { ################################################### # Validate if we should check JAVASCRIPT_STANDARD # ################################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_JAVASCRIPT_STANDARD ]]; then + if [[ -z ${VALIDATE_JAVASCRIPT_STANDARD} ]]; then # JAVASCRIPT_STANDARD flag was not set - default to false VALIDATE_JAVASCRIPT_STANDARD="false" fi @@ -315,9 +315,9 @@ function GetValidationInfo() { ############################################# # Validate if we should check JSX # ############################################# - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_JSX ]]; then + if [[ -z ${VALIDATE_JSX} ]]; then # JSX flag was not set - default to false VALIDATE_JSX="false" fi @@ -329,9 +329,9 @@ function GetValidationInfo() { ############################################# # Validate if we should check TSX # ############################################# - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_TSX ]]; then + if [[ -z ${VALIDATE_TSX} ]]; then # TSX flag was not set - default to false VALIDATE_TSX="false" fi @@ -343,9 +343,9 @@ function GetValidationInfo() { ############################################# # Validate if we should check TYPESCRIPT_ES # ############################################# - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_TYPESCRIPT_ES ]]; then + if [[ -z ${VALIDATE_TYPESCRIPT_ES} ]]; then # TYPESCRIPT_ES flag was not set - default to false VALIDATE_TYPESCRIPT_ES="false" fi @@ -357,9 +357,9 @@ function GetValidationInfo() { ################################################### # Validate if we should check TYPESCRIPT_STANDARD # ################################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_TYPESCRIPT_STANDARD ]]; then + if [[ -z ${VALIDATE_TYPESCRIPT_STANDARD} ]]; then # TYPESCRIPT_STANDARD flag was not set - default to false VALIDATE_TYPESCRIPT_STANDARD="false" fi @@ -371,9 +371,9 @@ function GetValidationInfo() { ###################################### # Validate if we should check DOCKER # ###################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_DOCKER ]]; then + if [[ -z ${VALIDATE_DOCKER} ]]; then # DOCKER flag was not set - default to false VALIDATE_DOCKER="false" fi @@ -385,9 +385,9 @@ function GetValidationInfo() { ################################## # Validate if we should check GO # ################################## - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_GO ]]; then + if [[ -z ${VALIDATE_GO} ]]; then # GO flag was not set - default to false VALIDATE_GO="false" fi @@ -399,9 +399,9 @@ function GetValidationInfo() { ######################################### # Validate if we should check TERRAFORM # ######################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_TERRAFORM ]]; then + if [[ -z ${VALIDATE_TERRAFORM} ]]; then # TERRAFORM flag was not set - default to false VALIDATE_TERRAFORM="false" fi @@ -413,9 +413,9 @@ function GetValidationInfo() { ######################################### # Validate if we should check POWERSHELL # ######################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_POWERSHELL ]]; then + if [[ -z ${VALIDATE_POWERSHELL} ]]; then # POWERSHELL flag was not set - default to false VALIDATE_POWERSHELL="false" fi @@ -427,9 +427,9 @@ function GetValidationInfo() { ################################### # Validate if we should check ARM # ################################### - if [[ "$ANY_SET" == "true" ]]; then + if [[ "${ANY_SET}" == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z "$VALIDATE_ARM" ]]; then + if [[ -z "${VALIDATE_ARM}" ]]; then # ARM flag was not set - default to false VALIDATE_ARM="false" fi @@ -441,9 +441,9 @@ function GetValidationInfo() { ################################### # Validate if we should check CSS # ################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_CSS ]]; then + if [[ -z ${VALIDATE_CSS} ]]; then # CSS flag was not set - default to false VALIDATE_CSS="false" fi @@ -455,9 +455,9 @@ function GetValidationInfo() { ################################### # Validate if we should check ENV # ################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_ENV ]]; then + if [[ -z ${VALIDATE_ENV} ]]; then # ENV flag was not set - default to false VALIDATE_ENV="false" fi @@ -469,9 +469,9 @@ function GetValidationInfo() { ###################################### # Validate if we should check KOTLIN # ###################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_KOTLIN ]]; then + if [[ -z ${VALIDATE_KOTLIN} ]]; then # ENV flag was not set - default to false VALIDATE_KOTLIN="false" fi @@ -483,9 +483,9 @@ function GetValidationInfo() { #################################### # Validate if we should check DART # #################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_DART ]]; then + if [[ -z ${VALIDATE_DART} ]]; then # ENV flag was not set - default to false VALIDATE_DART="false" fi @@ -497,9 +497,9 @@ function GetValidationInfo() { ####################################### # Validate if we should check OPENAPI # ####################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_OPENAPI ]]; then + if [[ -z ${VALIDATE_OPENAPI} ]]; then # OPENAPI flag was not set - default to false VALIDATE_OPENAPI="false" fi @@ -511,9 +511,9 @@ function GetValidationInfo() { ####################################### # Validate if we should check PROTOBUF # ####################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_PROTOBUF ]]; then + if [[ -z ${VALIDATE_PROTOBUF} ]]; then # PROTOBUF flag was not set - default to false VALIDATE_PROTOBUF="false" fi @@ -525,9 +525,9 @@ function GetValidationInfo() { ####################################### # Validate if we should check Clojure # ####################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_CLOJURE ]]; then + if [[ -z ${VALIDATE_CLOJURE} ]]; then # Clojure flag was not set - default to false VALIDATE_CLOJURE="false" fi @@ -539,16 +539,16 @@ function GetValidationInfo() { ############################################ # Validate if we should check editorconfig # ############################################ - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_EDITORCONFIG ]]; then + if [[ -z ${VALIDATE_EDITORCONFIG} ]]; then # EDITORCONFIG flag was not set - default to false VALIDATE_EDITORCONFIG="false" fi else # No linter flags were set # special case checking for .editorconfig - if [ -f "$GITHUB_WORKSPACE/.editorconfig" ]; then + if [ -f "${GITHUB_WORKSPACE}/.editorconfig" ]; then VALIDATE_EDITORCONFIG="true" fi fi @@ -556,9 +556,9 @@ function GetValidationInfo() { #################################### # Validate if we should check HTML # #################################### - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_HTML ]]; then + if [[ -z ${VALIDATE_HTML} ]]; then # HTML flag was not set - default to false VALIDATE_HTML="false" fi @@ -570,152 +570,152 @@ function GetValidationInfo() { ####################################### # Print which linters we are enabling # ####################################### - if [[ $VALIDATE_YAML == "true" ]]; then + if [[ ${VALIDATE_YAML} == "true" ]]; then PRINT_ARRAY+=("- Validating [YAML] files in code base...") else PRINT_ARRAY+=("- Excluding [YAML] files in code base...") fi - if [[ $VALIDATE_JSON == "true" ]]; then + if [[ ${VALIDATE_JSON} == "true" ]]; then PRINT_ARRAY+=("- Validating [JSON] files in code base...") else PRINT_ARRAY+=("- Excluding [JSON] files in code base...") fi - if [[ $VALIDATE_XML == "true" ]]; then + if [[ ${VALIDATE_XML} == "true" ]]; then PRINT_ARRAY+=("- Validating [XML] files in code base...") else PRINT_ARRAY+=("- Excluding [XML] files in code base...") fi - if [[ $VALIDATE_MARKDOWN == "true" ]]; then + if [[ ${VALIDATE_MARKDOWN} == "true" ]]; then PRINT_ARRAY+=("- Validating [MARKDOWN] files in code base...") else PRINT_ARRAY+=("- Excluding [MARKDOWN] files in code base...") fi - if [[ $VALIDATE_BASH == "true" ]]; then + if [[ ${VALIDATE_BASH} == "true" ]]; then PRINT_ARRAY+=("- Validating [BASH] files in code base...") else PRINT_ARRAY+=("- Excluding [BASH] files in code base...") fi - if [[ $VALIDATE_PERL == "true" ]]; then + if [[ ${VALIDATE_PERL} == "true" ]]; then PRINT_ARRAY+=("- Validating [PERL] files in code base...") else PRINT_ARRAY+=("- Excluding [PERL] files in code base...") fi - if [[ $VALIDATE_RAKU == "true" ]]; then + if [[ ${VALIDATE_RAKU} == "true" ]]; then PRINT_ARRAY+=("- Validating [RAKU] files in code base...") else PRINT_ARRAY+=("- Excluding [RAKU] files in code base...") fi - if [[ $VALIDATE_PHP == "true" ]]; then + if [[ ${VALIDATE_PHP} == "true" ]]; then PRINT_ARRAY+=("- Validating [PHP] files in code base...") else PRINT_ARRAY+=("- Excluding [PHP] files in code base...") fi - if [[ $VALIDATE_PYTHON == "true" ]]; then + if [[ ${VALIDATE_PYTHON} == "true" ]]; then PRINT_ARRAY+=("- Validating [PYTHON] files in code base...") else PRINT_ARRAY+=("- Excluding [PYTHON] files in code base...") fi - if [[ $VALIDATE_RUBY == "true" ]]; then + if [[ ${VALIDATE_RUBY} == "true" ]]; then PRINT_ARRAY+=("- Validating [RUBY] files in code base...") else PRINT_ARRAY+=("- Excluding [RUBY] files in code base...") fi - if [[ $VALIDATE_COFFEE == "true" ]]; then + if [[ ${VALIDATE_COFFEE} == "true" ]]; then PRINT_ARRAY+=("- Validating [COFFEE] files in code base...") else PRINT_ARRAY+=("- Excluding [COFFEE] files in code base...") fi - if [[ $VALIDATE_ANSIBLE == "true" ]]; then + if [[ ${VALIDATE_ANSIBLE} == "true" ]]; then PRINT_ARRAY+=("- Validating [ANSIBLE] files in code base...") else PRINT_ARRAY+=("- Excluding [ANSIBLE] files in code base...") fi - if [[ $VALIDATE_JAVASCRIPT_ES == "true" ]]; then + if [[ ${VALIDATE_JAVASCRIPT_ES} == "true" ]]; then PRINT_ARRAY+=("- Validating [JAVASCRIPT(eslint)] files in code base...") else PRINT_ARRAY+=("- Excluding [JAVASCRIPT(eslint)] files in code base...") fi - if [[ $VALIDATE_JAVASCRIPT_STANDARD == "true" ]]; then + if [[ ${VALIDATE_JAVASCRIPT_STANDARD} == "true" ]]; then PRINT_ARRAY+=("- Validating [JAVASCRIPT(standard)] files in code base...") else PRINT_ARRAY+=("- Excluding [JAVASCRIPT(standard)] files in code base...") fi - if [[ $VALIDATE_TYPESCRIPT_ES == "true" ]]; then + if [[ ${VALIDATE_TYPESCRIPT_ES} == "true" ]]; then PRINT_ARRAY+=("- Validating [TYPESCRIPT(eslint)] files in code base...") else PRINT_ARRAY+=("- Excluding [TYPESCRIPT(eslint)] files in code base...") fi - if [[ $VALIDATE_TYPESCRIPT_STANDARD == "true" ]]; then + if [[ ${VALIDATE_TYPESCRIPT_STANDARD} == "true" ]]; then PRINT_ARRAY+=("- Validating [TYPESCRIPT(standard)] files in code base...") else PRINT_ARRAY+=("- Excluding [TYPESCRIPT(standard)] files in code base...") fi - if [[ $VALIDATE_DOCKER == "true" ]]; then + if [[ ${VALIDATE_DOCKER} == "true" ]]; then PRINT_ARRAY+=("- Validating [DOCKER] files in code base...") else PRINT_ARRAY+=("- Excluding [DOCKER] files in code base...") fi - if [[ $VALIDATE_GO == "true" ]]; then + if [[ ${VALIDATE_GO} == "true" ]]; then PRINT_ARRAY+=("- Validating [GOLANG] files in code base...") else PRINT_ARRAY+=("- Excluding [GOLANG] files in code base...") fi - if [[ $VALIDATE_TERRAFORM == "true" ]]; then + if [[ ${VALIDATE_TERRAFORM} == "true" ]]; then PRINT_ARRAY+=("- Validating [TERRAFORM] files in code base...") else PRINT_ARRAY+=("- Excluding [TERRAFORM] files in code base...") fi - if [[ $VALIDATE_POWERSHELL == "true" ]]; then + if [[ ${VALIDATE_POWERSHELL} == "true" ]]; then PRINT_ARRAY+=("- Validating [POWERSHELL] files in code base...") else PRINT_ARRAY+=("- Excluding [POWERSHELL] files in code base...") fi - if [[ $VALIDATE_ARM == "true" ]]; then + if [[ ${VALIDATE_ARM} == "true" ]]; then PRINT_ARRAY+=("- Validating [ARM] files in code base...") else PRINT_ARRAY+=("- Excluding [ARM] files in code base...") fi - if [[ $VALIDATE_CSS == "true" ]]; then + if [[ ${VALIDATE_CSS} == "true" ]]; then PRINT_ARRAY+=("- Validating [CSS] files in code base...") else PRINT_ARRAY+=("- Excluding [CSS] files in code base...") fi - if [[ $VALIDATE_CLOJURE == "true" ]]; then + if [[ ${VALIDATE_CLOJURE} == "true" ]]; then PRINT_ARRAY+=("- Validating [CLOJURE] files in code base...") else PRINT_ARRAY+=("- Excluding [CLOJURE] files in code base...") fi - if [[ $VALIDATE_ENV == "true" ]]; then + if [[ ${VALIDATE_ENV} == "true" ]]; then PRINT_ARRAY+=("- Validating [ENV] files in code base...") else PRINT_ARRAY+=("- Excluding [ENV] files in code base...") fi - if [[ $VALIDATE_KOTLIN == "true" ]]; then + if [[ ${VALIDATE_KOTLIN} == "true" ]]; then PRINT_ARRAY+=("- Validating [KOTLIN] files in code base...") else PRINT_ARRAY+=("- Excluding [KOTLIN] files in code base...") fi - if [[ $VALIDATE_OPENAPI == "true" ]]; then + if [[ ${VALIDATE_OPENAPI} == "true" ]]; then PRINT_ARRAY+=("- Validating [OPENAPI] files in code base...") else PRINT_ARRAY+=("- Excluding [OPENAPI] files in code base...") fi - if [[ $VALIDATE_PROTOBUF == "true" ]]; then + if [[ ${VALIDATE_PROTOBUF} == "true" ]]; then PRINT_ARRAY+=("- Validating [PROTOBUF] files in code base...") else PRINT_ARRAY+=("- Excluding [PROTOBUF] files in code base...") fi - if [[ $VALIDATE_DART == "true" ]]; then + if [[ ${VALIDATE_DART} == "true" ]]; then PRINT_ARRAY+=("- Validating [DART] files in code base...") else PRINT_ARRAY+=("- Excluding [DART] files in code base...") fi - if [[ $VALIDATE_EDITORCONFIG == "true" ]]; then + if [[ ${VALIDATE_EDITORCONFIG} == "true" ]]; then PRINT_ARRAY+=("- Validating [EDITORCONFIG] files in code base...") else PRINT_ARRAY+=("- Excluding [EDITORCONFIG] files in code base...") fi - if [[ $VALIDATE_HTML == "true" ]]; then + if [[ ${VALIDATE_HTML} == "true" ]]; then PRINT_ARRAY+=("- Validating [HTML] files in code base...") else PRINT_ARRAY+=("- Excluding [HTML] files in code base...") @@ -724,9 +724,9 @@ function GetValidationInfo() { ############################## # Validate Ansible Directory # ############################## - if [ -z "$ANSIBLE_DIRECTORY" ]; then + if [ -z "${ANSIBLE_DIRECTORY}" ]; then # No Value, need to default - ANSIBLE_DIRECTORY="$DEFAULT_ANSIBLE_DIRECTORY" + ANSIBLE_DIRECTORY="${DEFAULT_ANSIBLE_DIRECTORY}" else # Check if first char is '/' if [[ ${ANSIBLE_DIRECTORY:0:1} == "/" ]]; then @@ -734,19 +734,19 @@ function GetValidationInfo() { ANSIBLE_DIRECTORY="${ANSIBLE_DIRECTORY:1}" fi # Need to give it full path - TEMP_ANSIBLE_DIRECTORY="$GITHUB_WORKSPACE/$ANSIBLE_DIRECTORY" + TEMP_ANSIBLE_DIRECTORY="${GITHUB_WORKSPACE}/${ANSIBLE_DIRECTORY}" # Set the value - ANSIBLE_DIRECTORY="$TEMP_ANSIBLE_DIRECTORY" + ANSIBLE_DIRECTORY="${TEMP_ANSIBLE_DIRECTORY}" fi ############################### # Get the disable errors flag # ############################### - if [ -z "$DISABLE_ERRORS" ]; then + if [ -z "${DISABLE_ERRORS}" ]; then ################################## # No flag passed, set to default # ################################## - DISABLE_ERRORS="$DEFAULT_DISABLE_ERRORS" + DISABLE_ERRORS="${DEFAULT_DISABLE_ERRORS}" fi ############################### @@ -757,18 +757,18 @@ function GetValidationInfo() { ############################ # Set to false if not true # ############################ - if [ "$DISABLE_ERRORS" != "true" ]; then + if [ "${DISABLE_ERRORS}" != "true" ]; then DISABLE_ERRORS="false" fi ############################ # Get the run verbose flag # ############################ - if [ -z "$ACTIONS_RUNNER_DEBUG" ]; then + if [ -z "${ACTIONS_RUNNER_DEBUG}" ]; then ################################## # No flag passed, set to default # ################################## - ACTIONS_RUNNER_DEBUG="$DEFAULT_ACTIONS_RUNNER_DEBUG" + ACTIONS_RUNNER_DEBUG="${DEFAULT_ACTIONS_RUNNER_DEBUG}" fi ############################### @@ -779,25 +779,25 @@ function GetValidationInfo() { ############################ # Set to true if not false # ############################ - if [ "$ACTIONS_RUNNER_DEBUG" != "false" ]; then + if [ "${ACTIONS_RUNNER_DEBUG}" != "false" ]; then ACTIONS_RUNNER_DEBUG="true" fi ################### # Debug on runner # ################### - if [[ $ACTIONS_RUNNER_DEBUG == "true" ]]; then + if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then ########################### # Print the validate info # ########################### for LINE in "${PRINT_ARRAY[@]}"; do - echo "$LINE" + echo "${LINE}" done echo "--- DEBUG INFO ---" echo "---------------------------------------------" RUNNER=$(whoami) - echo "Runner:[$RUNNER]" + echo "Runner:[${RUNNER}]" echo "ENV:" printenv echo "---------------------------------------------" diff --git a/lib/worker.sh b/lib/worker.sh index 17db091c..4662b7dd 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -13,11 +13,11 @@ function LintCodebase() { #################### # Pull in the vars # #################### - FILE_TYPE="$1" && shift # Pull the variable and remove from array path (Example: JSON) - LINTER_NAME="$1" && shift # Pull the variable and remove from array path (Example: jsonlint) - LINTER_COMMAND="$1" && shift # Pull the variable and remove from array path (Example: jsonlint -c ConfigFile /path/to/file) - FILE_EXTENSIONS="$1" && shift # Pull the variable and remove from array path (Example: *.json) - FILE_ARRAY=("$@") # Array of files to validate (Example: $FILE_ARRAY_JSON) + FILE_TYPE="${1}" && shift # Pull the variable and remove from array path (Example: JSON) + LINTER_NAME="${1}" && shift # Pull the variable and remove from array path (Example: jsonlint) + LINTER_COMMAND="${1}" && shift # Pull the variable and remove from array path (Example: jsonlint -c ConfigFile /path/to/file) + FILE_EXTENSIONS="${1}" && shift # Pull the variable and remove from array path (Example: *.json) + FILE_ARRAY=("$@") # Array of files to validate (Example: ${FILE_ARRAY_JSON}) ###################### # Create Print Array # @@ -30,14 +30,14 @@ function LintCodebase() { PRINT_ARRAY+=("") PRINT_ARRAY+=("----------------------------------------------") PRINT_ARRAY+=("----------------------------------------------") - PRINT_ARRAY+=("Linting [$FILE_TYPE] files...") + PRINT_ARRAY+=("Linting [${FILE_TYPE}] files...") PRINT_ARRAY+=("----------------------------------------------") PRINT_ARRAY+=("----------------------------------------------") ##################################### # Validate we have linter installed # ##################################### - VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) + VALIDATE_INSTALL_CMD=$(command -v "${LINTER_NAME}" 2>&1) ####################### # Load the error code # @@ -47,15 +47,15 @@ function LintCodebase() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # Failed - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to find [$LINTER_NAME] in system!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$VALIDATE_INSTALL_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to find [${LINTER_NAME}] in system!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${VALIDATE_INSTALL_CMD}]${NC}" exit 1 else # Success - if [[ $ACTIONS_RUNNER_DEBUG == "true" ]]; then - echo -e "${NC}${F[B]}Successfully found binary for ${F[W]}[$LINTER_NAME]${F[B]} in system location: ${F[W]}[$VALIDATE_INSTALL_CMD]${NC}" + if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then + echo -e "${NC}${F[B]}Successfully found binary for ${F[W]}[${LINTER_NAME}]${F[B]} in system location: ${F[W]}[${VALIDATE_INSTALL_CMD}]${NC}" fi fi @@ -72,10 +72,10 @@ function LintCodebase() { ############################################################ # Check to see if we need to go through array or all files # ############################################################ - if [ ${#FILE_ARRAY[@]} -eq 0 ] && [ "$VALIDATE_ALL_CODEBASE" == "false" ]; then + if [ ${#FILE_ARRAY[@]} -eq 0 ] && [ "${VALIDATE_ALL_CODEBASE}" == "false" ]; then # No files found in commit and user has asked to not validate code base SKIP_FLAG=1 - # echo " - No files found in changeset to lint for language:[$FILE_TYPE]" + # echo " - No files found in changeset to lint for language:[${FILE_TYPE}]" elif [ ${#FILE_ARRAY[@]} -ne 0 ]; then # We have files added to array of files to check LIST_FILES=("${FILE_ARRAY[@]}") # Copy the array into list @@ -88,12 +88,12 @@ function LintCodebase() { ################################# # Get list of all files to lint # ################################# - mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE" -type f -regex "$FILE_EXTENSIONS" 2>&1) + mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -type f -regex "${FILE_EXTENSIONS}" 2>&1) ########################### # Set IFS back to default # ########################### - IFS="$DEFAULT_IFS" + IFS="${DEFAULT_IFS}" ############################################################ # Set it back to empty if loaded with blanks from scanning # @@ -113,7 +113,7 @@ function LintCodebase() { ############################### # Check if any data was found # ############################### - if [ $SKIP_FLAG -eq 0 ]; then + if [ ${SKIP_FLAG} -eq 0 ]; then ###################### # Print Header array # ###################### @@ -121,7 +121,7 @@ function LintCodebase() { ######################### # Print the header info # ######################### - echo "$LINE" + echo "${LINE}" done ######################################## @@ -141,18 +141,18 @@ function LintCodebase() { ##################### # Get the file name # ##################### - FILE_NAME=$(basename "$FILE" 2>&1) + FILE_NAME=$(basename "${FILE}" 2>&1) ##################################################### # Make sure we dont lint node modules or test cases # ##################################################### - if [[ $FILE == *"node_modules"* ]]; then + if [[ ${FILE} == *"node_modules"* ]]; then # This is a node modules file continue - elif [[ $FILE == *"$TEST_CASE_FOLDER"* ]]; then + elif [[ ${FILE} == *"${TEST_CASE_FOLDER}"* ]]; then # This is the test cases, we should always skip continue - elif [[ $FILE == *".git"* ]]; then + elif [[ ${FILE} == *".git"* ]]; then # This is likely the .git folder and shouldnt be parsed continue fi @@ -166,12 +166,12 @@ function LintCodebase() { # File print # ############## echo "---------------------------" - echo "File:[$FILE]" + echo "File:[${FILE}]" ################################# # Add the language to the array # ################################# - LINTED_LANGUAGES_ARRAY+=("$FILE_TYPE") + LINTED_LANGUAGES_ARRAY+=("${FILE_TYPE}") #################### # Set the base Var # @@ -183,14 +183,14 @@ function LintCodebase() { # - PowerShell (PSScriptAnalyzer) # # - ARM (arm-ttk) # #################################### - if [[ $FILE_TYPE == "POWERSHELL" ]] || [[ $FILE_TYPE == "ARM" ]]; then + if [[ ${FILE_TYPE} == "POWERSHELL" ]] || [[ ${FILE_TYPE} == "ARM" ]]; then ################################ # Lint the file with the rules # ################################ # Need to run PowerShell commands using pwsh -c, also exit with exit code from inner subshell LINT_CMD=$( - cd "$GITHUB_WORKSPACE" || exit - pwsh -NoProfile -NoLogo -Command "$LINTER_COMMAND $FILE; if (\$Error.Count) { exit 1 }" + cd "${GITHUB_WORKSPACE}" || exit + pwsh -NoProfile -NoLogo -Command "${LINTER_COMMAND} ${FILE}; if (\${Error}.Count) { exit 1 }" exit $? 2>&1 ) else @@ -198,8 +198,8 @@ function LintCodebase() { # Lint the file with the rules # ################################ LINT_CMD=$( - cd "$GITHUB_WORKSPACE" || exit - $LINTER_COMMAND "$FILE" 2>&1 + cd "${GITHUB_WORKSPACE}" || exit + ${LINTER_COMMAND} "${FILE}" 2>&1 ) fi @@ -211,27 +211,27 @@ function LintCodebase() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then ######### # Error # ######### - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [$LINTER_NAME] linter!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$LINT_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [${LINTER_NAME}] linter!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LINT_CMD}]${NC}" # Increment the error count - (("ERRORS_FOUND_$FILE_TYPE++")) + (("ERRORS_FOUND_${FILE_TYPE}++")) ####################################################### # Store the linting as a temporary file in TAP format # ####################################################### if IsTAP ; then NotOkTap "${INDEX}" "${FILE}" "${TMPFILE}" - AddDetailedMessageIfEnabled "$LINT_CMD" "${TMPFILE}" + AddDetailedMessageIfEnabled "${LINT_CMD}" "${TMPFILE}" fi else ########### # Success # ########### - echo -e "${NC}${F[B]} - File:${F[W]}[$FILE_NAME]${F[B]} was linted with ${F[W]}[$LINTER_NAME]${F[B]} successfully${NC}" + echo -e "${NC}${F[B]} - File:${F[W]}[${FILE_NAME}]${F[B]} was linted with ${F[W]}[${LINTER_NAME}]${F[B]} successfully${NC}" ####################################################### # Store the linting as a temporary file in TAP format # @@ -257,11 +257,11 @@ function TestCodebase() { #################### # Pull in the vars # #################### - FILE_TYPE="$1" # Pull the variable and remove from array path (Example: JSON) - LINTER_NAME="$2" # Pull the variable and remove from array path (Example: jsonlint) - LINTER_COMMAND="$3" # Pull the variable and remove from array path (Example: jsonlint -c ConfigFile /path/to/file) - FILE_EXTENSIONS="$4" # Pull the variable and remove from array path (Example: *.json) - INDVIDUAL_TEST_FOLDER="$5" # Folder for specific tests + FILE_TYPE="${1}" # Pull the variable and remove from array path (Example: JSON) + LINTER_NAME="${2}" # Pull the variable and remove from array path (Example: jsonlint) + LINTER_COMMAND="${3}" # Pull the variable and remove from array path (Example: jsonlint -c ConfigFile /path/to/file) + FILE_EXTENSIONS="${4}" # Pull the variable and remove from array path (Example: *.json) + INDVIDUAL_TEST_FOLDER="${5}" # Folder for specific tests TESTS_RAN=0 # Incremented when tests are ran, this will help find failed finds ################ @@ -270,7 +270,7 @@ function TestCodebase() { echo "" echo "----------------------------------------------" echo "----------------------------------------------" - echo "Testing Codebase [$FILE_TYPE] files..." + echo "Testing Codebase [${FILE_TYPE}] files..." echo "----------------------------------------------" echo "----------------------------------------------" echo "" @@ -278,7 +278,7 @@ function TestCodebase() { ##################################### # Validate we have linter installed # ##################################### - VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) + VALIDATE_INSTALL_CMD=$(command -v "${LINTER_NAME}" 2>&1) ####################### # Load the error code # @@ -288,14 +288,14 @@ function TestCodebase() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # Failed - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to find [$LINTER_NAME] in system!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$VALIDATE_INSTALL_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to find [${LINTER_NAME}] in system!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${VALIDATE_INSTALL_CMD}]${NC}" exit 1 else # Success - echo -e "${NC}${F[B]}Successfully found binary for ${F[W]}[$LINTER_NAME]${F[B]} in system location: ${F[W]}[$VALIDATE_INSTALL_CMD]${NC}" + echo -e "${NC}${F[B]}Successfully found binary for ${F[W]}[${LINTER_NAME}]${F[B]} in system location: ${F[W]}[${VALIDATE_INSTALL_CMD}]${NC}" fi ########################## @@ -306,7 +306,7 @@ function TestCodebase() { ################################# # Get list of all files to lint # ################################# - mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER" -type f -regex "$FILE_EXTENSIONS" ! -path "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/ansible/ghe-initialize/*" | sort 2>&1) + mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}/${INDVIDUAL_TEST_FOLDER}" -type f -regex "${FILE_EXTENSIONS}" ! -path "${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}/ansible/ghe-initialize/*" | sort 2>&1) ######################################## # Prepare context if TAP output format # @@ -324,18 +324,18 @@ function TestCodebase() { ##################### # Get the file name # ##################### - FILE_NAME=$(basename "$FILE" 2>&1) + FILE_NAME=$(basename "${FILE}" 2>&1) ############################ # Get the file pass status # ############################ # Example: markdown_good_1.md -> good - FILE_STATUS=$(echo "$FILE_NAME" | cut -f2 -d'_') + FILE_STATUS=$(echo "${FILE_NAME}" | cut -f2 -d'_') ######################################################### # If not found, assume it should be linted successfully # ######################################################### - if [ -z "$FILE_STATUS" ] || [[ $FILE == *"README"* ]]; then + if [ -z "${FILE_STATUS}" ] || [[ ${FILE} == *"README"* ]]; then ################################## # Set to good for proper linting # ################################## @@ -346,7 +346,7 @@ function TestCodebase() { # File print # ############## echo "---------------------------" - echo "File:[$FILE]" + echo "File:[${FILE}]" ######################## # Set the lint command # @@ -356,8 +356,8 @@ function TestCodebase() { ####################################### # Check if docker and get folder name # ####################################### - if [[ $FILE_TYPE == "DOCKER" ]]; then - if [[ $FILE == *"good"* ]]; then + if [[ ${FILE_TYPE} == "DOCKER" ]]; then + if [[ ${FILE} == *"good"* ]]; then ############# # Good file # ############# @@ -373,11 +373,11 @@ function TestCodebase() { ##################### # Check for ansible # ##################### - if [[ $FILE_TYPE == "ANSIBLE" ]]; then + if [[ ${FILE_TYPE} == "ANSIBLE" ]]; then ######################################## # Make sure we dont lint certain files # ######################################## - if [[ $FILE == *"vault.yml"* ]] || [[ $FILE == *"galaxy.yml"* ]]; then + if [[ ${FILE} == *"vault.yml"* ]] || [[ ${FILE} == *"galaxy.yml"* ]]; then # This is a file we dont look at continue fi @@ -386,17 +386,17 @@ function TestCodebase() { # Lint the file with the rules # ################################ LINT_CMD=$( - cd "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER" || exit - $LINTER_COMMAND "$FILE" 2>&1 + cd "${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}/${INDVIDUAL_TEST_FOLDER}" || exit + ${LINTER_COMMAND} "${FILE}" 2>&1 ) - elif [[ $FILE_TYPE == "POWERSHELL" ]] || [[ $FILE_TYPE == "ARM" ]]; then + elif [[ ${FILE_TYPE} == "POWERSHELL" ]] || [[ ${FILE_TYPE} == "ARM" ]]; then ################################ # Lint the file with the rules # ################################ # Need to run PowerShell commands using pwsh -c, also exit with exit code from inner subshell LINT_CMD=$( - cd "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER" || exit - pwsh -NoProfile -NoLogo -Command "$LINTER_COMMAND $FILE; if (\$Error.Count) { exit 1 }" + cd "${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}" || exit + pwsh -NoProfile -NoLogo -Command "${LINTER_COMMAND} ${FILE}; if (\${Error}.Count) { exit 1 }" exit $? 2>&1 ) else @@ -404,8 +404,8 @@ function TestCodebase() { # Lint the file with the rules # ################################ LINT_CMD=$( - cd "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER" || exit - $LINTER_COMMAND "$FILE" 2>&1 + cd "${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}" || exit + ${LINTER_COMMAND} "${FILE}" 2>&1 ) fi @@ -422,24 +422,24 @@ function TestCodebase() { ######################################## # Check for if it was supposed to pass # ######################################## - if [[ $FILE_STATUS == "good" ]]; then + if [[ ${FILE_STATUS} == "good" ]]; then ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then ######### # Error # ######### - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [$LINTER_NAME] linter!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$LINT_CMD]${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Linter CMD:[$LINTER_COMMAND $FILE]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [${LINTER_NAME}] linter!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LINT_CMD}]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Linter CMD:[${LINTER_COMMAND} ${FILE}]${NC}" # Increment the error count - (("ERRORS_FOUND_$FILE_TYPE++")) + (("ERRORS_FOUND_${FILE_TYPE}++")) else ########### # Success # ########### - echo -e "${NC}${F[B]} - File:${F[W]}[$FILE_NAME]${F[B]} was linted with ${F[W]}[$LINTER_NAME]${F[B]} successfully${NC}" + echo -e "${NC}${F[B]} - File:${F[W]}[${FILE_NAME}]${F[B]} was linted with ${F[W]}[${LINTER_NAME}]${F[B]} successfully${NC}" fi ####################################################### # Store the linting as a temporary file in TAP format # @@ -454,28 +454,28 @@ function TestCodebase() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -eq 0 ]; then + if [ ${ERROR_CODE} -eq 0 ]; then ######### # Error # ######### - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [$LINTER_NAME] linter!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [${LINTER_NAME}] linter!${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} This file should have failed test case!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$LINT_CMD]${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Linter CMD:[$LINTER_COMMAND $FILE]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LINT_CMD}]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Linter CMD:[${LINTER_COMMAND} ${FILE}]${NC}" # Increment the error count - (("ERRORS_FOUND_$FILE_TYPE++")) + (("ERRORS_FOUND_${FILE_TYPE}++")) else ########### # Success # ########### - echo -e "${NC}${F[B]} - File:${F[W]}[$FILE_NAME]${F[B]} failed test case with ${F[W]}[$LINTER_NAME]${F[B]} successfully${NC}" + echo -e "${NC}${F[B]} - File:${F[W]}[${FILE_NAME}]${F[B]} failed test case with ${F[W]}[${LINTER_NAME}]${F[B]} successfully${NC}" fi ####################################################### # Store the linting as a temporary file in TAP format # ####################################################### if IsTAP ; then NotOkTap "${TESTS_RAN}" "${FILE_NAME}" "${TMPFILE}" - AddDetailedMessageIfEnabled "$LINT_CMD" "${TMPFILE}" + AddDetailedMessageIfEnabled "${LINT_CMD}" "${TMPFILE}" fi fi done @@ -490,24 +490,24 @@ function TestCodebase() { ######################################################################## # If expected TAP report exists then compare with the generated report # ######################################################################## - EXPECTED_FILE="$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER/reports/expected-${FILE_TYPE}.tap" - if [ -e "$EXPECTED_FILE" ] ; then + EXPECTED_FILE="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}/${INDVIDUAL_TEST_FOLDER}/reports/expected-${FILE_TYPE}.tap" + if [ -e "${EXPECTED_FILE}" ] ; then TMPFILE=$(mktemp -q "/tmp/diff-${FILE_TYPE}.XXXXXX") ## Ignore white spaces, case sensitive if ! diff -a -w -i "${EXPECTED_FILE}" "${REPORT_OUTPUT_FILE}" > "${TMPFILE}" 2>&1; then ############################################# # We failed to compare the reporting output # ############################################# - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to assert TAP output:[$LINTER_NAME]${NC}"! + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to assert TAP output:[${LINTER_NAME}]${NC}"! echo "Please validate the asserts!" cat "${TMPFILE}" exit 1 else # Success - echo -e "${NC}${F[B]}Successfully validation in the expected TAP format for ${F[W]}[$LINTER_NAME]${NC}" + echo -e "${NC}${F[B]}Successfully validation in the expected TAP format for ${F[W]}[${LINTER_NAME}]${NC}" fi else - echo -e "${NC}${F[Y]}WARN!${NC} No TAP expected file found at:[$EXPECTED_FILE]${NC}" + echo -e "${NC}${F[Y]}WARN!${NC} No TAP expected file found at:[${EXPECTED_FILE}]${NC}" echo "skipping report assertions" ##################################### # Append the file type to the array # @@ -519,11 +519,11 @@ function TestCodebase() { ############################## # Validate we ran some tests # ############################## - if [ "$TESTS_RAN" -eq 0 ]; then + if [ "${TESTS_RAN}" -eq 0 ]; then ################################################# # We failed to find files and no tests were ran # ################################################# - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to find any tests ran for the Linter:[$LINTER_NAME]${NC}"! + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to find any tests ran for the Linter:[${LINTER_NAME}]${NC}"! echo "Please validate logic or that tests exist!" exit 1 fi @@ -552,37 +552,37 @@ function RunTestCases() { # Test case languages # ####################### # TestCodebase "Language" "Linter" "Linter-command" "Regex to find files" "Test Folder" - TestCodebase "ANSIBLE" "ansible-lint" "ansible-lint -v -c $ANSIBLE_LINTER_RULES" ".*\.\(yml\|yaml\)\$" "ansible" - TestCodebase "ARM" "arm-ttk" "Import-Module $ARM_TTK_PSD1 ; \$config = \$(Import-PowerShellDataFile -Path $ARM_LINTER_RULES) ; Test-AzTemplate @config -TemplatePath" ".*\.\(json\)\$" "arm" + TestCodebase "ANSIBLE" "ansible-lint" "ansible-lint -v -c ${ANSIBLE_LINTER_RULES}" ".*\.\(yml\|yaml\)\$" "ansible" + TestCodebase "ARM" "arm-ttk" "Import-Module ${ARM_TTK_PSD1} ; \${config} = \$(Import-PowerShellDataFile -Path ${ARM_LINTER_RULES}) ; Test-AzTemplate @config -TemplatePath" ".*\.\(json\)\$" "arm" TestCodebase "BASH" "shellcheck" "shellcheck --color" ".*\.\(sh\|bash\|dash\|ksh\)\$" "shell" - TestCodebase "CFN" "cfn-lint" "cfn-lint --config-file $CFN_LINTER_RULES" ".*\.\(json\|yml\|yaml\)\$" "cfn" - TestCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES --lint" ".*\.\(clj\|cljs\|cljc\|edn\)\$" "clojure" - TestCodebase "COFFEESCRIPT" "coffeelint" "coffeelint -f $COFFEESCRIPT_LINTER_RULES" ".*\.\(coffee\)\$" "coffeescript" - TestCodebase "CSS" "stylelint" "stylelint --config $CSS_LINTER_RULES" ".*\.\(css\)\$" "css" - TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart" - TestCodebase "DOCKER" "dockerfilelint" "dockerfilelint -c $DOCKER_LINTER_RULES" ".*\(Dockerfile\)\$" "docker" + TestCodebase "CFN" "cfn-lint" "cfn-lint --config-file ${CFN_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "cfn" + TestCodebase "CLOJURE" "clj-kondo" "clj-kondo --config ${CLOJURE_LINTER_RULES} --lint" ".*\.\(clj\|cljs\|cljc\|edn\)\$" "clojure" + TestCodebase "COFFEESCRIPT" "coffeelint" "coffeelint -f ${COFFEESCRIPT_LINTER_RULES}" ".*\.\(coffee\)\$" "coffeescript" + TestCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\)\$" "css" + TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "dart" + TestCodebase "DOCKER" "dockerfilelint" "dockerfilelint -c ${DOCKER_LINTER_RULES}" ".*\(Dockerfile\)\$" "docker" TestCodebase "EDITORCONFIG" "editorconfig-checker" "editorconfig-checker" ".*\.ext$" "editorconfig-checker" TestCodebase "ENV" "dotenv-linter" "dotenv-linter" ".*\.\(env\)\$" "env" - TestCodebase "GO" "golangci-lint" "golangci-lint run -c $GO_LINTER_RULES" ".*\.\(go\)\$" "golang" - TestCodebase "HTML" "htmlhint" "htmlhint --config $HTML_LINTER_RULES" ".*\.\(html\)\$" "html" - TestCodebase "JAVASCRIPT_ES" "eslint" "eslint --no-eslintrc -c $JAVASCRIPT_LINTER_RULES" ".*\.\(js\)\$" "javascript" - TestCodebase "JAVASCRIPT_STANDARD" "standard" "standard $JAVASCRIPT_STANDARD_LINTER_RULES" ".*\.\(js\)\$" "javascript" + TestCodebase "GO" "golangci-lint" "golangci-lint run -c ${GO_LINTER_RULES}" ".*\.\(go\)\$" "golang" + TestCodebase "HTML" "htmlhint" "htmlhint --config ${HTML_LINTER_RULES}" ".*\.\(html\)\$" "html" + TestCodebase "JAVASCRIPT_ES" "eslint" "eslint --no-eslintrc -c ${JAVASCRIPT_LINTER_RULES}" ".*\.\(js\)\$" "javascript" + TestCodebase "JAVASCRIPT_STANDARD" "standard" "standard ${JAVASCRIPT_STANDARD_LINTER_RULES}" ".*\.\(js\)\$" "javascript" TestCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "json" TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin" - TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c $MARKDOWN_LINTER_RULES" ".*\.\(md\)\$" "markdown" + TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c ${MARKDOWN_LINTER_RULES}" ".*\.\(md\)\$" "markdown" TestCodebase "PERL" "perl" "perl -Mstrict -cw" ".*\.\(pl\)\$" "perl" TestCodebase "PHP" "php" "php -l" ".*\.\(php\)\$" "php" - TestCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" ".*\.\(ymlopenapi\|jsonopenapi\)\$" "openapi" - TestCodebase "POWERSHELL" "pwsh" "Invoke-ScriptAnalyzer -EnableExit -Settings $POWERSHELL_LINTER_RULES -Path" ".*\.\(ps1\|psm1\|psd1\|ps1xml\|pssc\|psrc\|cdxml\)\$" "powershell" - TestCodebase "PROTOBUF" "protolint" "protolint lint --config_path $PROTOBUF_LINTER_RULES" ".*\.\(proto\)\$" "protobuf" - TestCodebase "PYTHON" "pylint" "pylint --rcfile $PYTHON_LINTER_RULES" ".*\.\(py\)\$" "python" + TestCodebase "OPENAPI" "spectral" "spectral lint -r ${OPENAPI_LINTER_RULES}" ".*\.\(ymlopenapi\|jsonopenapi\)\$" "openapi" + TestCodebase "POWERSHELL" "pwsh" "Invoke-ScriptAnalyzer -EnableExit -Settings ${POWERSHELL_LINTER_RULES} -Path" ".*\.\(ps1\|psm1\|psd1\|ps1xml\|pssc\|psrc\|cdxml\)\$" "powershell" + TestCodebase "PROTOBUF" "protolint" "protolint lint --config_path ${PROTOBUF_LINTER_RULES}" ".*\.\(proto\)\$" "protobuf" + TestCodebase "PYTHON" "pylint" "pylint --rcfile ${PYTHON_LINTER_RULES}" ".*\.\(py\)\$" "python" TestCodebase "RAKU" "raku" "raku -c" ".*\.\(raku\|rakumod\|rakutest\|pm6\|pl6\|p6\)\$" "raku" - TestCodebase "RUBY" "rubocop" "rubocop -c $RUBY_LINTER_RULES" ".*\.\(rb\)\$" "ruby" - TestCodebase "TERRAFORM" "tflint" "tflint -c $TERRAFORM_LINTER_RULES" ".*\.\(tf\)\$" "terraform" - TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(ts\)\$" "typescript" - TestCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin $TYPESCRIPT_STANDARD_LINTER_RULES" ".*\.\(ts\)\$" "typescript" + TestCodebase "RUBY" "rubocop" "rubocop -c ${RUBY_LINTER_RULES}" ".*\.\(rb\)\$" "ruby" + TestCodebase "TERRAFORM" "tflint" "tflint -c ${TERRAFORM_LINTER_RULES}" ".*\.\(tf\)\$" "terraform" + TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c ${TYPESCRIPT_LINTER_RULES}" ".*\.\(ts\)\$" "typescript" + TestCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin ${TYPESCRIPT_STANDARD_LINTER_RULES}" ".*\.\(ts\)\$" "typescript" TestCodebase "XML" "xmllint" "xmllint" ".*\.\(xml\)\$" "xml" - TestCodebase "YML" "yamllint" "yamllint -c $YAML_LINTER_RULES" ".*\.\(yml\|yaml\)\$" "yml" + TestCodebase "YML" "yamllint" "yamllint -c ${YAML_LINTER_RULES}" ".*\.\(yml\|yaml\)\$" "yml" ################# # Footer prints # @@ -617,7 +617,7 @@ function LintAnsibleFiles() { ########################################### # Validate we have ansible-lint installed # ########################################### - VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) + VALIDATE_INSTALL_CMD=$(command -v "${LINTER_NAME}" 2>&1) ####################### # Load the error code # @@ -627,17 +627,17 @@ function LintAnsibleFiles() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then # Failed - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to find $LINTER_NAME in system!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$VALIDATE_INSTALL_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to find ${LINTER_NAME} in system!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${VALIDATE_INSTALL_CMD}]${NC}" exit 1 else # Success - if [[ $ACTIONS_RUNNER_DEBUG == "true" ]]; then + if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then # Success echo -e "${NC}${F[B]}Successfully found binary in system${NC}" - echo "Location:[$VALIDATE_INSTALL_CMD]" + echo "Location:[${VALIDATE_INSTALL_CMD}]" fi fi @@ -654,18 +654,18 @@ function LintAnsibleFiles() { ###################################################### # Only go into ansible linter if we have base folder # ###################################################### - if [ -d "$ANSIBLE_DIRECTORY" ]; then + if [ -d "${ANSIBLE_DIRECTORY}" ]; then ################################# # Get list of all files to lint # ################################# - mapfile -t LIST_FILES < <(ls "$ANSIBLE_DIRECTORY"/*.{yaml,yml} 2>&1) + mapfile -t LIST_FILES < <(ls "${ANSIBLE_DIRECTORY}"/*.{yaml,yml} 2>&1) ############################################################### # Set the list to empty if only MD and TXT files were changed # ############################################################### # No need to run the full ansible checks on read only file changes - if [ "$READ_ONLY_CHANGE_FLAG" -eq 0 ]; then + if [ "${READ_ONLY_CHANGE_FLAG}" -eq 0 ]; then ########################## # Set the array to empty # ########################## @@ -683,12 +683,12 @@ function LintAnsibleFiles() { #################################### # Check if we have data to look at # #################################### - if [ $SKIP_FLAG -eq 0 ]; then + if [ ${SKIP_FLAG} -eq 0 ]; then for LINE in "${PRINT_ARRAY[@]}"; do ######################### # Print the header line # ######################### - echo "$LINE" + echo "${LINE}" done fi @@ -710,7 +710,7 @@ function LintAnsibleFiles() { ######################################## # Make sure we dont lint certain files # ######################################## - if [[ $FILE == *"vault.yml"* ]] || [[ $FILE == *"galaxy.yml"* ]]; then + if [[ ${FILE} == *"vault.yml"* ]] || [[ ${FILE} == *"galaxy.yml"* ]]; then # This is a file we dont look at continue fi @@ -723,18 +723,18 @@ function LintAnsibleFiles() { #################### # Get the filename # #################### - FILE_NAME=$(basename "$ANSIBLE_DIRECTORY/$FILE" 2>&1) + FILE_NAME=$(basename "${ANSIBLE_DIRECTORY}/${FILE}" 2>&1) ############## # File print # ############## echo "---------------------------" - echo "File:[$FILE]" + echo "File:[${FILE}]" ################################ # Lint the file with the rules # ################################ - LINT_CMD=$("$LINTER_NAME" -v -c "$ANSIBLE_LINTER_RULES" "$ANSIBLE_DIRECTORY/$FILE" 2>&1) + LINT_CMD=$("${LINTER_NAME}" -v -c "${ANSIBLE_LINTER_RULES}" "${ANSIBLE_DIRECTORY}/${FILE}" 2>&1) ####################### # Load the error code # @@ -744,12 +744,12 @@ function LintAnsibleFiles() { ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ]; then + if [ ${ERROR_CODE} -ne 0 ]; then ######### # Error # ######### - echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [$LINTER_NAME] linter!${NC}" - echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[$LINT_CMD]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [${LINTER_NAME}] linter!${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LINT_CMD}]${NC}" # Increment error count ((ERRORS_FOUND_ANSIBLE++)) @@ -765,7 +765,7 @@ function LintAnsibleFiles() { ########### # Success # ########### - echo -e "${NC}${F[B]} - File:${F[W]}[$FILE_NAME]${F[B]} was linted with ${F[W]}[$LINTER_NAME]${F[B]} successfully${NC}" + echo -e "${NC}${F[B]} - File:${F[W]}[${FILE_NAME}]${F[B]} was linted with ${F[W]}[${LINTER_NAME}]${F[B]} successfully${NC}" ####################################################### # Store the linting as a temporary file in TAP format # @@ -787,11 +787,11 @@ function LintAnsibleFiles() { ############################### # Check to see if debug is on # ############################### - if [[ $ACTIONS_RUNNER_DEBUG == "true" ]]; then + if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then ######################## # No Ansible dir found # ######################## - echo -e "${NC}${F[Y]}WARN!${NC} No Ansible base directory found at:[$ANSIBLE_DIRECTORY]${NC}" + echo -e "${NC}${F[Y]}WARN!${NC} No Ansible base directory found at:[${ANSIBLE_DIRECTORY}]${NC}" echo "skipping ansible lint" fi fi @@ -808,7 +808,7 @@ function IsTAP() { ################################################################################ #### Function TransformTAPDetails ############################################## function TransformTAPDetails() { - DATA=$1 + DATA=${1} if [ -n "${DATA}" ] && [ "${OUTPUT_DETAILS}" == "detailed" ] ; then ######################################################### # Transform new lines to \\n, remove colours and colons # @@ -822,8 +822,8 @@ function HeaderTap() { ################ # Pull in Vars # ################ - INDEX="$1" # File being validated - OUTPUT_FILE="$2" # Output location + INDEX="${1}" # File being validated + OUTPUT_FILE="${2}" # Output location ################### # Print the goods # @@ -836,9 +836,9 @@ function OkTap() { ################ # Pull in Vars # ################ - INDEX="$1" # Location - FILE="$2" # File being validated - TEMP_FILE="$3" # Temp file location + INDEX="${1}" # Location + FILE="${2}" # File being validated + TEMP_FILE="${3}" # Temp file location ################### # Print the goods # @@ -851,9 +851,9 @@ function NotOkTap() { ################ # Pull in Vars # ################ - INDEX="$1" # Location - FILE="$2" # File being validated - TEMP_FILE="$3" # Temp file location + INDEX="${1}" # Location + FILE="${2}" # File being validated + TEMP_FILE="${3}" # Temp file location ################### # Print the goods # @@ -866,14 +866,14 @@ function AddDetailedMessageIfEnabled() { ################ # Pull in Vars # ################ - LINT_CMD="$1" # Linter command - TEMP_FILE="$2" # Temp file + LINT_CMD="${1}" # Linter command + TEMP_FILE="${2}" # Temp file #################### # Check the return # #################### DETAILED_MSG=$(TransformTAPDetails "${LINT_CMD}") if [ -n "${DETAILED_MSG}" ] ; then - printf " ---\n message: %s\n ...\n" "$DETAILED_MSG" >> "${TEMP_FILE}" + printf " ---\n message: %s\n ...\n" "${DETAILED_MSG}" >> "${TEMP_FILE}" fi } From 621a554a2890e382ed6c8327e01ade6453ad3f2b Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 21 Jul 2020 13:14:11 -0500 Subject: [PATCH 79/96] Fix pr template --- .github/pull_request-template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request-template.md b/.github/pull_request-template.md index 3b5d6e5e..5cd7dfe5 100644 --- a/.github/pull_request-template.md +++ b/.github/pull_request-template.md @@ -10,9 +10,9 @@ Fixes # ## Proposed Changes -## - - -- +1. ... +2. ... +3. ... ## Readiness Checklist From dfaa263765db205a27b50ab6ef230dbb5b921604 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 21 Jul 2020 13:22:58 -0500 Subject: [PATCH 80/96] Fix disable linters typo --- docs/disabling-linters.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index f7b58802..858966a0 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -962,7 +962,7 @@ lint: - ```js // editorconfig-checker-disable-line -```` +``` ### editorconfig-checker disable code block @@ -1003,3 +1003,4 @@ lint: ### htmlhint disable entire file - There is currently **No** way to disable rules in an entire file +```` From b44083c6dbd4f1f773604fb1e85c3b22ead89651 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 21 Jul 2020 13:25:46 -0500 Subject: [PATCH 81/96] Fix code links --- README.md | 2 +- docs/run-linter-locally.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b159155..bffd6472 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ If you need to disable certain _rules_ and _functionality_, you can view [Disabl ## Docker Hub -The **Docker** container that is built from this repository is located at `https://hub.docker.com/r/github/super-linter` +The **Docker** container that is built from this repository is located at [github/super-linter](https://hub.docker.com/r/github/super-linter) ## Run Super-Linter outside GitHub Actions diff --git a/docs/run-linter-locally.md b/docs/run-linter-locally.md index 33b5d565..3933397f 100644 --- a/docs/run-linter-locally.md +++ b/docs/run-linter-locally.md @@ -44,4 +44,4 @@ If you need to run the container locally and gain access to its command line, yo ### Found issues -If you find a _bug_ or _issue_, please open a **GitHub** issue at: `https://github.com/github/super-linter/issues` +If you find a _bug_ or _issue_, please open a **GitHub** issue at: [github/super-linter/issues](https://github.com/github/super-linter/issues) From b191b0ed0b5a4499d204b17a2368a8237937cf13 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 13:48:50 -0500 Subject: [PATCH 82/96] Adding states linter: --- dependencies/Gemfile.lock | 2 +- dependencies/package-lock.json | 1413 +++++++++++++++++--------------- dependencies/package.json | 4 +- 3 files changed, 750 insertions(+), 669 deletions(-) diff --git a/dependencies/Gemfile.lock b/dependencies/Gemfile.lock index 12f9f0d7..9df0518b 100644 --- a/dependencies/Gemfile.lock +++ b/dependencies/Gemfile.lock @@ -9,7 +9,7 @@ GEM zeitwerk (~> 2.2, >= 2.2.2) ast (2.4.1) concurrent-ruby (1.1.6) - i18n (1.8.3) + i18n (1.8.4) concurrent-ruby (~> 1.0) jaro_winkler (1.5.4) minitest (5.14.1) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index cb0600bd..06703cc7 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -4,210 +4,280 @@ "lockfileVersion": 1, "dependencies": { "@babel/code-frame": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.3.tgz", - "integrity": "sha512-fDx9eNW0qz0WkUeqL6tXEXzVlPh6Y5aCDEZesl0xBGA8ndRukX91Uk44ZqnkECp01NAZUdCAl+aiQNGi0k88Eg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "requires": { - "@babel/highlight": "^7.10.3" + "@babel/highlight": "^7.10.4" } }, "@babel/core": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.3.tgz", - "integrity": "sha512-5YqWxYE3pyhIi84L84YcwjeEgS+fa7ZjK6IBVGTjDVfm64njkR2lfDhVR5OudLk8x2GK59YoSyVv+L/03k1q9w==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.5.tgz", + "integrity": "sha512-O34LQooYVDXPl7QWCdW9p4NR+QlzOr7xShPPJz8GsuCU3/8ua/wqTr7gmnxXv+WBESiGU/G5s16i6tUvHkNb+w==", "requires": { - "@babel/code-frame": "^7.10.3", - "@babel/generator": "^7.10.3", - "@babel/helper-module-transforms": "^7.10.1", - "@babel/helpers": "^7.10.1", - "@babel/parser": "^7.10.3", - "@babel/template": "^7.10.3", - "@babel/traverse": "^7.10.3", - "@babel/types": "^7.10.3", + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.5", + "@babel/helper-module-transforms": "^7.10.5", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.10.5", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.5", + "@babel/types": "^7.10.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", "json5": "^2.1.2", - "lodash": "^4.17.13", + "lodash": "^4.17.19", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" }, "dependencies": { + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } }, "@babel/generator": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.3.tgz", - "integrity": "sha512-drt8MUHbEqRzNR0xnF8nMehbY11b1SDkRw03PSNH/3Rb2Z35oxkddVSi3rcaak0YJQ86PCuE7Qx1jSFhbLNBMA==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.5.tgz", + "integrity": "sha512-3vXxr3FEW7E7lJZiWQ3bM4+v/Vyr9C+hpolQ8BGFr9Y8Ri2tFLWTixmwKBafDujO1WVah4fhZBeU1bieKdghig==", "requires": { - "@babel/types": "^7.10.3", + "@babel/types": "^7.10.5", "jsesc": "^2.5.1", - "lodash": "^4.17.13", "source-map": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } } }, "@babel/helper-function-name": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.3.tgz", - "integrity": "sha512-FvSj2aiOd8zbeqijjgqdMDSyxsGHaMt5Tr0XjQsGKHD3/1FP3wksjnLAWzxw7lvXiej8W1Jt47SKTZ6upQNiRw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", "requires": { - "@babel/helper-get-function-arity": "^7.10.3", - "@babel/template": "^7.10.3", - "@babel/types": "^7.10.3" + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-get-function-arity": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.3.tgz", - "integrity": "sha512-iUD/gFsR+M6uiy69JA6fzM5seno8oE85IYZdbVVEuQaZlEzMO2MXblh+KSPJgsZAUx0EEbWXU0yJaW7C9CdAVg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", "requires": { - "@babel/types": "^7.10.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.3.tgz", - "integrity": "sha512-q7+37c4EPLSjNb2NmWOjNwj0+BOyYlssuQ58kHEWk1Z78K5i8vTUsteq78HMieRPQSl/NtpQyJfdjt3qZ5V2vw==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.5.tgz", + "integrity": "sha512-HiqJpYD5+WopCXIAbQDG0zye5XYVvcO9w/DHp5GsaGkRUaamLj2bEtu6i8rnGGprAhHM3qidCMgp71HF4endhA==", "requires": { - "@babel/types": "^7.10.3" + "@babel/types": "^7.10.5" } }, "@babel/helper-module-imports": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.3.tgz", - "integrity": "sha512-Jtqw5M9pahLSUWA+76nhK9OG8nwYXzhQzVIGFoNaHnXF/r4l7kz4Fl0UAW7B6mqC5myoJiBP5/YQlXQTMfHI9w==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", "requires": { - "@babel/types": "^7.10.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-module-transforms": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.1.tgz", - "integrity": "sha512-RLHRCAzyJe7Q7sF4oy2cB+kRnU4wDZY/H2xJFGof+M+SJEGhZsb+GFj5j1AD8NiSaVBJ+Pf0/WObiXu/zxWpFg==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.5.tgz", + "integrity": "sha512-4P+CWMJ6/j1W915ITJaUkadLObmCRRSC234uctJfn/vHrsLNxsR8dwlcXv9ZhJWzl77awf+mWXSZEKt5t0OnlA==", "requires": { - "@babel/helper-module-imports": "^7.10.1", - "@babel/helper-replace-supers": "^7.10.1", - "@babel/helper-simple-access": "^7.10.1", - "@babel/helper-split-export-declaration": "^7.10.1", - "@babel/template": "^7.10.1", - "@babel/types": "^7.10.1", - "lodash": "^4.17.13" + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.5", + "lodash": "^4.17.19" + }, + "dependencies": { + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" + } } }, "@babel/helper-optimise-call-expression": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.3.tgz", - "integrity": "sha512-kT2R3VBH/cnSz+yChKpaKRJQJWxdGoc6SjioRId2wkeV3bK0wLLioFpJROrX0U4xr/NmxSSAWT/9Ih5snwIIzg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", "requires": { - "@babel/types": "^7.10.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-replace-supers": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.1.tgz", - "integrity": "sha512-SOwJzEfpuQwInzzQJGjGaiG578UYmyi2Xw668klPWV5n07B73S0a9btjLk/52Mlcxa+5AdIYqws1KyXRfMoB7A==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", "requires": { - "@babel/helper-member-expression-to-functions": "^7.10.1", - "@babel/helper-optimise-call-expression": "^7.10.1", - "@babel/traverse": "^7.10.1", - "@babel/types": "^7.10.1" + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-simple-access": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.1.tgz", - "integrity": "sha512-VSWpWzRzn9VtgMJBIWTZ+GP107kZdQ4YplJlCmIrjoLVSi/0upixezHCDG8kpPVTBJpKfxTH01wDhh+jS2zKbw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", "requires": { - "@babel/template": "^7.10.1", - "@babel/types": "^7.10.1" + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz", - "integrity": "sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", + "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", "requires": { - "@babel/types": "^7.10.1" + "@babel/types": "^7.10.4" } }, "@babel/helper-validator-identifier": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.3.tgz", - "integrity": "sha512-bU8JvtlYpJSBPuj1VUmKpFGaDZuLxASky3LhaKj3bmpSTY6VWooSM8msk+Z0CZoErFye2tlABF6yDkT3FOPAXw==" + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==" }, "@babel/helpers": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.1.tgz", - "integrity": "sha512-muQNHF+IdU6wGgkaJyhhEmI54MOZBKsFfsXFhboz1ybwJ1Kl7IHlbm2a++4jwrmY5UYsgitt5lfqo1wMFcHmyw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", "requires": { - "@babel/template": "^7.10.1", - "@babel/traverse": "^7.10.1", - "@babel/types": "^7.10.1" + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/highlight": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.3.tgz", - "integrity": "sha512-Ih9B/u7AtgEnySE2L2F0Xm0GaM729XqqLfHkalTsbjXGyqmf/6M0Cu0WpvqueUlW+xk88BHw9Nkpj49naU+vWw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "requires": { - "@babel/helper-validator-identifier": "^7.10.3", + "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + } } }, "@babel/parser": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.3.tgz", - "integrity": "sha512-oJtNJCMFdIMwXGmx+KxuaD7i3b8uS7TTFYW/FNG2BT8m+fmGHoiPYoH0Pe3gya07WuFmM5FCDIr1x0irkD/hyA==" + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz", + "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==" }, "@babel/runtime": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.4.tgz", - "integrity": "sha512-UpTN5yUJr9b4EX2CnGNWIvER7Ab83ibv0pcvvHc4UOdrBI5jb8bj+32cCwPX6xu0mt2daFNjYhoi+X7beH0RSw==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.5.tgz", + "integrity": "sha512-otddXKhdNn7d0ptoFRHtMLa8LqDxLYwTjB4nYgM1yy5N6gU/MUf8zqyyLltCH3yAVitBzmwK4us+DD0l/MauAg==", "requires": { "regenerator-runtime": "^0.13.4" } }, "@babel/template": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.3.tgz", - "integrity": "sha512-5BjI4gdtD+9fHZUsaxPHPNpwa+xRkDO7c7JbhYn2afvrkDu5SfAAbi9AIMXw2xEhO/BR35TqiW97IqNvCo/GqA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", "requires": { - "@babel/code-frame": "^7.10.3", - "@babel/parser": "^7.10.3", - "@babel/types": "^7.10.3" + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/traverse": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.3.tgz", - "integrity": "sha512-qO6623eBFhuPm0TmmrUFMT1FulCmsSeJuVGhiLodk2raUDFhhTECLd9E9jC4LBIWziqt4wgF6KuXE4d+Jz9yug==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.5.tgz", + "integrity": "sha512-yc/fyv2gUjPqzTz0WHeRJH2pv7jA9kA7mBX2tXl/x5iOE81uaVPuGPtaYk7wmkx4b67mQ7NqI8rmT2pF47KYKQ==", "requires": { - "@babel/code-frame": "^7.10.3", - "@babel/generator": "^7.10.3", - "@babel/helper-function-name": "^7.10.3", - "@babel/helper-split-export-declaration": "^7.10.1", - "@babel/parser": "^7.10.3", - "@babel/types": "^7.10.3", + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/parser": "^7.10.5", + "@babel/types": "^7.10.5", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.13" + "lodash": "^4.17.19" + }, + "dependencies": { + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" + } } }, "@babel/types": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.3.tgz", - "integrity": "sha512-nZxaJhBXBQ8HVoIcGsf9qWep3Oh3jCENK54V4mRF7qaJabVsAYdbTtmSD8WmAp1R6ytPiu5apMwSXyxB1WlaBA==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz", + "integrity": "sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q==", "requires": { - "@babel/helper-validator-identifier": "^7.10.3", - "lodash": "^4.17.13", + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" + } } }, "@coffeelint/cli": { @@ -221,31 +291,6 @@ "resolve": "^1.17.0", "strip-json-comments": "^3.1.1", "yargs": "^15.4.1" - }, - "dependencies": { - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - } } }, "@nodelib/fs.scandir": { @@ -352,44 +397,23 @@ "yargs": "15.3.1" }, "dependencies": { - "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "yargs": { + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" } - }, - "fast-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.0.tgz", - "integrity": "sha512-TrUz3THiq2Vy3bjfQUB2wNyPdGBeGmdjbzzBLhfHN4YFurYptCKwGq/TfiRavbGywFRzY6U2CdmQ1zmsY5yYaw==", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "requires": { - "has-flag": "^4.0.0" - } - }, - "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" } } }, @@ -418,9 +442,9 @@ "integrity": "sha512-PdY8p2Ufgtorf4d2DbKMfknILMa8KwuyyMMR/2lgK1mLaU8F5PKWYc+h9hIzC+ar0bh7m9h2rINo32m7ADfVyA==" }, "@stylelint/postcss-css-in-js": { - "version": "0.37.1", - "resolved": "https://registry.npmjs.org/@stylelint/postcss-css-in-js/-/postcss-css-in-js-0.37.1.tgz", - "integrity": "sha512-UMf2Rni3JGKi3ZwYRGMYJ5ipOA5ENJSKMtYA/pE1ZLURwdh7B5+z2r73RmWvub+N0UuH1Lo+TGfCgYwPvqpXNw==", + "version": "0.37.2", + "resolved": "https://registry.npmjs.org/@stylelint/postcss-css-in-js/-/postcss-css-in-js-0.37.2.tgz", + "integrity": "sha512-nEhsFoJurt8oUmieT8qy4nk81WRHmJynmVwn/Vts08PL9fhgIsMhk1GId5yAN643OzqEEb5S/6At2TZW7pqPDA==", "requires": { "@babel/core": ">=7.9.0" } @@ -499,18 +523,6 @@ "eslint-utils": "^2.0.0" } }, - "@typescript-eslint/experimental-utils": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.7.0.tgz", - "integrity": "sha512-xpfXXAfZqhhqs5RPQBfAFrWDHoNxD5+sVB5A46TF58Bq1hRfVROrWHcQHHUM9aCBdy9+cwATcvCbRg8aIRbaHQ==", - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.7.0", - "@typescript-eslint/typescript-estree": "3.7.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, "@typescript-eslint/parser": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.7.0.tgz", @@ -551,34 +563,6 @@ "eslint-visitor-keys": "^1.1.0" } }, - "@typescript-eslint/types": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.7.0.tgz", - "integrity": "sha512-reCaK+hyKkKF+itoylAnLzFeNYAEktB0XVfSQvf0gcVgpz1l49Lt6Vo9x4MVCCxiDydA0iLAjTF/ODH0pbfnpg==" - }, - "@typescript-eslint/typescript-estree": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.7.0.tgz", - "integrity": "sha512-xr5oobkYRebejlACGr1TJ0Z/r0a2/HUf0SXqPvlgUMwiMqOCu/J+/Dr9U3T0IxpE5oLFSkqMx1FE/dKaZ8KsOQ==", - "requires": { - "@typescript-eslint/types": "3.7.0", - "@typescript-eslint/visitor-keys": "3.7.0", - "debug": "^4.1.1", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.7.0.tgz", - "integrity": "sha512-k5PiZdB4vklUpUX4NBncn5RBKty8G3ihTY+hqJsCdMuD0v4jofI5xuqwnVcWxfv6iTm2P/dfEa2wMUnsUY8ODw==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, "JSV": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", @@ -691,6 +675,16 @@ "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" }, + "asl-validator": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/asl-validator/-/asl-validator-1.7.0.tgz", + "integrity": "sha512-63vmNSjb8HV5Ln43lBCEtN+1RoBX9ZMfeJrNTesNsLjfsan9H8Gdvy+Rjnk21QpvS9+j0uyefNqfWBL4qGt4Jw==", + "requires": { + "ajv": "^6.12.2", + "commander": "^5.1.0", + "jsonpath": "^1.0.2" + } + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -725,12 +719,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "autoprefixer": { - "version": "9.8.4", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.4.tgz", - "integrity": "sha512-84aYfXlpUe45lvmS+HoAWKCkirI/sw4JK0/bTeeqgHYco3dcsOn0NqdejISjptsYwNji/21dnkDri9PsYKk89A==", + "version": "9.8.5", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.5.tgz", + "integrity": "sha512-C2p5KkumJlsTHoNv9w31NrBRgXhf6eCMteJuHZi2xhkgC+5Vm40MEtCKPhc0qdgAOhox0YPy1SQHTAky05UoKg==", "requires": { "browserslist": "^4.12.0", - "caniuse-lite": "^1.0.30001087", + "caniuse-lite": "^1.0.30001097", "colorette": "^1.2.0", "normalize-range": "^0.1.2", "num2fraction": "^1.2.2", @@ -791,6 +785,39 @@ "json-to-ast": "^2.0.3", "jsonpointer": "^4.0.1", "leven": "^3.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + } } }, "blueimp-md5": { @@ -816,12 +843,12 @@ } }, "browserslist": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.1.tgz", - "integrity": "sha512-WMjXwFtPskSW1pQUDJRxvRKRkeCr7usN0O/Za76N+F4oadaTdQHotSGcX9jT/Hs7mSKPkyMFNvqawB/1HzYDKQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.13.0.tgz", + "integrity": "sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ==", "requires": { - "caniuse-lite": "^1.0.30001088", - "electron-to-chromium": "^1.3.481", + "caniuse-lite": "^1.0.30001093", + "electron-to-chromium": "^1.3.488", "escalade": "^3.0.1", "node-releases": "^1.1.58" } @@ -852,9 +879,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001088", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001088.tgz", - "integrity": "sha512-6eYUrlShRYveyqKG58HcyOfPgh3zb2xqs7NvT2VVtP3hEUeeWvc3lqhpeMTxYWBBeeaT9A4bKsrtjATm66BTHg==" + "version": "1.0.30001104", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001104.tgz", + "integrity": "sha512-pkpCg7dmI/a7WcqM2yfdOiT4Xx5tzyoHAXWsX5/HxZ3TemwDZs0QXdqbE0UPLPVy/7BeK7693YfzfRYfu1YVpg==" }, "caseless": { "version": "0.12.0", @@ -867,35 +894,26 @@ "integrity": "sha512-MOli1W+nfbPLlKEhInaxhRdp7KVLFxLN5ykwzHgLsLI3H3gs5jjFAK4Eoj3OzzcxCtumDaI8onoVDeQyWaNTkw==" }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "requires": { - "color-name": "1.1.3" + "has-flag": "^4.0.0" } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" } } }, @@ -994,9 +1012,9 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "colorette": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.0.tgz", - "integrity": "sha512-soRSroY+OF/8OdA3PTQXwaDJeMc7TfknKKrxeSCencL2a4+Tx5zhxmmv7hdpCjhKBjehzp8+bwe/T68K0hpIjw==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", + "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==" }, "colors": { "version": "1.4.0", @@ -1012,12 +1030,9 @@ } }, "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", - "requires": { - "graceful-readlink": ">= 1.0.0" - } + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" }, "concat-map": { "version": "0.0.1", @@ -1170,13 +1185,6 @@ "ast-types": "0.x.x", "escodegen": "1.x.x", "esprima": "3.x.x" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" - } } }, "deglob": { @@ -1271,15 +1279,6 @@ "wrap-ansi": "^2.0.0" } }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", @@ -1293,55 +1292,6 @@ "number-is-nan": "^1.0.0" } }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", @@ -1365,14 +1315,6 @@ "ansi-regex": "^2.0.0" } }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -1483,9 +1425,9 @@ } }, "electron-to-chromium": { - "version": "1.3.483", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.483.tgz", - "integrity": "sha512-+05RF8S9rk8S0G8eBCqBRBaRq7+UN3lDs2DAvnG8SBSgQO3hjy0+qt4CmRk5eiuGbTcaicgXfPmBi31a+BD3lg==" + "version": "1.3.502", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.502.tgz", + "integrity": "sha512-TIeXOaHAvfP7FemGUtAJxStmOc1YFGWFNqdey/4Nk41L9b1nMmDVDGNMIWhZJvOfJxix6Cv5FGEnBK+yvw3UTg==" }, "emoji-regex": { "version": "8.0.0", @@ -1560,9 +1502,9 @@ } }, "escalade": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.1.tgz", - "integrity": "sha512-DR6NO3h9niOT+MZs7bjxlj2a1k+POu5RN8CLTPX2+i78bRi9eLe7+0zXgUHMnGXWybYcL61E9hGhPKqedy8tQA==" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.2.tgz", + "integrity": "sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ==" }, "escape-string-regexp": { "version": "1.0.5", @@ -1581,46 +1523,10 @@ "source-map": "~0.6.1" }, "dependencies": { - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "requires": { - "prelude-ls": "~1.1.2" - } + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" } } }, @@ -1667,15 +1573,6 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, "globals": { "version": "12.4.0", "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", @@ -1684,27 +1581,49 @@ "type-fest": "^0.8.1" } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, "lodash": { "version": "4.17.19", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "requires": { - "has-flag": "^4.0.0" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "requires": { + "prelude-ls": "^1.2.1" } } } @@ -1829,10 +1748,101 @@ "isarray": "^1.0.0" } }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "^2.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "requires": { + "pify": "^2.0.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" } } }, @@ -1968,9 +1978,9 @@ } }, "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" }, "esquery": { "version": "1.3.1", @@ -2044,16 +2054,15 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.0.tgz", + "integrity": "sha512-TrUz3THiq2Vy3bjfQUB2wNyPdGBeGmdjbzzBLhfHN4YFurYptCKwGq/TfiRavbGywFRzY6U2CdmQ1zmsY5yYaw==", "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.0", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.2" } }, "fast-json-stable-stringify": { @@ -2166,11 +2175,6 @@ "xregexp": "2.0.0" }, "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", @@ -2181,11 +2185,6 @@ "isarray": "0.0.1", "string_decoder": "~0.10.x" } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" } } }, @@ -2239,28 +2238,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } } } }, @@ -2369,6 +2346,21 @@ "ignore": "^5.1.4", "merge2": "^1.3.0", "slash": "^3.0.0" + }, + "dependencies": { + "fast-glob": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + } } }, "globjoin": { @@ -2481,32 +2473,10 @@ "xml": "1.0.1" }, "dependencies": { - "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "requires": { - "has-flag": "^4.0.0" - } + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==" } } }, @@ -2527,6 +2497,29 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } } } }, @@ -2662,9 +2655,9 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, "inquirer": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.0.tgz", - "integrity": "sha512-K+LZp6L/6eE5swqIcVXrxl21aGDU4S50gKH0/d96OMQnSBCyGyZl/oZhbkVmdp5sBoINHd4xZvFSARh2dk6DWA==", + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.2.tgz", + "integrity": "sha512-DF4osh1FM6l0RJc5YWYhSDB6TawiBRlbV9Cox8MWlidU218Tb7fm3lQTULyUJDfJ0tjbzl0W4q651mrCCEM55w==", "requires": { "ansi-escapes": "^4.2.1", "chalk": "^4.1.0", @@ -2672,7 +2665,7 @@ "cli-width": "^3.0.0", "external-editor": "^3.0.3", "figures": "^3.0.0", - "lodash": "^4.17.15", + "lodash": "^4.17.16", "mute-stream": "0.0.8", "run-async": "^2.4.0", "rxjs": "^6.6.0", @@ -2695,6 +2688,11 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" + }, "supports-color": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", @@ -2844,9 +2842,9 @@ "integrity": "sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==" }, "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, "isexe": { "version": "2.0.0", @@ -2870,6 +2868,13 @@ "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + } } }, "jsbn": { @@ -2938,15 +2943,32 @@ "nomnom": "^1.5.x" } }, + "jsonpath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.0.2.tgz", + "integrity": "sha512-rmzlgFZiQPc6q4HDyK8s9Qb4oxBnI5sF61y/Co5PV0lc3q2bIuRsNdueVbhoSHdKM4fxeimphOAtfz47yjCfeA==", + "requires": { + "esprima": "1.2.2", + "static-eval": "2.0.2", + "underscore": "1.7.0" + }, + "dependencies": { + "esprima": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", + "integrity": "sha1-dqD9Zvz+FU/SkmZ9wmQBl1CxZXs=" + } + } + }, "jsonpath-plus": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-4.0.0.tgz", "integrity": "sha512-e0Jtg4KAzDJKKwzbLaUtinCn0RZseWBVRTRGihSpvFlM3wTR7ExSp+PTdeTsDrLNJUe7L7JYJe8mblHX5SCT6A==" }, "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.1.0.tgz", + "integrity": "sha512-CXcRvMyTlnR53xMcKnuMzfCA5i/nfblTnnr74CZb6C4vG39eu6w51t7nKmU5MfLfbTgGItliNyjO/ciNPDqClg==" }, "jsprim": { "version": "1.4.1", @@ -2992,12 +3014,12 @@ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==" }, "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "lines-and-columns": { @@ -3014,14 +3036,15 @@ } }, "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "requires": { "graceful-fs": "^4.1.2", "parse-json": "^2.2.0", "pify": "^2.0.0", - "strip-bom": "^3.0.0" + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, "locate-path": { @@ -3053,30 +3076,6 @@ "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", "requires": { "chalk": "^4.0.0" - }, - "dependencies": { - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "requires": { - "has-flag": "^4.0.0" - } - } } }, "longest-streak": { @@ -3159,6 +3158,19 @@ "rc": "~1.2.7" }, "dependencies": { + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "requires": { + "graceful-readlink": ">= 1.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, "get-stdin": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", @@ -3392,9 +3404,9 @@ "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, "node-releases": { - "version": "1.1.58", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.58.tgz", - "integrity": "sha512-NxBudgVKiRh/2aPWMgPR7bPTX0VPmGx5QBwCtdHitnqFE5/O8DeBXuIMH1nwNnw/aMo6AjOrpsHzfY3UbUJ7yg==" + "version": "1.1.59", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.59.tgz", + "integrity": "sha512-H3JrdUczbdiwxN5FuJPyCHnGHIFqQ0wWxo+9j1kAXAzqNMAHlo+4I/sYYxpyK0irQ73HgdiyzD32oqQDcU2Osw==" }, "nomnom": { "version": "1.8.1", @@ -3424,6 +3436,11 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=" + }, + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=" } } }, @@ -3545,16 +3562,16 @@ } }, "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" } }, "os-locale": { @@ -3694,11 +3711,13 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "requires": { - "pify": "^2.0.0" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "performance-now": { @@ -3794,6 +3813,11 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + }, "type-fest": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", @@ -3874,10 +3898,46 @@ "supports-color": "^6.1.0" }, "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "supports-color": { "version": "6.1.0", @@ -3921,6 +3981,37 @@ "postcss": "^7.0.7" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -3982,9 +4073,9 @@ "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==" }, "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, "prettier": { "version": "2.0.5", @@ -4100,77 +4191,70 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "requires": { - "load-json-file": "^2.0.0", + "load-json-file": "^1.0.0", "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" + "path-type": "^1.0.0" } }, "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" }, "dependencies": { "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "requires": { - "locate-path": "^2.0.0" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" - }, "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } } } }, "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "redent": { @@ -4193,9 +4277,9 @@ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" }, "remark": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/remark/-/remark-12.0.0.tgz", - "integrity": "sha512-oX4lMIS0csgk8AEbzY0h2jdR0ngiCHOpwwpxjmRa5TqAkeknY+tkhjRJGZqnCmvyuWh55/0SW5WY3R3nn3PH9A==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/remark/-/remark-12.0.1.tgz", + "integrity": "sha512-gS7HDonkdIaHmmP/+shCPejCEEW+liMp/t/QwmF0Xt47Rpuhl32lLtDV1uKWvGoq+kxr5jSgg5oAIpGuyULjUw==", "requires": { "remark-parse": "^8.0.0", "remark-stringify": "^8.0.0", @@ -4203,9 +4287,9 @@ } }, "remark-parse": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.2.tgz", - "integrity": "sha512-eMI6kMRjsAGpMXXBAywJwiwAse+KNpmt+BK55Oofy4KvBZEqUDj6mWbGLJZrujoPIPPxDXzn3T9baRlpsm2jnQ==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.3.tgz", + "integrity": "sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q==", "requires": { "ccount": "^1.0.0", "collapse-white-space": "^1.0.2", @@ -4226,9 +4310,9 @@ } }, "remark-stringify": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-8.1.0.tgz", - "integrity": "sha512-FSPZv1ds76oAZjurhhuV5qXSUSoz6QRPuwYK38S41sLHwg4oB7ejnmZshj7qwjgYLf93kdz6BOX9j5aidNE7rA==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-8.1.1.tgz", + "integrity": "sha512-q4EyPZT3PcA3Eq7vPpT6bIdokXzFGp9i85igjmhRyXWmPs0Y6/d2FYwUNotKAWyLch7g0ASZJn/KHHcHZQ163A==", "requires": { "ccount": "^1.0.0", "is-alphanumeric": "^1.0.0", @@ -4471,9 +4555,9 @@ } }, "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "spdx-correct": { "version": "3.1.1", @@ -4550,6 +4634,37 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -4644,38 +4759,11 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" - }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", @@ -4707,14 +4795,6 @@ "ansi-regex": "^4.1.0" } }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "requires": { - "prelude-ls": "~1.1.2" - } - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -4748,6 +4828,14 @@ "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz", "integrity": "sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==" }, + "static-eval": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", + "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", + "requires": { + "escodegen": "^1.8.1" + } + }, "statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", @@ -4787,19 +4875,9 @@ } }, "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - } - } + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" }, "stringify-entities": { "version": "3.0.1", @@ -4822,9 +4900,12 @@ } }, "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } }, "strip-indent": { "version": "3.0.0", @@ -4835,9 +4916,9 @@ } }, "strip-json-comments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", - "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, "style-search": { "version": "0.1.0", @@ -5084,9 +5165,9 @@ "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==" }, "tslib": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", - "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" }, "tsutils": { "version": "3.17.1", @@ -5110,11 +5191,11 @@ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "requires": { - "prelude-ls": "^1.2.1" + "prelude-ls": "~1.1.2" } }, "type-fest": { @@ -5141,9 +5222,9 @@ "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" }, "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=" + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=" }, "unherit": { "version": "1.1.3", @@ -5202,9 +5283,9 @@ } }, "unist-util-visit": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.2.tgz", - "integrity": "sha512-HoHNhGnKj6y+Sq+7ASo2zpVdfdRifhTgX2KTU3B/sO/TTlZchp7E3S4vjRzDJ7L60KmrCPsQkVK3lEF3cz36XQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", + "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", "requires": { "@types/unist": "^2.0.0", "unist-util-is": "^4.0.0", @@ -5212,9 +5293,9 @@ } }, "unist-util-visit-parents": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.0.2.tgz", - "integrity": "sha512-yJEfuZtzFpQmg1OSCyS9M5NJRrln/9FbYosH3iW0MG402QbdbaB8ZESwUv9RO6nRfLAKvWcMxCwdLWOov36x/g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", + "integrity": "sha512-0g4wbluTF93npyPrp/ymd3tCDTMnP0yo2akFD2FIBAYXq/Sga3lwaU1D8OYKbtpioaI6CkDcQ6fsMnmtzt7htw==", "requires": { "@types/unist": "^2.0.0", "unist-util-is": "^4.0.0" @@ -5391,9 +5472,9 @@ "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==" }, "yargs": { - "version": "15.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", - "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "requires": { "cliui": "^6.0.0", "decamelize": "^1.2.0", @@ -5405,7 +5486,7 @@ "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^18.1.1" + "yargs-parser": "^18.1.2" } }, "yargs-parser": { diff --git a/dependencies/package.json b/dependencies/package.json index 19ce0341..2dd354f4 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -5,7 +5,6 @@ "@stoplight/spectral": "^5.4.0", "@typescript-eslint/eslint-plugin": "^3.7.0", "@typescript-eslint/parser": "^3.7.0", - "@typescript-eslint/eslint-plugin": "^3.7.0", "babel-eslint": "^10.1.0", "dockerfilelint": "^1.5.0", "eslint": "^7.5.0", @@ -19,6 +18,7 @@ "standard": "^14.3.4", "stylelint": "^13.6.1", "stylelint-config-standard": "^20.0.0", - "typescript": "^3.9.7" + "typescript": "^3.9.7", + "asl-validator": "^1.7.0" } } From 1971c8359e2daab4cbc4b243fe64f6dff1a6bac8 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 13:50:04 -0500 Subject: [PATCH 83/96] Adding states linter --- .automation/test/states/README.md | 13 + .../test/states/reports/expected-STATES.tap | 7 + .automation/test/states/states_bad_1.json | 10 + .automation/test/states/states_good_1.json | 11 + Dockerfile | 83 +++---- README.md | 92 ++++---- lib/buildFileList.sh | 9 + lib/linter.sh | 222 ++++++++++-------- lib/validation.sh | 68 ++++-- lib/worker.sh | 1 + 10 files changed, 313 insertions(+), 203 deletions(-) create mode 100644 .automation/test/states/README.md create mode 100644 .automation/test/states/reports/expected-STATES.tap create mode 100644 .automation/test/states/states_bad_1.json create mode 100644 .automation/test/states/states_good_1.json diff --git a/.automation/test/states/README.md b/.automation/test/states/README.md new file mode 100644 index 00000000..fd526bb2 --- /dev/null +++ b/.automation/test/states/README.md @@ -0,0 +1,13 @@ +# AWS States language Test Cases +This folder holds the test cases for **AWS States Language**. + +## Additional Docs +No Additional information is needed for this test case. + +## Good Test Cases +The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. +- **Note:** They are linted utilizing the default linter rules. + +## Bad Test Cases +The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. +- **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/states/reports/expected-STATES.tap b/.automation/test/states/reports/expected-STATES.tap new file mode 100644 index 00000000..e9be32b5 --- /dev/null +++ b/.automation/test/states/reports/expected-STATES.tap @@ -0,0 +1,7 @@ +TAP version 13 +1..2 +not ok 1 - json_bad_1.json + --- + message: Error Parse error on line 6 \n...ng" { "level" 'ignore', "space\n----------------------^\nExpecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'\n at Object.parseError (/node_modules/jsonlint/lib/jsonlint.js 55 11)\n at Object.parse (/node_modules/jsonlint/lib/jsonlint.js 132 22)\n at parse (/node_modules/jsonlint/lib/cli.js 82 14)\n at main (/node_modules/jsonlint/lib/cli.js 135 14)\n at Object. (/node_modules/jsonlint/lib/cli.js 179 1)\n at Module._compile (internal/modules/cjs/loader.js 1138 30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js 1158 10)\n at Module.load (internal/modules/cjs/loader.js 986 32)\n at Function.Module._load (internal/modules/cjs/loader.js 879 14)\n at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js 71 12)\n + ... +ok 2 - json_good_1.json diff --git a/.automation/test/states/states_bad_1.json b/.automation/test/states/states_bad_1.json new file mode 100644 index 00000000..36b15b64 --- /dev/null +++ b/.automation/test/states/states_bad_1.json @@ -0,0 +1,10 @@ +{ + "Comment": "A simple minimal example of the States language", + "StartAt": "Hello World", + "States": { + "Hello World": { + "Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloWorld", + "End": true + } + } +} diff --git a/.automation/test/states/states_good_1.json b/.automation/test/states/states_good_1.json new file mode 100644 index 00000000..0c1be861 --- /dev/null +++ b/.automation/test/states/states_good_1.json @@ -0,0 +1,11 @@ +{ + "Comment": "A simple minimal example of the States language", + "StartAt": "Hello World", + "States": { + "Hello World": { + "Type": "Task", + "Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloWorld", + "End": true + } + } +} diff --git a/Dockerfile b/Dockerfile index 37dd951a..6d216eed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -190,50 +190,51 @@ RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/reposi ########################################### # Load GitHub Env Vars for GitHub Actions # ########################################### -ENV GITHUB_SHA=${GITHUB_SHA} \ - GITHUB_EVENT_PATH=${GITHUB_EVENT_PATH} \ - GITHUB_WORKSPACE=${GITHUB_WORKSPACE} \ - DEFAULT_BRANCH=${DEFAULT_BRANCH} \ - VALIDATE_ALL_CODEBASE=${VALIDATE_ALL_CODEBASE} \ - LINTER_RULES_PATH=${LINTER_RULES_PATH} \ - VALIDATE_YAML=${VALIDATE_YAML} \ - VALIDATE_JSON=${VALIDATE_JSON} \ - VALIDATE_XML=${VALIDATE_XML} \ - VALIDATE_MD=${VALIDATE_MD} \ - VALIDATE_BASH=${VALIDATE_BASH} \ - VALIDATE_PERL=${VALIDATE_PERL} \ - VALIDATE_RAKU=${VALIDATE_RAKU} \ - VALIDATE_PHP=${VALIDATE_PHP} \ - VALIDATE_PYTHON=${VALIDATE_PYTHON} \ - VALIDATE_RUBY=${VALIDATE_RUBY} \ - VALIDATE_COFFEE=${VALIDATE_COFFEE} \ - VALIDATE_ANSIBLE=${VALIDATE_ANSIBLE} \ - VALIDATE_DOCKER=${VALIDATE_DOCKER} \ - VALIDATE_JAVASCRIPT_ES=${VALIDATE_JAVASCRIPT_ES} \ - VALIDATE_JAVASCRIPT_STANDARD=${VALIDATE_JAVASCRIPT_STANDARD} \ - VALIDATE_TYPESCRIPT_ES=${VALIDATE_TYPESCRIPT_ES} \ - VALIDATE_TYPESCRIPT_STANDARD=${VALIDATE_TYPESCRIPT_STANDARD} \ - VALIDATE_GO=${VALIDATE_GO} \ - VALIDATE_TERRAFORM=${VALIDATE_TERRAFORM} \ - VALIDATE_CSS=${VALIDATE_CSS} \ - VALIDATE_ENV=${VALIDATE_ENV} \ - VALIDATE_HTML=${VALIDATE_HTML} \ - VALIDATE_CLOJURE=${VALIDATE_CLOJURE} \ - VALIDATE_KOTLIN=${VALIDATE_KOTLIN} \ - VALIDATE_DART=${VALIDATE_DART} \ - VALIDATE_POWERSHELL=${VALIDATE_POWERSHELL} \ - VALIDATE_ARM=${VALIDATE_ARM} \ - VALIDATE_OPENAPI=${VALIDATE_OPENAPI} \ - VALIDATE_PROTOBUF=${VALIDATE_PROTOBUF} \ - VALIDATE_EDITORCONFIG=${VALIDATE_EDITORCONFIG} \ +ENV ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ ANSIBLE_DIRECTORY=${ANSIBLE_DIRECTORY} \ + DEFAULT_BRANCH=${DEFAULT_BRANCH} \ + DISABLE_ERRORS=${DISABLE_ERRORS} \ + GITHUB_EVENT_PATH=${GITHUB_EVENT_PATH} \ + GITHUB_SHA=${GITHUB_SHA} \ + GITHUB_WORKSPACE=${GITHUB_WORKSPACE} \ + LINTER_RULES_PATH=${LINTER_RULES_PATH} \ + OUTPUT_DETAILS=${OUTPUT_DETAILS} \ + OUTPUT_FOLDER=${OUTPUT_FOLDER} \ + OUTPUT_FORMAT=${OUTPUT_FORMAT} \ RUN_LOCAL=${RUN_LOCAL} \ TEST_CASE_RUN=${TEST_CASE_RUN} \ - ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ - DISABLE_ERRORS=${DISABLE_ERRORS} \ - OUTPUT_FORMAT=${OUTPUT_FORMAT} \ - OUTPUT_FOLDER=${OUTPUT_FOLDER} \ - OUTPUT_DETAILS=${OUTPUT_DETAILS} + VALIDATE_ALL_CODEBASE=${VALIDATE_ALL_CODEBASE} \ + VALIDATE_ANSIBLE=${VALIDATE_ANSIBLE} \ + VALIDATE_ARM=${VALIDATE_ARM} \ + VALIDATE_BASH=${VALIDATE_BASH} \ + VALIDATE_CLOJURE=${VALIDATE_CLOJURE} \ + VALIDATE_COFFEE=${VALIDATE_COFFEE} \ + VALIDATE_CSS=${VALIDATE_CSS} \ + VALIDATE_DART=${VALIDATE_DART} \ + VALIDATE_DOCKER=${VALIDATE_DOCKER} \ + VALIDATE_EDITORCONFIG=${VALIDATE_EDITORCONFIG} \ + VALIDATE_ENV=${VALIDATE_ENV} \ + VALIDATE_GO=${VALIDATE_GO} \ + VALIDATE_HTML=${VALIDATE_HTML} \ + VALIDATE_JAVASCRIPT_ES=${VALIDATE_JAVASCRIPT_ES} \ + VALIDATE_JAVASCRIPT_STANDARD=${VALIDATE_JAVASCRIPT_STANDARD} \ + VALIDATE_JSON=${VALIDATE_JSON} \ + VALIDATE_KOTLIN=${VALIDATE_KOTLIN} \ + VALIDATE_MD=${VALIDATE_MD} \ + VALIDATE_OPENAPI=${VALIDATE_OPENAPI} \ + VALIDATE_PERL=${VALIDATE_PERL} \ + VALIDATE_PHP=${VALIDATE_PHP} \ + VALIDATE_POWERSHELL=${VALIDATE_POWERSHELL} \ + VALIDATE_PROTOBUF=${VALIDATE_PROTOBUF} \ + VALIDATE_PYTHON=${VALIDATE_PYTHON} \ + VALIDATE_RAKU=${VALIDATE_RAKU} \ + VALIDATE_RUBY=${VALIDATE_RUBY} \ + VALIDATE_STATES=${VALIDATE_STATES} \ + VALIDATE_TERRAFORM=${VALIDATE_TERRAFORM} \ + VALIDATE_TYPESCRIPT_ES=${VALIDATE_TYPESCRIPT_ES} \ + VALIDATE_TYPESCRIPT_STANDARD=${VALIDATE_TYPESCRIPT_STANDARD} \ + VALIDATE_XML=${VALIDATE_XML} \ + VALIDATE_YAML=${VALIDATE_YAML} ############################# # Copy scripts to container # diff --git a/README.md b/README.md index 9ad35000..657f1861 100644 --- a/README.md +++ b/README.md @@ -33,17 +33,18 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base | *Language* | *Linter* | | --- | --- | | **Ansible** | [ansible-lint](https://github.com/ansible/ansible-lint) | -| **Azure Resource Manager (ARM)** | [arm-ttk](https://github.com/azure/arm-ttk) | +| **Azure Resource Manager (ARM)** | [arm-ttk](https://github.com/azure/arm-ttk) | | **AWS CloudFormation templates** | [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint/) | +| **AWS States Language | [asl-validator](https://github.com/ChristopheBougere/asl-validator) | | **CSS** | [stylelint](https://stylelint.io/) | | **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) | | **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) | -| **Dart** | [dartanalyzer](https://dart.dev/guides/language/analysis-options) | +| **Dart** | [dartanalyzer](https://dart.dev/guides/language/analysis-options) | | **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) | | **EDITORCONFIG** | [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) | | **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | | **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) | -| **HTMLHint** | [HTMLHint](https://github.com/htmlhint/HTMLHint) | +| **HTMLHint** | [HTMLHint](https://github.com/htmlhint/HTMLHint) | | **JavaScript** | [eslint](https://eslint.org/) [standard js](https://standardjs.com/) | | **JSON** | [jsonlint](https://github.com/zaach/jsonlint) | | **Kotlin** | [ktlint](https://github.com/pinterest/ktlint) | @@ -154,53 +155,54 @@ and won't run anything unexpected. | **ENV VAR** | **Default Value** | **Notes** | | --- | --- | --- | -| **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_RULES_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. | -| **VALIDATE_MD** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_BASH** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_PERL** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_RAKU** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_PHP** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_PYTHON** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_RUBY** | `true` | Flag to enable or disable the linting process of the language. | -| **RUBY_CONFIG_FILE** | `.ruby-lint.yml` | Filename for [rubocop configuration](https://docs.rubocop.org/rubocop/configuration.html) (ex: `.ruby-lint.yml`, `.rubocop.yml`)| -| **VALIDATE_COFFEE** | `true` | Flag to enable or disable the linting process of the language . | -| **VALIDATE_ANSIBLE** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_JAVASCRIPT_ES** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: eslint) | -| **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`)| -| **VALIDATE_JAVASCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: standard) | -| **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: eslint) | -| **VALIDATE_TSX** | `true` | Flag to enable or disable the linting process for tsx files (Utilizing: eslint) | -| **VALIDATE_TYPESCRIPT_ES** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: eslint) | -| **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`)| -| **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the language. (Utilizing: standard) | -| **VALIDATE_DOCKER** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_GO** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_POWERSHELL** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_ARM** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_TERRAFORM** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_HTML** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_OPENAPI** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_CLOUDFORMATION** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_PROTOBUF** | `true` | Flag to enable or disable the linting process of the language. | -| **VALIDATE_EDITORCONFIG** | `true` | Flag to enable or disable the linting process with the editorconfig. | -| **ANSIBLE_DIRECTORY** | `/ansible` | Flag to set the root directory for Ansible file location(s). | | **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | -| **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. | +| **ANSIBLE_DIRECTORY** | `/ansible` | Flag to set the root directory for Ansible file location(s). | +| **DEFAULT_BRANCH** | `master` | The name of the repository default branch. | | **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. | +| **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`)| +| **LINTER_RULES_PATH** | `.github/linters` | Directory for all linter configuration rules. | +| **MULTI_STATUS** | `true` | A status API is made for each language that is linted to make visual parsing easier. | | **OUTPUT_FORMAT** | `none` | The report format to be generated, besides the stdout one. Output format of tap is currently using v13 of the specification. Supported formats: tap | | **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. Output folder must not previously exist. | | **OUTPUT_DETAILS** | `simpler` | What level of details to be reported. Supported formats: simpler or detailed. | -| **MULTI_STATUS** | `true` | A status API is made for each language that is linted to make visual parsing easier. | +| **RUBY_CONFIG_FILE** | `.ruby-lint.yml` | Filename for [rubocop configuration](https://docs.rubocop.org/rubocop/configuration.html) (ex: `.ruby-lint.yml`, `.rubocop.yml`)| +| **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`)| +| **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_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. | +| **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the Clojure language. | +| **VALIDATE_CLOUDFORMATION** | `true` | Flag to enable or disable the linting process of the AWS Cloud Formation language. | +| **VALIDATE_COFFEE** | `true` | Flag to enable or disable the linting process of the Coffeescript language . | +| **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the CSS language. | +| **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the Dart language. | +| **VALIDATE_DOCKER** | `true` | Flag to enable or disable the linting process of the Docker language. | +| **VALIDATE_EDITORCONFIG** | `true` | Flag to enable or disable the linting process with the editorconfig. | +| **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the ENV language. | +| **VALIDATE_GO** | `true` | Flag to enable or disable the linting process of the Golang language. | +| **VALIDATE_HTML** | `true` | Flag to enable or disable the linting process of the HTML language. | +| **VALIDATE_JAVASCRIPT_ES** | `true` | Flag to enable or disable the linting process of the Javascript language. (Utilizing: eslint) | +| **VALIDATE_JAVASCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Javascript language. (Utilizing: standard) | +| **VALIDATE_JSON** | `true` | Flag to enable or disable the linting process of the JSON language. | +| **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: eslint) | +| **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the Kotlin language. | +| **VALIDATE_MD** | `true` | Flag to enable or disable the linting process of the Markdown language. | +| **VALIDATE_OPENAPI** | `true` | Flag to enable or disable the linting process of the OpenAPI language. | +| **VALIDATE_PERL** | `true` | Flag to enable or disable the linting process of the Perl language. | +| **VALIDATE_PHP** | `true` | Flag to enable or disable the linting process of the PHP language. | +| **VALIDATE_PROTOBUF** | `true` | Flag to enable or disable the linting process of the Protobuf language. | +| **VALIDATE_PYTHON** | `true` | Flag to enable or disable the linting process of the Python language. | +| **VALIDATE_POWERSHELL** | `true` | Flag to enable or disable the linting process of the Powershell language. | +| **VALIDATE_RAKU** | `true` | Flag to enable or disable the linting process of the Raku language. | +| **VALIDATE_RUBY** | `true` | Flag to enable or disable the linting process of the Ruby language. | +| **VALIDATE_STATES** | `true` | Flag to enable or disable the linting process for AWS States Language. | +| **VALIDATE_TERRAFORM** | `true` | Flag to enable or disable the linting process of the Terraform language. | +| **VALIDATE_TSX** | `true` | Flag to enable or disable the linting process for tsx files (Utilizing: eslint) | +| **VALIDATE_TYPESCRIPT_ES** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: eslint) | +| **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: standard) | +| **VALIDATE_XML** | `true` | Flag to enable or disable the linting process of the XML language. | +| **VALIDATE_YAML** | `true` |Flag to enable or disable the linting process of the YAML language. | ### Template rules files You can use the **GitHub** **Super-Linter** *with* or *without* your own personal rules sets. This allows for greater flexibility for each individual code base. The Template rules all try to follow the standards we believe should be enabled at the basic level. diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index 7e105d32..6cf87663 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -160,6 +160,15 @@ function BuildFileList() { ################################ FILE_ARRAY_CFN+=("$FILE") fi + ############################################ + # Check if the file is AWS States Language # + ############################################ + if DetectAWSStatesFIle "$FILE"; then + ################################ + # Append the file to the array # + ################################ + FILE_ARRAY_STATES+=("$FILE") + fi ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## diff --git a/lib/linter.sh b/lib/linter.sh index 030bb170..f1a87849 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -21,89 +21,91 @@ source /action/lib/worker.sh # Source the function script(s) ########### # GLOBALS # ########### -# Default Vars -DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location -LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory -# YAML Vars -YAML_FILE_NAME='.yaml-lint.yml' # Name of the file -YAML_LINTER_RULES="$DEFAULT_RULES_LOCATION/$YAML_FILE_NAME" # Path to the yaml lint rules -# MD Vars -MARKDOWN_FILE_NAME='.markdown-lint.yml' # Name of the file -MARKDOWN_LINTER_RULES="$DEFAULT_RULES_LOCATION/$MARKDOWN_FILE_NAME" # Path to the markdown lint rules -# Python Vars -PYTHON_FILE_NAME='.python-lint' # Name of the file -PYTHON_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PYTHON_FILE_NAME" # Path to the python lint rules -# Cloudformation Vars -CFN_FILE_NAME='.cfnlintrc.yml' # Name of the file -CFN_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CFN_FILE_NAME" # Path to the cloudformation lint rules -# Ruby Vars -RUBY_FILE_NAME="${RUBY_CONFIG_FILE:-.ruby-lint.yml}" # Name of the file -RUBY_LINTER_RULES="$DEFAULT_RULES_LOCATION/$RUBY_FILE_NAME" # Path to the ruby lint rules -# Coffee Vars -COFFEE_FILE_NAME='.coffee-lint.json' # Name of the file -COFFEESCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$COFFEE_FILE_NAME" # Path to the coffeescript lint rules -# Javascript Vars -JAVASCRIPT_FILE_NAME="${JAVASCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file -JAVASCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$JAVASCRIPT_FILE_NAME" # Path to the Javascript lint rules -JAVASCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard -# Typescript Vars -TYPESCRIPT_FILE_NAME="${TYPESCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file -TYPESCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$TYPESCRIPT_FILE_NAME" # Path to the Typescript lint rules -TYPESCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard # Ansible Vars ANSIBLE_FILE_NAME='.ansible-lint.yml' # Name of the file ANSIBLE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$ANSIBLE_FILE_NAME" # Path to the Ansible lint rules +# Azure Resource Manager Vars +ARM_FILE_NAME='.arm-ttk.psd1' # Name of the file +ARM_LINTER_RULES="$DEFAULT_RULES_LOCATION/$ARM_FILE_NAME" # Path to the ARM lint rules +# Cloudformation Vars +CFN_FILE_NAME='.cfnlintrc.yml' # Name of the file +CFN_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CFN_FILE_NAME" # Path to the cloudformation lint rules +# Clojure Vars +CLOJURE_FILE_NAME='.clj-kondo/config.edn' # Name of the file +CLOJURE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CLOJURE_FILE_NAME" # Path to the Clojure lint rules +# Coffee Vars +COFFEESCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$COFFEE_FILE_NAME" # Path to the coffeescript lint rules +COFFEE_FILE_NAME='.coffee-lint.json' # Name of the file +# CSS Vars +CSS_FILE_NAME='.stylelintrc.json' # Name of the file +CSS_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CSS_FILE_NAME" # Path to the CSS lint rules +# Dart Vars +DART_FILE_NAME='analysis_options.yaml' # Name of the file +DART_LINTER_RULES="$DEFAULT_RULES_LOCATION/$DART_FILE_NAME" # Path to the DART lint rules +# Default Vars +DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location # Docker Vars DOCKER_FILE_NAME='.dockerfilelintrc' # Name of the file DOCKER_LINTER_RULES="$DEFAULT_RULES_LOCATION/$DOCKER_FILE_NAME" # Path to the Docker 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 -# Terraform Vars -TERRAFORM_FILE_NAME='.tflint.hcl' # Name of the file -TERRAFORM_LINTER_RULES="$DEFAULT_RULES_LOCATION/$TERRAFORM_FILE_NAME" # Path to the Terraform lint rules -# Powershell Vars -POWERSHELL_FILE_NAME='.powershell-psscriptanalyzer.psd1' # Name of the file -POWERSHELL_LINTER_RULES="$DEFAULT_RULES_LOCATION/$POWERSHELL_FILE_NAME" # Path to the Powershell lint rules -# Azure Resource Manager Vars -ARM_FILE_NAME='.arm-ttk.psd1' # Name of the file -ARM_LINTER_RULES="$DEFAULT_RULES_LOCATION/$ARM_FILE_NAME" # Path to the ARM lint rules -# CSS Vars -CSS_FILE_NAME='.stylelintrc.json' # Name of the file -CSS_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CSS_FILE_NAME" # Path to the CSS lint rules -# OpenAPI Vars -OPENAPI_FILE_NAME='.openapirc.yml' # Name of the file -OPENAPI_LINTER_RULES="$DEFAULT_RULES_LOCATION/$OPENAPI_FILE_NAME" # Path to the OpenAPI lint rules -# Protocol Buffers Vars -PROTOBUF_FILE_NAME='.protolintrc.yml' # Name of the file -PROTOBUF_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PROTOBUF_FILE_NAME" # Path to the Protocol Buffers lint rules -# Clojure Vars -CLOJURE_FILE_NAME='.clj-kondo/config.edn' # Name of the file -CLOJURE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CLOJURE_FILE_NAME" # Path to the Clojure lint rules -# Dart Vars -DART_FILE_NAME='analysis_options.yaml' # Name of the file -DART_LINTER_RULES="$DEFAULT_RULES_LOCATION/$DART_FILE_NAME" # Path to the DART lint rules # HTML Vars HTML_FILE_NAME='.htmlhintrc' # Name of the file HTML_LINTER_RULES="$DEFAULT_RULES_LOCATION/$HTML_FILE_NAME" # Path to the CSS lint rules +# Javascript Vars +JAVASCRIPT_FILE_NAME="${JAVASCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file +JAVASCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$JAVASCRIPT_FILE_NAME" # Path to the Javascript lint rules +JAVASCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard +# Default linter path +LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory +# MD Vars +MARKDOWN_FILE_NAME='.markdown-lint.yml' # Name of the file +MARKDOWN_LINTER_RULES="$DEFAULT_RULES_LOCATION/$MARKDOWN_FILE_NAME" # Path to the markdown lint rules +# OpenAPI Vars +OPENAPI_FILE_NAME='.openapirc.yml' # Name of the file +OPENAPI_LINTER_RULES="$DEFAULT_RULES_LOCATION/$OPENAPI_FILE_NAME" # Path to the OpenAPI lint rules +# Powershell Vars +POWERSHELL_FILE_NAME='.powershell-psscriptanalyzer.psd1' # Name of the file +POWERSHELL_LINTER_RULES="$DEFAULT_RULES_LOCATION/$POWERSHELL_FILE_NAME" # Path to the Powershell lint rules +# Protocol Buffers Vars +PROTOBUF_FILE_NAME='.protolintrc.yml' # Name of the file +PROTOBUF_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PROTOBUF_FILE_NAME" # Path to the Protocol Buffers lint rules +# Python Vars +PYTHON_FILE_NAME='.python-lint' # Name of the file +PYTHON_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PYTHON_FILE_NAME" # Path to the python lint rules +# Ruby Vars +RUBY_FILE_NAME="${RUBY_CONFIG_FILE:-.ruby-lint.yml}" # Name of the file +RUBY_LINTER_RULES="$DEFAULT_RULES_LOCATION/$RUBY_FILE_NAME" # Path to the ruby lint rules +# Terraform Vars +TERRAFORM_FILE_NAME='.tflint.hcl' # Name of the file +TERRAFORM_LINTER_RULES="$DEFAULT_RULES_LOCATION/$TERRAFORM_FILE_NAME" # Path to the Terraform lint rules +# Typescript Vars +TYPESCRIPT_FILE_NAME="${TYPESCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file +TYPESCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$TYPESCRIPT_FILE_NAME" # Path to the Typescript lint rules +TYPESCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard +# YAML Vars +YAML_FILE_NAME='.yaml-lint.yml' # Name of the file +YAML_LINTER_RULES="$DEFAULT_RULES_LOCATION/$YAML_FILE_NAME" # Path to the yaml lint rules ####################################### # Linter array for information prints # ####################################### -LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck" - "pylint" "perl" "raku" "rubocop" "coffeelint" "eslint" "standard" - "ansible-lint" "dockerfilelint" "golangci-lint" "tflint" - "stylelint" "dotenv-linter" "pwsh" "arm-ttk" "ktlint" "protolint" "clj-kondo" - "spectral" "cfn-lint" "dart" "htmlhint") +LINTER_ARRAY=('ansible-lint' 'arm-ttk' 'asl-validator' 'cfn-lint' 'clj-kondo' 'coffeelint' + 'dart' 'dockerfilelint' 'dotenv-linter' 'eslint' 'golangci-lint' 'htmlhint' + 'jsonlint' 'ktlint' 'markdownlint' 'perl' 'protolint' 'pwsh' 'pylint' + 'raku' 'rubocop' 'shellcheck' 'spectral' 'standard' 'stylelint' 'tflint' + 'xmllint' 'yamllint') ############################# # Language array for prints # ############################# LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'CFN' 'CLOJURE' 'COFFEESCRIPT' - 'CSS' 'DART' 'DOCKER' 'ENV' 'GO' 'HTML' - 'JAVASCRIPT_ES' 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'OPENAPI' - 'MARKDOWN' 'PERL' 'PHP' 'POWERSHELL' 'PROTOBUF' 'PYTHON' 'RAKU' 'RUBY' - 'TERRAFORM' 'TSX' 'TYPESCRIPT_ES' 'TYPESCRIPT_STANDARD' 'XML' 'YML' ) + 'CSS' 'DART' 'DOCKER' 'ENV' 'GO' 'HTML' 'JAVASCRIPT_ES' + 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'MARKDOWN' 'OPENAPI' + 'PERL' 'PHP' 'POWERSHELL' 'PROTOBUF' 'PYTHON' + 'RAKU' 'RUBY' 'STATES' 'TERRAFORM' 'TSX' 'TYPESCRIPT_ES' 'TYPESCRIPT_STANDARD' + 'XML' 'YML') ############################################ # Array for all languages that were linted # @@ -113,15 +115,17 @@ LINTED_LANGUAGES_ARRAY=() # Will be filled at run time with all languages that w ################### # GitHub ENV Vars # ################### -GITHUB_SHA="${GITHUB_SHA}" # GitHub sha from the commit +ANSIBLE_DIRECTORY="${ANSIBLE_DIRECTORY}" # Ansible Directory +DEFAULT_BRANCH="${DEFAULT_BRANCH:-master}" # Default Git Branch to use (master by default) +DISABLE_ERRORS="${DISABLE_ERRORS}" # Boolean to enable warning-only output without throwing errors GITHUB_EVENT_PATH="${GITHUB_EVENT_PATH}" # Github Event Path -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # Github Workspace -GITHUB_TOKEN="${GITHUB_TOKEN}" # GitHub Token passed from environment GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system GITHUB_RUN_ID="${GITHUB_RUN_ID}" # GitHub RUn ID to point to logs -DEFAULT_BRANCH="${DEFAULT_BRANCH:-master}" # Default Git Branch to use (master by default) +GITHUB_SHA="${GITHUB_SHA}" # GitHub sha from the commit +GITHUB_TOKEN="${GITHUB_TOKEN}" # GitHub Token passed from environment +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # Github Workspace MULTI_STATUS="${MULTI_STATUS:-true}" # Multiple status are created for each check ran -ANSIBLE_DIRECTORY="${ANSIBLE_DIRECTORY}" # Ansible Directory +TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files VALIDATE_ANSIBLE="${VALIDATE_ANSIBLE}" # Boolean to validate language VALIDATE_ARM="${VALIDATE_ARM}" # Boolean to validate language @@ -149,14 +153,13 @@ VALIDATE_POWERSHELL="${VALIDATE_POWERSHELL}" # Boolean to vali VALIDATE_PYTHON="${VALIDATE_PYTHON}" # Boolean to validate language VALIDATE_RAKU="${VALIDATE_RAKU}" # Boolean to validate language VALIDATE_RUBY="${VALIDATE_RUBY}" # Boolean to validate language +VALIDATE_STATES="${VALIDATE_STATES}" # Boolean to validate language VALIDATE_TERRAFORM="${VALIDATE_TERRAFORM}" # Boolean to validate language VALIDATE_TSX="${VALIDATE_TSX}" # Boolean to validate language VALIDATE_TYPESCRIPT_ES="${VALIDATE_TYPESCRIPT_ES}" # Boolean to validate language VALIDATE_TYPESCRIPT_STANDARD="${VALIDATE_TYPESCRIPT_STANDARD}" # Boolean to validate language VALIDATE_XML="${VALIDATE_XML}" # Boolean to validate language VALIDATE_YAML="${VALIDATE_YAML}" # 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 ############## # Debug Vars # @@ -225,6 +228,7 @@ FILE_ARRAY_PROTOBUF=() # Array of files to check FILE_ARRAY_PYTHON=() # Array of files to check FILE_ARRAY_RAKU=() # Array of files to check FILE_ARRAY_RUBY=() # Array of files to check +FILE_ARRAY_STATES=() # Array of files to check FILE_ARRAY_TERRAFORM=() # Array of files to check FILE_ARRAY_TSX=() # Array of files to check FILE_ARRAY_TYPESCRIPT_ES=() # Array of files to check @@ -261,6 +265,7 @@ ERRORS_FOUND_PROTOBUF=0 # Count of errors found ERRORS_FOUND_PYTHON=0 # Count of errors found ERRORS_FOUND_RAKU=0 # Count of errors found ERRORS_FOUND_RUBY=0 # Count of errors found +ERRORS_FOUND_STATES=0 # Count of errors found ERRORS_FOUND_TERRAFORM=0 # Count of errors found ERRORS_FOUND_TSX=0 # Count of errors found ERRORS_FOUND_TYPESCRIPT_STANDARD=0 # Count of errors found @@ -574,7 +579,28 @@ DetectCloudFormationFile() { ########################################## return 1 } +################################################################################ +#### Function DetectAWSStatesFIle ############################################## +DetectAWSStatesFIle() { + ################ + # Pull in Vars # + ################ + FILE="$1" # File that we need to validate + # https://states-language.net/spec.html#example + ############################### + # check if file has resources # + ############################### + if grep '"Resource": *"arn"*' "$FILE"; then + # Found it + return 0 + fi + + ################################################# + # No identifiers of a AWS States Language found # + ################################################# + return 1 +} ################################################################################ #### Function GetGitHubVars #################################################### GetGitHubVars() { @@ -936,38 +962,38 @@ Footer() { ############################### # Exit with 1 if errors found # ############################### - elif [ "$ERRORS_FOUND_YML" -ne 0 ] || - [ "$ERRORS_FOUND_JSON" -ne 0 ] || - [ "$ERRORS_FOUND_XML" -ne 0 ] || - [ "$ERRORS_FOUND_MARKDOWN" -ne 0 ] || + elif [ "$ERRORS_FOUND_ANSIBLE" -ne 0 ] || + [ "$ERRORS_FOUND_ARM" -ne 0 ] || [ "$ERRORS_FOUND_BASH" -ne 0 ] || - [ "$ERRORS_FOUND_PERL" -ne 0 ] || - [ "$ERRORS_FOUND_RAKU" -ne 0 ] || - [ "$ERRORS_FOUND_PHP" -ne 0 ] || - [ "$ERRORS_FOUND_PYTHON" -ne 0 ] || + [ "$ERRORS_FOUND_CFN" -ne 0 ] || + [ "$ERRORS_FOUND_CLOJURE" -ne 0 ] || [ "$ERRORS_FOUND_COFFEESCRIPT" -ne 0 ] || - [ "$ERRORS_FOUND_ANSIBLE" -ne 0 ] || + [ "$ERRORS_FOUND_CSS" -ne 0 ] || + [ "$ERRORS_FOUND_DART" -ne 0 ] || + [ "$ERRORS_FOUND_DOCKER" -ne 0 ] || + [ "$ERRORS_FOUND_ENV" -ne 0 ] || + [ "$ERRORS_FOUND_GO" -ne 0 ] || + [ "$ERRORS_FOUND_HTML" -ne 0 ] || [ "$ERRORS_FOUND_JAVASCRIPT_ES" -ne 0 ] || [ "$ERRORS_FOUND_JAVASCRIPT_STANDARD" -ne 0 ] || + [ "$ERRORS_FOUND_JSON" -ne 0 ] || [ "$ERRORS_FOUND_JSX" -ne 0 ] || + [ "$ERRORS_FOUND_KOTLIN" -ne 0 ] || + [ "$ERRORS_FOUND_MARKDOWN" -ne 0 ] || + [ "$ERRORS_FOUND_OPENAPI" -ne 0 ] || + [ "$ERRORS_FOUND_PERL" -ne 0 ] || + [ "$ERRORS_FOUND_PHP" -ne 0 ] || + [ "$ERRORS_FOUND_POWERSHELL" -ne 0 ] || + [ "$ERRORS_FOUND_PROTOBUF" -ne 0 ] || + [ "$ERRORS_FOUND_PYTHON" -ne 0 ] || + [ "$ERRORS_FOUND_RAKU" -ne 0 ] || + [ "$ERRORS_FOUND_RUBY" -ne 0 ] || + [ "$ERRORS_FOUND_TERRAFORM" -ne 0 ] || [ "$ERRORS_FOUND_TSX" -ne 0 ] || [ "$ERRORS_FOUND_TYPESCRIPT_ES" -ne 0 ] || [ "$ERRORS_FOUND_TYPESCRIPT_STANDARD" -ne 0 ] || - [ "$ERRORS_FOUND_DOCKER" -ne 0 ] || - [ "$ERRORS_FOUND_GO" -ne 0 ] || - [ "$ERRORS_FOUND_TERRAFORM" -ne 0 ] || - [ "$ERRORS_FOUND_POWERSHELL" -ne 0 ] || - [ "$ERRORS_FOUND_ARM" -ne 0 ] || - [ "$ERRORS_FOUND_RUBY" -ne 0 ] || - [ "$ERRORS_FOUND_CSS" -ne 0 ] || - [ "$ERRORS_FOUND_CFN" -ne 0 ] || - [ "$ERRORS_FOUND_ENV" -ne 0 ] || - [ "$ERRORS_FOUND_OPENAPI" -ne 0 ] || - [ "$ERRORS_FOUND_PROTOBUF" -ne 0 ] || - [ "$ERRORS_FOUND_CLOJURE" -ne 0 ] || - [ "$ERRORS_FOUND_KOTLIN" -ne 0 ] || - [ "$ERRORS_FOUND_DART" -ne 0 ] || - [ "$ERRORS_FOUND_HTML" -ne 0 ]; then + [ "$ERRORS_FOUND_XML" -ne 0 ] || + [ "$ERRORS_FOUND_YML" -ne 0 ]; then # Failed exit echo -e "${NC}${F[R]}Exiting with errors found!${NC}" exit 1 @@ -1500,6 +1526,16 @@ if [ "$VALIDATE_HTML" == "true" ]; then LintCodebase "HTML" "htmlhint" "htmlhint --config $HTML_LINTER_RULES" ".*\.\(html\)\$" "${FILE_ARRAY_HTML[@]}" fi +###################### +# AWS STATES LINTING # +###################### +if [ "$VALIDATE_STATES" == "true" ]; then + ######################### + # Lint the STATES files # + ######################### + LintCodebase "STATES" "asl-validator" "asl-validator --json-path" ".*\.\(json\)\$" "${FILE_ARRAY_STATES[@]}" +fi + ########## # Footer # ########## diff --git a/lib/validation.sh b/lib/validation.sh index 9be40a60..bbfaa08e 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -72,6 +72,7 @@ function GetValidationInfo() { VALIDATE_PYTHON="${VALIDATE_PYTHON,,}" VALIDATE_RAKU="${VALIDATE_RAKU,,}" VALIDATE_RUBY="${VALIDATE_RUBY,,}" + VALIDATE_STATES="${VALIDATE_STATES,,}" VALIDATE_TERRAFORM="${VALIDATE_TERRAFORM,,}" VALIDATE_TSX="${VALIDATE_TSX,,}" VALIDATE_TYPESCRIPT_ES="${VALIDATE_TYPESCRIPT_ES,,}" @@ -83,36 +84,36 @@ function GetValidationInfo() { # Determine if any linters were explicitly set # ################################################ ANY_SET="false" - if [[ -n $VALIDATE_YAML || -n \ - $VALIDATE_JSON || -n \ - $VALIDATE_XML || -n \ - $VALIDATE_MARKDOWN || -n \ + if [[ -n $VALIDATE_ANSIBLE || -n \ + $VALIDATE_ARM || -n \ $VALIDATE_BASH || -n \ - $VALIDATE_PERL || -n \ - $VALIDATE_RAKU || -n \ - $VALIDATE_PHP || -n \ - $VALIDATE_PYTHON || -n \ - $VALIDATE_RUBY || -n \ + $VALIDATE_CLOJURE || -n \ $VALIDATE_COFFEE || -n \ - $VALIDATE_ANSIBLE || -n \ + $VALIDATE_CSS || -n \ + $VALIDATE_DART || -n \ + $VALIDATE_DOCKER || -n \ + $VALIDATE_EDITORCONFIG || -n \ + $VALIDATE_ENV || -n \ + $VALIDATE_GO || -n \ + $VALIDATE_HTML ]]; then || -n \ $VALIDATE_JAVASCRIPT_ES || -n \ $VALIDATE_JAVASCRIPT_STANDARD || -n \ + $VALIDATE_JSON || -n \ + $VALIDATE_KOTLIN || -n \ + $VALIDATE_MARKDOWN || -n \ + $VALIDATE_OPENAPI || -n \ + $VALIDATE_PERL || -n \ + $VALIDATE_PHP || -n \ + $VALIDATE_POWERSHELL || -n \ + $VALIDATE_PROTOBUF || -n \ + $VALIDATE_PYTHON || -n \ + $VALIDATE_RAKU || -n \ + $VALIDATE_RUBY || -n \ + $VALIDATE_TERRAFORM || -n \ $VALIDATE_TYPESCRIPT_ES || -n \ $VALIDATE_TYPESCRIPT_STANDARD || -n \ - $VALIDATE_DOCKER || -n \ - $VALIDATE_GO || -n \ - $VALIDATE_TERRAFORM || -n \ - $VALIDATE_POWERSHELL || -n \ - $VALIDATE_ARM || -n \ - $VALIDATE_CSS || -n \ - $VALIDATE_ENV || -n \ - $VALIDATE_CLOJURE || -n \ - $VALIDATE_PROTOBUF || -n \ - $VALIDATE_OPENAPI || -n \ - $VALIDATE_KOTLIN || -n \ - $VALIDATE_DART || -n \ - $VALIDATE_EDITORCONFIG || -n \ - $VALIDATE_HTML ]]; then + $VALIDATE_XML || -n \ + $VALIDATE_YAML ]]; then ANY_SET="true" fi @@ -256,6 +257,20 @@ function GetValidationInfo() { VALIDATE_RUBY="true" fi + ########################################## + # Validate if we should check AWS States # + ########################################## + if [[ $ANY_SET == "true" ]]; then + # Some linter flags were set - only run those set to true + if [[ -z $VALIDATE_STATES ]]; then + # STATES flag was not set - default to false + VALIDATE_STATES="false" + fi + else + # No linter flags were set - default all to true + VALIDATE_STATES="true" + fi + ###################################### # Validate if we should check COFFEE # ###################################### @@ -720,6 +735,11 @@ function GetValidationInfo() { else PRINT_ARRAY+=("- Excluding [HTML] files in code base...") fi + if [[ $VALIDATE_STATES == "true" ]]; then + PRINT_ARRAY+=("- Validating [AWS STATES] files in code base...") + else + PRINT_ARRAY+=("- Excluding [AWS STATES] files in code base...") + fi ############################## # Validate Ansible Directory # diff --git a/lib/worker.sh b/lib/worker.sh index 17db091c..ef3055aa 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -578,6 +578,7 @@ function RunTestCases() { TestCodebase "PYTHON" "pylint" "pylint --rcfile $PYTHON_LINTER_RULES" ".*\.\(py\)\$" "python" TestCodebase "RAKU" "raku" "raku -c" ".*\.\(raku\|rakumod\|rakutest\|pm6\|pl6\|p6\)\$" "raku" TestCodebase "RUBY" "rubocop" "rubocop -c $RUBY_LINTER_RULES" ".*\.\(rb\)\$" "ruby" + TestCodebase "STATES" "asl-validator" "asl-validator --json-path" ".*\.\(json\)\$" "states" TestCodebase "TERRAFORM" "tflint" "tflint -c $TERRAFORM_LINTER_RULES" ".*\.\(tf\)\$" "terraform" TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(ts\)\$" "typescript" TestCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin $TYPESCRIPT_STANDARD_LINTER_RULES" ".*\.\(ts\)\$" "typescript" From ea77cfa8860cdb25b83263c28f70b1618ca081c2 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 13:55:27 -0500 Subject: [PATCH 84/96] cleanup of big clean --- .github/workflows/stack-linter.yml | 1 + lib/linter.sh | 1 + lib/validation.sh | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stack-linter.yml b/.github/workflows/stack-linter.yml index d301d0c4..33f611e9 100644 --- a/.github/workflows/stack-linter.yml +++ b/.github/workflows/stack-linter.yml @@ -44,3 +44,4 @@ jobs: uses: docker://github/super-linter:latest env: VALIDATE_ALL_CODEBASE: false + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/lib/linter.sh b/lib/linter.sh index f1a87849..714709a0 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -988,6 +988,7 @@ Footer() { [ "$ERRORS_FOUND_PYTHON" -ne 0 ] || [ "$ERRORS_FOUND_RAKU" -ne 0 ] || [ "$ERRORS_FOUND_RUBY" -ne 0 ] || + [ "$ERRORS_FOUND_STATES" -ne 0 ] || [ "$ERRORS_FOUND_TERRAFORM" -ne 0 ] || [ "$ERRORS_FOUND_TSX" -ne 0 ] || [ "$ERRORS_FOUND_TYPESCRIPT_ES" -ne 0 ] || diff --git a/lib/validation.sh b/lib/validation.sh index bbfaa08e..8d784e09 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -95,7 +95,7 @@ function GetValidationInfo() { $VALIDATE_EDITORCONFIG || -n \ $VALIDATE_ENV || -n \ $VALIDATE_GO || -n \ - $VALIDATE_HTML ]]; then || -n \ + $VALIDATE_HTML || -n \ $VALIDATE_JAVASCRIPT_ES || -n \ $VALIDATE_JAVASCRIPT_STANDARD || -n \ $VALIDATE_JSON || -n \ From d7bbd8d3bbaaba16ea0586644ce7a345474d1ec4 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 14:06:01 -0500 Subject: [PATCH 85/96] adding var --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 6d216eed..5b244efe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -196,6 +196,7 @@ ENV ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ DISABLE_ERRORS=${DISABLE_ERRORS} \ GITHUB_EVENT_PATH=${GITHUB_EVENT_PATH} \ GITHUB_SHA=${GITHUB_SHA} \ + GITHUB_TOKEN=${GITHUB_TOKEN} \ GITHUB_WORKSPACE=${GITHUB_WORKSPACE} \ LINTER_RULES_PATH=${LINTER_RULES_PATH} \ OUTPUT_DETAILS=${OUTPUT_DETAILS} \ From 1bb5236960830a30705336e1aa27669c5bf3e2e5 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 21 Jul 2020 14:23:56 -0500 Subject: [PATCH 86/96] Fixes --- lib/linter.sh | 4 ++-- lib/validation.sh | 60 +++++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 714709a0..aa4fbcb7 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -23,10 +23,10 @@ source /action/lib/worker.sh # Source the function script(s) ########### # Ansible Vars ANSIBLE_FILE_NAME='.ansible-lint.yml' # Name of the file -ANSIBLE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$ANSIBLE_FILE_NAME" # Path to the Ansible lint rules +ANSIBLE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${ANSIBLE_FILE_NAME}" # Path to the Ansible lint rules # Azure Resource Manager Vars ARM_FILE_NAME='.arm-ttk.psd1' # Name of the file -ARM_LINTER_RULES="$DEFAULT_RULES_LOCATION/$ARM_FILE_NAME" # Path to the ARM lint rules +ARM_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${ARM_FILE_NAME}" # Path to the ARM lint rules # Cloudformation Vars CFN_FILE_NAME='.cfnlintrc.yml' # Name of the file CFN_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CFN_FILE_NAME" # Path to the cloudformation lint rules diff --git a/lib/validation.sh b/lib/validation.sh index 8d784e09..e5ef62f3 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -84,36 +84,36 @@ function GetValidationInfo() { # Determine if any linters were explicitly set # ################################################ ANY_SET="false" - if [[ -n $VALIDATE_ANSIBLE || -n \ - $VALIDATE_ARM || -n \ - $VALIDATE_BASH || -n \ - $VALIDATE_CLOJURE || -n \ - $VALIDATE_COFFEE || -n \ - $VALIDATE_CSS || -n \ - $VALIDATE_DART || -n \ - $VALIDATE_DOCKER || -n \ - $VALIDATE_EDITORCONFIG || -n \ - $VALIDATE_ENV || -n \ - $VALIDATE_GO || -n \ - $VALIDATE_HTML || -n \ - $VALIDATE_JAVASCRIPT_ES || -n \ - $VALIDATE_JAVASCRIPT_STANDARD || -n \ - $VALIDATE_JSON || -n \ - $VALIDATE_KOTLIN || -n \ - $VALIDATE_MARKDOWN || -n \ - $VALIDATE_OPENAPI || -n \ - $VALIDATE_PERL || -n \ - $VALIDATE_PHP || -n \ - $VALIDATE_POWERSHELL || -n \ - $VALIDATE_PROTOBUF || -n \ - $VALIDATE_PYTHON || -n \ - $VALIDATE_RAKU || -n \ - $VALIDATE_RUBY || -n \ - $VALIDATE_TERRAFORM || -n \ - $VALIDATE_TYPESCRIPT_ES || -n \ - $VALIDATE_TYPESCRIPT_STANDARD || -n \ - $VALIDATE_XML || -n \ - $VALIDATE_YAML ]]; then + if [[ -n ${VALIDATE_ANSIBLE} || -n \ + ${VALIDATE_ARM} || -n \ + ${VALIDATE_BASH} || -n \ + ${VALIDATE_CLOJURE} || -n \ + ${VALIDATE_COFFEE} || -n \ + ${VALIDATE_CSS} || -n \ + ${VALIDATE_DART} || -n \ + ${VALIDATE_DOCKER} || -n \ + ${VALIDATE_EDITORCONFIG} || -n \ + ${VALIDATE_ENV} || -n \ + ${VALIDATE_GO} || -n \ + ${VALIDATE_HTML} || -n \ + ${VALIDATE_JAVASCRIPT_ES} || -n \ + ${VALIDATE_JAVASCRIPT_STANDARD} || -n \ + ${VALIDATE_JSON} || -n \ + ${VALIDATE_KOTLIN} || -n \ + ${VALIDATE_MARKDOWN} || -n \ + ${VALIDATE_OPENAPI} || -n \ + ${VALIDATE_PERL} || -n \ + ${VALIDATE_PHP} || -n \ + ${VALIDATE_POWERSHELL} || -n \ + ${VALIDATE_PROTOBUF} || -n \ + ${VALIDATE_PYTHON} || -n \ + ${VALIDATE_RAKU} || -n \ + ${VALIDATE_RUBY} || -n \ + ${VALIDATE_TERRAFORM} || -n \ + ${VALIDATE_TYPESCRIPT_ES} || -n \ + ${VALIDATE_TYPESCRIPT_STANDARD} || -n \ + ${VALIDATE_XML} || -n \ + ${VALIDATE_YAML} ]]; then ANY_SET="true" fi From 71a3cd9093fe63d63f91a38d22ad048d53eaba34 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 21 Jul 2020 14:39:14 -0500 Subject: [PATCH 87/96] Braces orthodontist --- lib/buildFileList.sh | 4 +- lib/linter.sh | 106 +++++++++++++++++++++---------------------- lib/validation.sh | 6 +-- lib/worker.sh | 8 ++-- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index e01070a0..eef350c6 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -163,11 +163,11 @@ function BuildFileList() { ############################################ # Check if the file is AWS States Language # ############################################ - if DetectAWSStatesFIle "$FILE"; then + if DetectAWSStatesFIle "${FILE}"; then ################################ # Append the file to the array # ################################ - FILE_ARRAY_STATES+=("$FILE") + FILE_ARRAY_STATES+=("${FILE}") fi ########################################################## # Set the READ_ONLY_CHANGE_FLAG since this could be exec # diff --git a/lib/linter.sh b/lib/linter.sh index 3a7d5b76..4727016c 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -29,19 +29,19 @@ ARM_FILE_NAME='.arm-ttk.psd1' # Name o ARM_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${ARM_FILE_NAME}" # Path to the ARM lint rules # Cloudformation Vars CFN_FILE_NAME='.cfnlintrc.yml' # Name of the file -CFN_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CFN_FILE_NAME" # Path to the cloudformation lint rules +CFN_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CFN_FILE_NAME}" # Path to the cloudformation lint rules # Clojure Vars CLOJURE_FILE_NAME='.clj-kondo/config.edn' # Name of the file -CLOJURE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CLOJURE_FILE_NAME" # Path to the Clojure lint rules +CLOJURE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CLOJURE_FILE_NAME}" # Path to the Clojure lint rules # Coffee Vars -COFFEESCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$COFFEE_FILE_NAME" # Path to the coffeescript lint rules +COFFEESCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${COFFEE_FILE_NAME}" # Path to the coffeescript lint rules COFFEE_FILE_NAME='.coffee-lint.json' # Name of the file # CSS Vars CSS_FILE_NAME='.stylelintrc.json' # Name of the file -CSS_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CSS_FILE_NAME" # Path to the CSS lint rules +CSS_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CSS_FILE_NAME}" # Path to the CSS lint rules # Dart Vars DART_FILE_NAME='analysis_options.yaml' # Name of the file -DART_LINTER_RULES="$DEFAULT_RULES_LOCATION/$DART_FILE_NAME" # Path to the DART lint rules +DART_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DART_FILE_NAME}" # Path to the DART lint rules # Default Vars DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location # Docker Vars @@ -49,44 +49,44 @@ DOCKER_FILE_NAME='.dockerfilelintrc' # Name o DOCKER_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKER_FILE_NAME}" # Path to the Docker 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 +GO_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${GO_FILE_NAME}" # Path to the Go lint rules # HTML Vars HTML_FILE_NAME='.htmlhintrc' # Name of the file -HTML_LINTER_RULES="$DEFAULT_RULES_LOCATION/$HTML_FILE_NAME" # Path to the CSS lint rules +HTML_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${HTML_FILE_NAME}" # Path to the CSS lint rules # Javascript Vars JAVASCRIPT_FILE_NAME="${JAVASCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file -JAVASCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$JAVASCRIPT_FILE_NAME" # Path to the Javascript lint rules +JAVASCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${JAVASCRIPT_FILE_NAME}" # Path to the Javascript lint rules JAVASCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard # Default linter path LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory # MD Vars MARKDOWN_FILE_NAME='.markdown-lint.yml' # Name of the file -MARKDOWN_LINTER_RULES="$DEFAULT_RULES_LOCATION/$MARKDOWN_FILE_NAME" # Path to the markdown lint rules +MARKDOWN_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${MARKDOWN_FILE_NAME}" # Path to the markdown lint rules # OpenAPI Vars OPENAPI_FILE_NAME='.openapirc.yml' # Name of the file -OPENAPI_LINTER_RULES="$DEFAULT_RULES_LOCATION/$OPENAPI_FILE_NAME" # Path to the OpenAPI lint rules +OPENAPI_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${OPENAPI_FILE_NAME}" # Path to the OpenAPI lint rules # Powershell Vars POWERSHELL_FILE_NAME='.powershell-psscriptanalyzer.psd1' # Name of the file -POWERSHELL_LINTER_RULES="$DEFAULT_RULES_LOCATION/$POWERSHELL_FILE_NAME" # Path to the Powershell lint rules +POWERSHELL_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${POWERSHELL_FILE_NAME}" # Path to the Powershell lint rules # Protocol Buffers Vars PROTOBUF_FILE_NAME='.protolintrc.yml' # Name of the file -PROTOBUF_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PROTOBUF_FILE_NAME" # Path to the Protocol Buffers lint rules +PROTOBUF_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${PROTOBUF_FILE_NAME}" # Path to the Protocol Buffers lint rules # Python Vars PYTHON_FILE_NAME='.python-lint' # Name of the file -PYTHON_LINTER_RULES="$DEFAULT_RULES_LOCATION/$PYTHON_FILE_NAME" # Path to the python lint rules +PYTHON_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${PYTHON_FILE_NAME}" # Path to the python lint rules # Ruby Vars RUBY_FILE_NAME="${RUBY_CONFIG_FILE:-.ruby-lint.yml}" # Name of the file -RUBY_LINTER_RULES="$DEFAULT_RULES_LOCATION/$RUBY_FILE_NAME" # Path to the ruby lint rules +RUBY_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${RUBY_FILE_NAME}" # Path to the ruby lint rules # Terraform Vars TERRAFORM_FILE_NAME='.tflint.hcl' # Name of the file -TERRAFORM_LINTER_RULES="$DEFAULT_RULES_LOCATION/$TERRAFORM_FILE_NAME" # Path to the Terraform lint rules +TERRAFORM_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${TERRAFORM_FILE_NAME}" # Path to the Terraform lint rules # Typescript Vars TYPESCRIPT_FILE_NAME="${TYPESCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file -TYPESCRIPT_LINTER_RULES="$DEFAULT_RULES_LOCATION/$TYPESCRIPT_FILE_NAME" # Path to the Typescript lint rules +TYPESCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${TYPESCRIPT_FILE_NAME}" # Path to the Typescript lint rules TYPESCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard # YAML Vars YAML_FILE_NAME='.yaml-lint.yml' # Name of the file -YAML_LINTER_RULES="$DEFAULT_RULES_LOCATION/$YAML_FILE_NAME" # Path to the yaml lint rules +YAML_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${YAML_FILE_NAME}" # Path to the yaml lint rules ####################################### @@ -586,13 +586,13 @@ DetectAWSStatesFIle() { ################ # Pull in Vars # ################ - FILE="$1" # File that we need to validate + FILE="${1}" # File that we need to validate # https://states-language.net/spec.html#example ############################### # check if file has resources # ############################### - if grep '"Resource": *"arn"*' "$FILE"; then + if grep '"Resource": *"arn"*' "${FILE}"; then # Found it return 0 fi @@ -963,39 +963,39 @@ Footer() { ############################### # Exit with 1 if errors found # ############################### - elif [ "$ERRORS_FOUND_ANSIBLE" -ne 0 ] || - [ "$ERRORS_FOUND_ARM" -ne 0 ] || - [ "$ERRORS_FOUND_BASH" -ne 0 ] || - [ "$ERRORS_FOUND_CFN" -ne 0 ] || - [ "$ERRORS_FOUND_CLOJURE" -ne 0 ] || - [ "$ERRORS_FOUND_COFFEESCRIPT" -ne 0 ] || - [ "$ERRORS_FOUND_CSS" -ne 0 ] || - [ "$ERRORS_FOUND_DART" -ne 0 ] || - [ "$ERRORS_FOUND_DOCKER" -ne 0 ] || - [ "$ERRORS_FOUND_ENV" -ne 0 ] || - [ "$ERRORS_FOUND_GO" -ne 0 ] || - [ "$ERRORS_FOUND_HTML" -ne 0 ] || - [ "$ERRORS_FOUND_JAVASCRIPT_ES" -ne 0 ] || - [ "$ERRORS_FOUND_JAVASCRIPT_STANDARD" -ne 0 ] || - [ "$ERRORS_FOUND_JSON" -ne 0 ] || - [ "$ERRORS_FOUND_JSX" -ne 0 ] || - [ "$ERRORS_FOUND_KOTLIN" -ne 0 ] || - [ "$ERRORS_FOUND_MARKDOWN" -ne 0 ] || - [ "$ERRORS_FOUND_OPENAPI" -ne 0 ] || - [ "$ERRORS_FOUND_PERL" -ne 0 ] || - [ "$ERRORS_FOUND_PHP" -ne 0 ] || - [ "$ERRORS_FOUND_POWERSHELL" -ne 0 ] || - [ "$ERRORS_FOUND_PROTOBUF" -ne 0 ] || - [ "$ERRORS_FOUND_PYTHON" -ne 0 ] || - [ "$ERRORS_FOUND_RAKU" -ne 0 ] || - [ "$ERRORS_FOUND_RUBY" -ne 0 ] || - [ "$ERRORS_FOUND_STATES" -ne 0 ] || - [ "$ERRORS_FOUND_TERRAFORM" -ne 0 ] || - [ "$ERRORS_FOUND_TSX" -ne 0 ] || - [ "$ERRORS_FOUND_TYPESCRIPT_ES" -ne 0 ] || - [ "$ERRORS_FOUND_TYPESCRIPT_STANDARD" -ne 0 ] || - [ "$ERRORS_FOUND_XML" -ne 0 ] || - [ "$ERRORS_FOUND_YML" -ne 0 ]; then + elif [ "${ERRORS_FOUND_ANSIBLE}" -ne 0 ] || + [ "${ERRORS_FOUND_ARM}" -ne 0 ] || + [ "${ERRORS_FOUND_BASH}" -ne 0 ] || + [ "${ERRORS_FOUND_CFN}" -ne 0 ] || + [ "${ERRORS_FOUND_CLOJURE}" -ne 0 ] || + [ "${ERRORS_FOUND_COFFEESCRIPT}" -ne 0 ] || + [ "${ERRORS_FOUND_CSS}" -ne 0 ] || + [ "${ERRORS_FOUND_DART}" -ne 0 ] || + [ "${ERRORS_FOUND_DOCKER}" -ne 0 ] || + [ "${ERRORS_FOUND_ENV}" -ne 0 ] || + [ "${ERRORS_FOUND_GO}" -ne 0 ] || + [ "${ERRORS_FOUND_HTML}" -ne 0 ] || + [ "${ERRORS_FOUND_JAVASCRIPT_ES}" -ne 0 ] || + [ "${ERRORS_FOUND_JAVASCRIPT_STANDARD}" -ne 0 ] || + [ "${ERRORS_FOUND_JSON}" -ne 0 ] || + [ "${ERRORS_FOUND_JSX}" -ne 0 ] || + [ "${ERRORS_FOUND_KOTLIN}" -ne 0 ] || + [ "${ERRORS_FOUND_MARKDOWN}" -ne 0 ] || + [ "${ERRORS_FOUND_OPENAPI}" -ne 0 ] || + [ "${ERRORS_FOUND_PERL}" -ne 0 ] || + [ "${ERRORS_FOUND_PHP}" -ne 0 ] || + [ "${ERRORS_FOUND_POWERSHELL}" -ne 0 ] || + [ "${ERRORS_FOUND_PROTOBUF}" -ne 0 ] || + [ "${ERRORS_FOUND_PYTHON}" -ne 0 ] || + [ "${ERRORS_FOUND_RAKU}" -ne 0 ] || + [ "${ERRORS_FOUND_RUBY}" -ne 0 ] || + [ "${ERRORS_FOUND_STATES}" -ne 0 ] || + [ "${ERRORS_FOUND_TERRAFORM}" -ne 0 ] || + [ "${ERRORS_FOUND_TSX}" -ne 0 ] || + [ "${ERRORS_FOUND_TYPESCRIPT_ES}" -ne 0 ] || + [ "${ERRORS_FOUND_TYPESCRIPT_STANDARD}" -ne 0 ] || + [ "${ERRORS_FOUND_XML}" -ne 0 ] || + [ "${ERRORS_FOUND_YML}" -ne 0 ]; then # Failed exit echo -e "${NC}${F[R]}Exiting with errors found!${NC}" exit 1 @@ -1531,7 +1531,7 @@ fi ###################### # AWS STATES LINTING # ###################### -if [ "$VALIDATE_STATES" == "true" ]; then +if [ "${VALIDATE_STATES}" == "true" ]; then ######################### # Lint the STATES files # ######################### diff --git a/lib/validation.sh b/lib/validation.sh index a96cfd1c..4fffb249 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -260,9 +260,9 @@ function GetValidationInfo() { ########################################## # Validate if we should check AWS States # ########################################## - if [[ $ANY_SET == "true" ]]; then + if [[ ${ANY_SET} == "true" ]]; then # Some linter flags were set - only run those set to true - if [[ -z $VALIDATE_STATES ]]; then + if [[ -z ${VALIDATE_STATES} ]]; then # STATES flag was not set - default to false VALIDATE_STATES="false" fi @@ -735,7 +735,7 @@ function GetValidationInfo() { else PRINT_ARRAY+=("- Excluding [HTML] files in code base...") fi - if [[ $VALIDATE_STATES == "true" ]]; then + if [[ ${VALIDATE_STATES} == "true" ]]; then PRINT_ARRAY+=("- Validating [AWS STATES] files in code base...") else PRINT_ARRAY+=("- Excluding [AWS STATES] files in code base...") diff --git a/lib/worker.sh b/lib/worker.sh index cde619c1..a78ec722 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -577,11 +577,11 @@ function RunTestCases() { TestCodebase "PROTOBUF" "protolint" "protolint lint --config_path ${PROTOBUF_LINTER_RULES}" ".*\.\(proto\)\$" "protobuf" TestCodebase "PYTHON" "pylint" "pylint --rcfile ${PYTHON_LINTER_RULES}" ".*\.\(py\)\$" "python" TestCodebase "RAKU" "raku" "raku -c" ".*\.\(raku\|rakumod\|rakutest\|pm6\|pl6\|p6\)\$" "raku" - TestCodebase "RUBY" "rubocop" "rubocop -c $RUBY_LINTER_RULES" ".*\.\(rb\)\$" "ruby" + TestCodebase "RUBY" "rubocop" "rubocop -c ${RUBY_LINTER_RULES}" ".*\.\(rb\)\$" "ruby" TestCodebase "STATES" "asl-validator" "asl-validator --json-path" ".*\.\(json\)\$" "states" - TestCodebase "TERRAFORM" "tflint" "tflint -c $TERRAFORM_LINTER_RULES" ".*\.\(tf\)\$" "terraform" - TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(ts\)\$" "typescript" - TestCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin $TYPESCRIPT_STANDARD_LINTER_RULES" ".*\.\(ts\)\$" "typescript" + TestCodebase "TERRAFORM" "tflint" "tflint -c ${TERRAFORM_LINTER_RULES}" ".*\.\(tf\)\$" "terraform" + TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c ${TYPESCRIPT_LINTER_RULES}" ".*\.\(ts\)\$" "typescript" + TestCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin ${TYPESCRIPT_STANDARD_LINTER_RULES}" ".*\.\(ts\)\$" "typescript" TestCodebase "XML" "xmllint" "xmllint" ".*\.\(xml\)\$" "xml" TestCodebase "YML" "yamllint" "yamllint -c ${YAML_LINTER_RULES}" ".*\.\(yml\|yaml\)\$" "yml" From c1c3547e293a2fbefd4b33fe57f6afa47c993d9c Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 21 Jul 2020 14:43:22 -0500 Subject: [PATCH 88/96] Markdown getdown --- .automation/test/states/README.md | 8 ++- README.md | 98 +++++++++++++++---------------- 2 files changed, 56 insertions(+), 50 deletions(-) diff --git a/.automation/test/states/README.md b/.automation/test/states/README.md index fd526bb2..f2c3dfc3 100644 --- a/.automation/test/states/README.md +++ b/.automation/test/states/README.md @@ -1,13 +1,19 @@ # AWS States language Test Cases -This folder holds the test cases for **AWS States Language**. + +This folder holds the test cases for **AWS States Language**. ## Additional Docs + No Additional information is needed for this test case. ## Good Test Cases + The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. + - **Note:** They are linted utilizing the default linter rules. ## Bad Test Cases + The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. + - **Note:** They are linted utilizing the default linter rules. diff --git a/README.md b/README.md index eab3c9c2..633d3ddb 100644 --- a/README.md +++ b/README.md @@ -165,56 +165,56 @@ This means that if you run the linter "out of the box", all languages will be ch But if you wish to select specific linters, we give you full control to choose which linters are run, and won't run anything unexpected. -| **ENV VAR** | **Default Value** | **Notes** | -| --- | --- | --- | -| **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | -| **ANSIBLE_DIRECTORY** | `/ansible` | Flag to set the root directory for Ansible file location(s). | -| **DEFAULT_BRANCH** | `master` | The name of the repository default branch. | -| **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. | -| **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`)| -| **LINTER_RULES_PATH** | `.github/linters` | Directory for all linter configuration rules. | -| **MULTI_STATUS** | `true` | A status API is made for each language that is linted to make visual parsing easier. | -| **OUTPUT_FORMAT** | `none` | The report format to be generated, besides the stdout one. Output format of tap is currently using v13 of the specification. Supported formats: tap | -| **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. Output folder must not previously exist. | -| **OUTPUT_DETAILS** | `simpler` | What level of details to be reported. Supported formats: simpler or detailed. | -| **RUBY_CONFIG_FILE** | `.ruby-lint.yml` | Filename for [rubocop configuration](https://docs.rubocop.org/rubocop/configuration.html) (ex: `.ruby-lint.yml`, `.rubocop.yml`)| -| **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`)| +| **ENV VAR** | **Default Value** | **Notes** | +| -------------------------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | +| **ANSIBLE_DIRECTORY** | `/ansible` | Flag to set the root directory for Ansible file location(s). | +| **DEFAULT_BRANCH** | `master` | The name of the repository default branch. | +| **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. | +| **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) | +| **LINTER_RULES_PATH** | `.github/linters` | Directory for all linter configuration rules. | +| **MULTI_STATUS** | `true` | A status API is made for each language that is linted to make visual parsing easier. | +| **OUTPUT_FORMAT** | `none` | The report format to be generated, besides the stdout one. Output format of tap is currently using v13 of the specification. Supported formats: tap | +| **OUTPUT_FOLDER** | `super-linter.report` | The location where the output reporting will be generated to. Output folder must not previously exist. | +| **OUTPUT_DETAILS** | `simpler` | What level of details to be reported. Supported formats: simpler or detailed. | +| **RUBY_CONFIG_FILE** | `.ruby-lint.yml` | Filename for [rubocop configuration](https://docs.rubocop.org/rubocop/configuration.html) (ex: `.ruby-lint.yml`, `.rubocop.yml`) | +| **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`) | | **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_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. | -| **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the Clojure language. | -| **VALIDATE_CLOUDFORMATION** | `true` | Flag to enable or disable the linting process of the AWS Cloud Formation language. | -| **VALIDATE_COFFEE** | `true` | Flag to enable or disable the linting process of the Coffeescript language . | -| **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the CSS language. | -| **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the Dart language. | -| **VALIDATE_DOCKER** | `true` | Flag to enable or disable the linting process of the Docker language. | -| **VALIDATE_EDITORCONFIG** | `true` | Flag to enable or disable the linting process with the editorconfig. | -| **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the ENV language. | -| **VALIDATE_GO** | `true` | Flag to enable or disable the linting process of the Golang language. | -| **VALIDATE_HTML** | `true` | Flag to enable or disable the linting process of the HTML language. | -| **VALIDATE_JAVASCRIPT_ES** | `true` | Flag to enable or disable the linting process of the Javascript language. (Utilizing: eslint) | -| **VALIDATE_JAVASCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Javascript language. (Utilizing: standard) | -| **VALIDATE_JSON** | `true` | Flag to enable or disable the linting process of the JSON language. | -| **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: eslint) | -| **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the Kotlin language. | -| **VALIDATE_MD** | `true` | Flag to enable or disable the linting process of the Markdown language. | -| **VALIDATE_OPENAPI** | `true` | Flag to enable or disable the linting process of the OpenAPI language. | -| **VALIDATE_PERL** | `true` | Flag to enable or disable the linting process of the Perl language. | -| **VALIDATE_PHP** | `true` | Flag to enable or disable the linting process of the PHP language. | -| **VALIDATE_PROTOBUF** | `true` | Flag to enable or disable the linting process of the Protobuf language. | -| **VALIDATE_PYTHON** | `true` | Flag to enable or disable the linting process of the Python language. | -| **VALIDATE_POWERSHELL** | `true` | Flag to enable or disable the linting process of the Powershell language. | -| **VALIDATE_RAKU** | `true` | Flag to enable or disable the linting process of the Raku language. | -| **VALIDATE_RUBY** | `true` | Flag to enable or disable the linting process of the Ruby language. | -| **VALIDATE_STATES** | `true` | Flag to enable or disable the linting process for AWS States Language. | -| **VALIDATE_TERRAFORM** | `true` | Flag to enable or disable the linting process of the Terraform language. | -| **VALIDATE_TSX** | `true` | Flag to enable or disable the linting process for tsx files (Utilizing: eslint) | -| **VALIDATE_TYPESCRIPT_ES** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: eslint) | -| **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: standard) | -| **VALIDATE_XML** | `true` | Flag to enable or disable the linting process of the XML language. | -| **VALIDATE_YAML** | `true` |Flag to enable or disable the linting process of the YAML language. | +| **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. | +| **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the Clojure language. | +| **VALIDATE_CLOUDFORMATION** | `true` | Flag to enable or disable the linting process of the AWS Cloud Formation language. | +| **VALIDATE_COFFEE** | `true` | Flag to enable or disable the linting process of the Coffeescript language . | +| **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the CSS language. | +| **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the Dart language. | +| **VALIDATE_DOCKER** | `true` | Flag to enable or disable the linting process of the Docker language. | +| **VALIDATE_EDITORCONFIG** | `true` | Flag to enable or disable the linting process with the editorconfig. | +| **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the ENV language. | +| **VALIDATE_GO** | `true` | Flag to enable or disable the linting process of the Golang language. | +| **VALIDATE_HTML** | `true` | Flag to enable or disable the linting process of the HTML language. | +| **VALIDATE_JAVASCRIPT_ES** | `true` | Flag to enable or disable the linting process of the Javascript language. (Utilizing: eslint) | +| **VALIDATE_JAVASCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Javascript language. (Utilizing: standard) | +| **VALIDATE_JSON** | `true` | Flag to enable or disable the linting process of the JSON language. | +| **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: eslint) | +| **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the Kotlin language. | +| **VALIDATE_MD** | `true` | Flag to enable or disable the linting process of the Markdown language. | +| **VALIDATE_OPENAPI** | `true` | Flag to enable or disable the linting process of the OpenAPI language. | +| **VALIDATE_PERL** | `true` | Flag to enable or disable the linting process of the Perl language. | +| **VALIDATE_PHP** | `true` | Flag to enable or disable the linting process of the PHP language. | +| **VALIDATE_PROTOBUF** | `true` | Flag to enable or disable the linting process of the Protobuf language. | +| **VALIDATE_PYTHON** | `true` | Flag to enable or disable the linting process of the Python language. | +| **VALIDATE_POWERSHELL** | `true` | Flag to enable or disable the linting process of the Powershell language. | +| **VALIDATE_RAKU** | `true` | Flag to enable or disable the linting process of the Raku language. | +| **VALIDATE_RUBY** | `true` | Flag to enable or disable the linting process of the Ruby language. | +| **VALIDATE_STATES** | `true` | Flag to enable or disable the linting process for AWS States Language. | +| **VALIDATE_TERRAFORM** | `true` | Flag to enable or disable the linting process of the Terraform language. | +| **VALIDATE_TSX** | `true` | Flag to enable or disable the linting process for tsx files (Utilizing: eslint) | +| **VALIDATE_TYPESCRIPT_ES** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: eslint) | +| **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: standard) | +| **VALIDATE_XML** | `true` | Flag to enable or disable the linting process of the XML language. | +| **VALIDATE_YAML** | `true` | Flag to enable or disable the linting process of the YAML language. | ### Template rules files From 586677713406488a9085a4a206457432943ca299 Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Tue, 21 Jul 2020 14:53:32 -0500 Subject: [PATCH 89/96] Rename expected-COFFEESCRIPT.tap to expected-COFFEESCRIPT.tap.ignored --- ...xpected-COFFEESCRIPT.tap => expected-COFFEESCRIPT.tap.ignored} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .automation/test/coffeescript/reports/{expected-COFFEESCRIPT.tap => expected-COFFEESCRIPT.tap.ignored} (100%) diff --git a/.automation/test/coffeescript/reports/expected-COFFEESCRIPT.tap b/.automation/test/coffeescript/reports/expected-COFFEESCRIPT.tap.ignored similarity index 100% rename from .automation/test/coffeescript/reports/expected-COFFEESCRIPT.tap rename to .automation/test/coffeescript/reports/expected-COFFEESCRIPT.tap.ignored From 85b58cc5cb931ca6321259ebdb1cb44beaf2973a Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Tue, 21 Jul 2020 13:01:19 -0700 Subject: [PATCH 90/96] Add new community maintainers --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c9921dce..008c31c3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ ###################################################################### # These owners will be the default owners for everything in the repo # ###################################################################### -* @admiralawkbar @jwiebalk @zkoppert @IAmHughes +* @admiralawkbar @jwiebalk @zkoppert @IAmHughes @nemchik @Hanse00 From b6410c5cba46198ecbd18cd635df56c9044a64c0 Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Tue, 21 Jul 2020 15:04:59 -0500 Subject: [PATCH 91/96] Rename expected-STATES.tap to expected-STATES.tap.ignored --- .../reports/{expected-STATES.tap => expected-STATES.tap.ignored} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .automation/test/states/reports/{expected-STATES.tap => expected-STATES.tap.ignored} (100%) diff --git a/.automation/test/states/reports/expected-STATES.tap b/.automation/test/states/reports/expected-STATES.tap.ignored similarity index 100% rename from .automation/test/states/reports/expected-STATES.tap rename to .automation/test/states/reports/expected-STATES.tap.ignored From bda5a6777d6191dac1767a75aae85edcd90b2d2a Mon Sep 17 00:00:00 2001 From: Gabo Date: Tue, 21 Jul 2020 20:17:51 -0500 Subject: [PATCH 92/96] Fix awk --- lib/buildFileList.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index 11462989..70dc7c4d 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -86,7 +86,7 @@ function BuildFileList() { ########################### # Extract just the file and extension, reverse it, cut off extension, # reverse it back, substitute to lowercase - FILE_TYPE=$(basename "${FILE}" | rev | cut -f1 -d'.' | rev | awk '{print tolower(${0})}') + FILE_TYPE=$(basename "${FILE}" | rev | cut -f1 -d'.' | rev | awk '{print tolower($0)}') ############## # Print file # From 1870af5c5f92907c9dd4a11536949edf6f1fe242 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2020 06:07:25 +0000 Subject: [PATCH 93/96] Update actions/github-script requirement to v2 Updates the requirements on [actions/github-script](https://github.com/actions/github-script) to permit the latest version. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/commits/6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45) Signed-off-by: dependabot[bot] --- .github/workflows/automerge-dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automerge-dependabot.yml b/.github/workflows/automerge-dependabot.yml index 1e212ebf..10942d09 100644 --- a/.github/workflows/automerge-dependabot.yml +++ b/.github/workflows/automerge-dependabot.yml @@ -30,7 +30,7 @@ jobs: if: github.actor == 'dependabot[bot]' steps: - name: merge - uses: actions/github-script@0.2.0 + uses: actions/github-script@v2 with: script: | github.pullRequests.createReview({ From eaa25456255f28626eb5e8379aa72a0156adba1c Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Wed, 22 Jul 2020 08:06:35 -0500 Subject: [PATCH 94/96] adding it --- lib/linter.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 4727016c..b3071780 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -312,9 +312,9 @@ GetLinterVersions() { # Go through the array of linters and print version info # ########################################################## for LINTER in "${LINTER_ARRAY[@]}"; do - ################### - # Get the version # - ################### + #################### + # Get the versions # + #################### if [[ "${LINTER}" == "arm-ttk" ]]; then # Need specific command for ARM mapfile -t GET_VERSION_CMD < <(grep -iE 'version' "${ARM_TTK_PSD1}" | xargs 2>&1) From e813af8313b0e60a815ecc5decb9d9cd8b3d8038 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Wed, 22 Jul 2020 09:20:02 -0500 Subject: [PATCH 95/96] Adding better error reporting --- lib/worker.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/worker.sh b/lib/worker.sh index a78ec722..1f461542 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -216,6 +216,7 @@ function LintCodebase() { # Error # ######### echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [${LINTER_NAME}] linter!${NC}" + echo -e "${NC}${B[R]}${F[W]}Command run:${NC}[\$${LINT_CMD}]${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LINT_CMD}]${NC}" # Increment the error count (("ERRORS_FOUND_${FILE_TYPE}++")) @@ -431,6 +432,7 @@ function TestCodebase() { # Error # ######### echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [${LINTER_NAME}] linter!${NC}" + echo -e "${NC}${B[R]}${F[W]}Command run:${NC}[\$${LINT_CMD}]${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LINT_CMD}]${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Linter CMD:[${LINTER_COMMAND} ${FILE}]${NC}" # Increment the error count @@ -460,6 +462,7 @@ function TestCodebase() { ######### echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [${LINTER_NAME}] linter!${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} This file should have failed test case!${NC}" + echo -e "${NC}${B[R]}${F[W]}Command run:${NC}[\$${LINT_CMD}]${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LINT_CMD}]${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Linter CMD:[${LINTER_COMMAND} ${FILE}]${NC}" # Increment the error count From 54ee1cdfb43e72903fd40dd0baa5625260d111fa Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Wed, 22 Jul 2020 09:35:21 -0500 Subject: [PATCH 96/96] fixed order --- lib/linter.sh | 81 +++++++++++++++++++++++++-------------------------- lib/worker.sh | 3 +- 2 files changed, 41 insertions(+), 43 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index b3071780..c489a260 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -21,82 +21,81 @@ source /action/lib/worker.sh # Source the function script(s) ########### # GLOBALS # ########### +# Default Vars +DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location # Ansible Vars -ANSIBLE_FILE_NAME='.ansible-lint.yml' # Name of the file -ANSIBLE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${ANSIBLE_FILE_NAME}" # Path to the Ansible lint rules +ANSIBLE_FILE_NAME='.ansible-lint.yml' # Name of the file +ANSIBLE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${ANSIBLE_FILE_NAME}" # Path to the Ansible lint rules # Azure Resource Manager Vars -ARM_FILE_NAME='.arm-ttk.psd1' # Name of the file -ARM_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${ARM_FILE_NAME}" # Path to the ARM lint rules +ARM_FILE_NAME='.arm-ttk.psd1' # Name of the file +ARM_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${ARM_FILE_NAME}" # Path to the ARM lint rules # Cloudformation Vars -CFN_FILE_NAME='.cfnlintrc.yml' # Name of the file +CFN_FILE_NAME='.cfnlintrc.yml' # Name of the file CFN_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CFN_FILE_NAME}" # Path to the cloudformation lint rules # Clojure Vars -CLOJURE_FILE_NAME='.clj-kondo/config.edn' # Name of the file +CLOJURE_FILE_NAME='.clj-kondo/config.edn' # Name of the file CLOJURE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CLOJURE_FILE_NAME}" # Path to the Clojure lint rules # Coffee Vars +COFFEE_FILE_NAME='.coffee-lint.json' # Name of the file COFFEESCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${COFFEE_FILE_NAME}" # Path to the coffeescript lint rules -COFFEE_FILE_NAME='.coffee-lint.json' # Name of the file # CSS Vars -CSS_FILE_NAME='.stylelintrc.json' # Name of the file +CSS_FILE_NAME='.stylelintrc.json' # Name of the file CSS_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CSS_FILE_NAME}" # Path to the CSS lint rules # Dart Vars -DART_FILE_NAME='analysis_options.yaml' # Name of the file +DART_FILE_NAME='analysis_options.yaml' # Name of the file DART_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DART_FILE_NAME}" # Path to the DART lint rules -# Default Vars -DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location # Docker Vars -DOCKER_FILE_NAME='.dockerfilelintrc' # Name of the file +DOCKER_FILE_NAME='.dockerfilelintrc' # Name of the file DOCKER_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${DOCKER_FILE_NAME}" # Path to the Docker lint rules # Golang Vars -GO_FILE_NAME='.golangci.yml' # Name of the file +GO_FILE_NAME='.golangci.yml' # Name of the file GO_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${GO_FILE_NAME}" # Path to the Go lint rules # HTML Vars -HTML_FILE_NAME='.htmlhintrc' # Name of the file +HTML_FILE_NAME='.htmlhintrc' # Name of the file HTML_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${HTML_FILE_NAME}" # Path to the CSS lint rules # Javascript Vars -JAVASCRIPT_FILE_NAME="${JAVASCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file +JAVASCRIPT_FILE_NAME="${JAVASCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file JAVASCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${JAVASCRIPT_FILE_NAME}" # Path to the Javascript lint rules -JAVASCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard +JAVASCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard # Default linter path -LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory +LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory # MD Vars -MARKDOWN_FILE_NAME='.markdown-lint.yml' # Name of the file +MARKDOWN_FILE_NAME='.markdown-lint.yml' # Name of the file MARKDOWN_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${MARKDOWN_FILE_NAME}" # Path to the markdown lint rules # OpenAPI Vars -OPENAPI_FILE_NAME='.openapirc.yml' # Name of the file +OPENAPI_FILE_NAME='.openapirc.yml' # Name of the file OPENAPI_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${OPENAPI_FILE_NAME}" # Path to the OpenAPI lint rules # Powershell Vars -POWERSHELL_FILE_NAME='.powershell-psscriptanalyzer.psd1' # Name of the file +POWERSHELL_FILE_NAME='.powershell-psscriptanalyzer.psd1' # Name of the file POWERSHELL_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${POWERSHELL_FILE_NAME}" # Path to the Powershell lint rules # Protocol Buffers Vars -PROTOBUF_FILE_NAME='.protolintrc.yml' # Name of the file +PROTOBUF_FILE_NAME='.protolintrc.yml' # Name of the file PROTOBUF_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${PROTOBUF_FILE_NAME}" # Path to the Protocol Buffers lint rules # Python Vars -PYTHON_FILE_NAME='.python-lint' # Name of the file +PYTHON_FILE_NAME='.python-lint' # Name of the file PYTHON_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${PYTHON_FILE_NAME}" # Path to the python lint rules # Ruby Vars -RUBY_FILE_NAME="${RUBY_CONFIG_FILE:-.ruby-lint.yml}" # Name of the file +RUBY_FILE_NAME="${RUBY_CONFIG_FILE:-.ruby-lint.yml}" # Name of the file RUBY_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${RUBY_FILE_NAME}" # Path to the ruby lint rules # Terraform Vars -TERRAFORM_FILE_NAME='.tflint.hcl' # Name of the file +TERRAFORM_FILE_NAME='.tflint.hcl' # Name of the file TERRAFORM_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${TERRAFORM_FILE_NAME}" # Path to the Terraform lint rules # Typescript Vars -TYPESCRIPT_FILE_NAME="${TYPESCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file +TYPESCRIPT_FILE_NAME="${TYPESCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # Name of the file TYPESCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${TYPESCRIPT_FILE_NAME}" # Path to the Typescript lint rules -TYPESCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard +TYPESCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard # YAML Vars -YAML_FILE_NAME='.yaml-lint.yml' # Name of the file +YAML_FILE_NAME='.yaml-lint.yml' # Name of the file YAML_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${YAML_FILE_NAME}" # Path to the yaml lint rules - ####################################### # Linter array for information prints # ####################################### -LINTER_ARRAY=('ansible-lint' 'arm-ttk' 'asl-validator' 'cfn-lint' 'clj-kondo' 'coffeelint' - 'dart' 'dockerfilelint' 'dotenv-linter' 'eslint' 'golangci-lint' 'htmlhint' - 'jsonlint' 'ktlint' 'markdownlint' 'perl' 'protolint' 'pwsh' 'pylint' - 'raku' 'rubocop' 'shellcheck' 'spectral' 'standard' 'stylelint' 'tflint' - 'xmllint' 'yamllint') +LINTER_ARRAY=('ansible-lint' 'arm-ttk' 'asl-validator' 'cfn-lint' 'clj-kondo' + 'coffeelint' 'dart' 'dockerfilelint' 'dotenv-linter' 'eslint' 'golangci-lint' + 'htmlhint' 'jsonlint' 'ktlint' 'markdownlint' 'perl' 'protolint' 'pwsh' + 'pylint' 'raku' 'rubocop' 'shellcheck' 'spectral' 'standard' 'stylelint' + 'tflint' 'xmllint' 'yamllint') ############################# # Language array for prints # @@ -105,8 +104,8 @@ LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'CFN' 'CLOJURE' 'COFFEESCRIPT' 'CSS' 'DART' 'DOCKER' 'ENV' 'GO' 'HTML' 'JAVASCRIPT_ES' 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'MARKDOWN' 'OPENAPI' 'PERL' 'PHP' 'POWERSHELL' 'PROTOBUF' 'PYTHON' - 'RAKU' 'RUBY' 'STATES' 'TERRAFORM' 'TSX' 'TYPESCRIPT_ES' 'TYPESCRIPT_STANDARD' - 'XML' 'YML') + 'RAKU' 'RUBY' 'STATES' 'TERRAFORM' 'TSX' 'TYPESCRIPT_ES' + 'TYPESCRIPT_STANDARD' 'XML' 'YML') ############################################ # Array for all languages that were linted # @@ -171,10 +170,10 @@ ACTIONS_RUNNER_DEBUG="${ACTIONS_RUNNER_DEBUG:-false}" # Boolean to see even more ################ # Default Vars # ################ -DEFAULT_VALIDATE_ALL_CODEBASE='true' # Default value for validate all files -DEFAULT_WORKSPACE="${DEFAULT_WORKSPACE:-/tmp/lint}" # Default workspace if running locally -DEFAULT_RUN_LOCAL='false' # Default value for debugging locally -DEFAULT_TEST_CASE_RUN='false' # Flag to tell code to run only test cases +DEFAULT_VALIDATE_ALL_CODEBASE='true' # Default value for validate all files +DEFAULT_WORKSPACE="${DEFAULT_WORKSPACE:-/tmp/lint}" # Default workspace if running locally +DEFAULT_RUN_LOCAL='false' # Default value for debugging locally +DEFAULT_TEST_CASE_RUN='false' # Flag to tell code to run only test cases DEFAULT_IFS="${IFS}" # Get the Default IFS for updating ############################################################### @@ -188,7 +187,7 @@ READ_ONLY_CHANGE_FLAG=0 # Flag set to 1 if echo "${READ_ONLY_CHANGE_FLAG}" > /dev/null 2>&1 || true # Workaround SC2034 TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore echo "${TEST_CASE_FOLDER}" > /dev/null 2>&1 || true # Workaround SC2034 -DEFAULT_ANSIBLE_DIRECTORY="${GITHUB_WORKSPACE}/ansible" # Default Ansible Directory +DEFAULT_ANSIBLE_DIRECTORY="${GITHUB_WORKSPACE}/ansible" # Default Ansible Directory echo "${DEFAULT_ANSIBLE_DIRECTORY}" > /dev/null 2>&1 || true # Workaround SC2034 WARNING_ARRAY_TEST=() # Array of warning linters that did not have an expected test result. echo "${WARNING_ARRAY_TEST[*]}" > /dev/null 2>&1 || true # Workaround SC2034 @@ -199,7 +198,7 @@ echo "${WARNING_ARRAY_TEST[*]}" > /dev/null 2>&1 || true # Workaround SC2034 OUTPUT_FORMAT="${OUTPUT_FORMAT}" # Output format to be generated. Default none OUTPUT_FOLDER="${OUTPUT_FOLDER:-super-linter.report}" # Folder where the reports are generated. Default super-linter.report OUTPUT_DETAILS="${OUTPUT_DETAILS:-simpler}" # What level of details. (simpler or detailed). Default simpler -REPORT_OUTPUT_FOLDER="${DEFAULT_WORKSPACE}/${OUTPUT_FOLDER}" +REPORT_OUTPUT_FOLDER="${DEFAULT_WORKSPACE}/${OUTPUT_FOLDER}" # Location for the report folder ########################## # Array of changed files # diff --git a/lib/worker.sh b/lib/worker.sh index 1f461542..f5957f4e 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -216,8 +216,8 @@ function LintCodebase() { # Error # ######### echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [${LINTER_NAME}] linter!${NC}" - echo -e "${NC}${B[R]}${F[W]}Command run:${NC}[\$${LINT_CMD}]${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LINT_CMD}]${NC}" + echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Linter CMD:[${LINTER_COMMAND} ${FILE}]${NC}" # Increment the error count (("ERRORS_FOUND_${FILE_TYPE}++")) @@ -432,7 +432,6 @@ function TestCodebase() { # Error # ######### echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Found errors in [${LINTER_NAME}] linter!${NC}" - echo -e "${NC}${B[R]}${F[W]}Command run:${NC}[\$${LINT_CMD}]${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${LINT_CMD}]${NC}" echo -e "${NC}${B[R]}${F[W]}ERROR:${NC} Linter CMD:[${LINTER_COMMAND} ${FILE}]${NC}" # Increment the error count