From f58111f2207df64e57b70d80b99d4bc147edd8c7 Mon Sep 17 00:00:00 2001 From: nbrown Date: Sun, 5 Jul 2020 22:21:13 -0400 Subject: [PATCH 1/9] add Raku support --- .automation/test/raku/README.md | 13 +++++++++++++ .automation/test/raku/raku_bad_1.raku | 4 ++++ .automation/test/raku/raku_good_1.raku | 4 ++++ Dockerfile | 26 +++++++++++++++++++++++++- README.md | 2 ++ docs/disabling-linters.md | 19 +++++++++++++++++++ lib/buildFileList.sh | 14 ++++++++++++++ lib/linter.sh | 23 +++++++++++++++++++++-- lib/validation.sh | 21 +++++++++++++++++++++ lib/worker.sh | 1 + 10 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 .automation/test/raku/README.md create mode 100644 .automation/test/raku/raku_bad_1.raku create mode 100644 .automation/test/raku/raku_good_1.raku diff --git a/.automation/test/raku/README.md b/.automation/test/raku/README.md new file mode 100644 index 00000000..9e654ca1 --- /dev/null +++ b/.automation/test/raku/README.md @@ -0,0 +1,13 @@ +# Raku Test Cases +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/raku/raku_bad_1.raku b/.automation/test/raku/raku_bad_1.raku new file mode 100644 index 00000000..a5b14536 --- /dev/null +++ b/.automation/test/raku/raku_bad_1.raku @@ -0,0 +1,4 @@ +use v6.d; + +my @foo; +$foo[1] = 42 diff --git a/.automation/test/raku/raku_good_1.raku b/.automation/test/raku/raku_good_1.raku new file mode 100644 index 00000000..9133a9cd --- /dev/null +++ b/.automation/test/raku/raku_good_1.raku @@ -0,0 +1,4 @@ +use v6; + +my @foo; +@foo[1] = 42 diff --git a/Dockerfile b/Dockerfile index 56bc44a8..4b288fea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,9 @@ RUN apk add --no-cache \ php7 \ ca-certificates less ncurses-terminfo-base \ krb5-libs libgcc libintl libssl1.1 libstdc++ \ - tzdata userspace-rcu zlib icu-libs lttng-ust + tzdata userspace-rcu zlib icu-libs lttng-ust \ + libffi-dev openssl-dev + ######################################### # Install Powershell + PSScriptAnalyzer # @@ -159,6 +161,27 @@ 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 Raku # +################ +ARG RAKU_VER="2020.06" + +# Environment +ENV PATH="/root/raku-install/bin:/root/raku-install/share/perl6/site/bin:/root/.rakudobrew/bin:${PATH}" \ + ENV="/root/.profile" + +# Basic setup, programs and init +RUN git clone https://github.com/tadzik/rakudobrew ~/.rakudobrew \ + && eval "$(~/.rakudobrew/bin/rakudobrew init Sh)"\ + && rakudobrew build moar $RAKU_VER --configure-opts='--prefix=/root/raku-install' \ + && rm -rf /root/.rakudobrew/versions/moar-$RAKU_VER \ + && rakudobrew register moar-$RAKU_VER /root/raku-install \ + && rakudobrew global moar-$RAKU_VER \ + && rakudobrew build-zef \ + && rm -rf /root/.rakudobrew + + + ########################################### # Load GitHub Env Vars for GitHub Actions # ########################################### @@ -174,6 +197,7 @@ ENV GITHUB_SHA=${GITHUB_SHA} \ 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} \ diff --git a/README.md b/README.md index 6c1b6520..127db501 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base | **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) | @@ -156,6 +157,7 @@ and won't run anything unexpected. | **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. | diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index 93800eb7..0dace390 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -21,6 +21,7 @@ For some linters it is also possible to override rules on a case by case level w - [JSON](#json) - [Markdown](#markdown) - [Perl](#perl) +- [Raku](#raku) - [PHP](#php) - [XML](#xml) - [Coffeescript](#coffeescript) @@ -353,6 +354,24 @@ Here is more data -------------------------------------------------------------------------------- +## Raku +- [raku](https://raku.org) + +### Raku Config file +- 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/) diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index 7334b447..4e1c6196 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -201,6 +201,20 @@ function BuildFileList() { ########################################################## READ_ONLY_CHANGE_FLAG=1 ###################### + # Get the RAKU files # + ###################### + 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") + ########################################################## + # Set the READ_ONLY_CHANGE_FLAG since this could be exec # + ########################################################## + READ_ONLY_CHANGE_FLAG=1 + ###################### # Get the PHP files # ###################### elif [ "$FILE_TYPE" == "php" ]; then diff --git a/lib/linter.sh b/lib/linter.sh index a036dc2c..0ce860d6 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -82,7 +82,7 @@ CLOJURE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CLOJURE_FILE_NAME" # Linter array for information prints # ####################################### LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck" - "pylint" "perl" "rubocop" "coffeelint" "eslint" "standard" + "pylint" "perl" "raku" "rubocop" "coffeelint" "eslint" "standard" "ansible-lint" "/dockerfilelint/bin/dockerfilelint" "golangci-lint" "tflint" "stylelint" "dotenv-linter" "pwsh" "ktlint" "protolint" "clj-kondo" "spectral" "cfn-lint") @@ -90,7 +90,7 @@ LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck" ############################# # Language array for prints # ############################# -LANGUAGE_ARRAY=('YML' 'JSON' 'XML' 'MARKDOWN' 'BASH' 'PERL' 'PHP' 'RUBY' 'PYTHON' +LANGUAGE_ARRAY=('YML' 'JSON' 'XML' 'MARKDOWN' 'BASH' 'PERL' 'RAKU' 'PHP' 'RUBY' 'PYTHON' 'COFFEESCRIPT' 'ANSIBLE' 'JAVASCRIPT_STANDARD' 'JAVASCRIPT_ES' 'TYPESCRIPT_STANDARD' 'TYPESCRIPT_ES' 'DOCKER' 'GO' 'TERRAFORM' 'CSS' 'ENV' 'POWERSHELL' 'KOTLIN' 'PROTOBUF' 'CLOJURE' 'OPENAPI' 'CFN') @@ -110,6 +110,7 @@ VALIDATE_XML="${VALIDATE_XML}" # Boolean to vali 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 @@ -170,6 +171,7 @@ FILE_ARRAY_XML=() # Array of files to check FILE_ARRAY_MD=() # 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 @@ -199,6 +201,7 @@ 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 @@ -708,6 +711,7 @@ Footer() { [ "$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 ] || @@ -915,6 +919,21 @@ if [ "$VALIDATE_PERL" == "true" ]; then LintCodebase "PERL" "perl" "perl -Mstrict -cw" ".*\.\(pl\)\$" "${FILE_ARRAY_PERL[@]}" fi +################ +# RAKU LINTING # +################ +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 . + 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[@]}" +fi + ################ # PHP LINTING # ################ diff --git a/lib/validation.sh b/lib/validation.sh index 988abea5..1e83e0a9 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -52,6 +52,7 @@ function GetValidationInfo() { 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)}') @@ -82,6 +83,7 @@ function GetValidationInfo() { $VALIDATE_MD || -n \ $VALIDATE_BASH || -n \ $VALIDATE_PERL || -n \ + $VALIDATE_RAKU || -n \ $VALIDATE_PHP || -n \ $VALIDATE_PYTHON || -n \ $VALIDATE_RUBY || -n \ @@ -188,6 +190,20 @@ function GetValidationInfo() { VALIDATE_PERL="true" fi + #################################### + # Validate if we should check RAKU # + #################################### + if [[ $ANY_SET == "true" ]]; then + # Some linter flags were set - only run those set to true + if [[ -z $VALIDATE_RAKU ]]; then + # RAKU flag was not set - default to false + VALIDATE_RAKU="false" + fi + else + # No linter flags were set - default all to true + VALIDATE_RAKU="true" + fi + #################################### # Validate if we should check PHP # #################################### @@ -487,6 +503,11 @@ function GetValidationInfo() { else PRINT_ARRAY+=("- Excluding [PERL] files in code base...") fi + 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 PRINT_ARRAY+=("- Validating [PHP] files in code base...") else diff --git a/lib/worker.sh b/lib/worker.sh index 4382620a..a485e250 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -458,6 +458,7 @@ function RunTestCases() { TestCodebase "BASH" "shellcheck" "shellcheck --color" ".*\.\(sh\)\$" "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" From 6b48f24126930cc8f85ac58ea9b5b4403fc1c91f Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 6 Jul 2020 09:34:16 -0500 Subject: [PATCH 2/9] fix space --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4b288fea..9aa41e0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -174,8 +174,8 @@ ENV PATH="/root/raku-install/bin:/root/raku-install/share/perl6/site/bin:/root/. RUN git clone https://github.com/tadzik/rakudobrew ~/.rakudobrew \ && eval "$(~/.rakudobrew/bin/rakudobrew init Sh)"\ && rakudobrew build moar $RAKU_VER --configure-opts='--prefix=/root/raku-install' \ - && rm -rf /root/.rakudobrew/versions/moar-$RAKU_VER \ - && rakudobrew register moar-$RAKU_VER /root/raku-install \ + && rm -rf /root/.rakudobrew/versions/moar-$RAKU_VER \ + && rakudobrew register moar-$RAKU_VER /root/raku-install \ && rakudobrew global moar-$RAKU_VER \ && rakudobrew build-zef \ && rm -rf /root/.rakudobrew From 443721f37dac8bf49ba381d3285e558e51a8cad4 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Mon, 6 Jul 2020 10:58:17 -0700 Subject: [PATCH 3/9] Correct release compare language --- .github/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 44d7f26f..5cf492db 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -4,7 +4,7 @@ template: | # Changelog $CHANGES - See details of [all code changes](https://github.com/github/super-linter/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since last release + See details of [all code changes](https://github.com/github/super-linter/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release categories: - title: '🚀 Features' From 279790044c0f0e2c253e3b0db1229a53d0e443b5 Mon Sep 17 00:00:00 2001 From: Ahmad Nassri Date: Mon, 6 Jul 2020 15:20:04 -0400 Subject: [PATCH 4/9] docs: correct name for markdown-lint --- docs/disabling-linters.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index 96b93f5e..596e847c 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -310,9 +310,8 @@ ignore_templates: - [markdownlint inline comment syntax](https://github.com/DavidAnson/markdownlint#configuration) ### markdownlint Config file -- `.github/linters/.markdown-lint.yml` - You can pass multiple rules and overwrite default rules -- File should be located at: `.github/linters/.markdownlint.yml` +- File should be located at: `.github/linters/.markdown-lint.yml` ### markdownlint disable single line ```markdown @@ -791,4 +790,4 @@ lint: - 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 \ No newline at end of file +- There is currently **No** way to disable rules in an entire file From 3bc0b6debbb156eee242c68871b398de2cd6fd12 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 6 Jul 2020 15:01:13 -0500 Subject: [PATCH 5/9] Shellcheck other extensions --- 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 d06d44cc..01001be5 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -942,7 +942,7 @@ if [ "$VALIDATE_BASH" == "true" ]; then # Lint the bash files # ####################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "BASH" "shellcheck" "shellcheck --color" ".*\.\(sh\)\$" "${FILE_ARRAY_BASH[@]}" + LintCodebase "BASH" "shellcheck" "shellcheck --color" ".*\.\(sh|bash|dash|ksh\)\$" "${FILE_ARRAY_BASH[@]}" fi ################## diff --git a/lib/worker.sh b/lib/worker.sh index f1283c41..2c76bf21 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -455,7 +455,7 @@ function RunTestCases() { TestCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "json" TestCodebase "XML" "xmllint" "xmllint" ".*\.\(xml\)\$" "xml" TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c $MD_LINTER_RULES" ".*\.\(md\)\$" "markdown" - TestCodebase "BASH" "shellcheck" "shellcheck --color" ".*\.\(sh\)\$" "shell" + 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 "PHP" "php" "php -l" ".*\.\(php\)\$" "php" From 3cb5a0b6fd4f343bd84f7ada5c014ba92dc738d5 Mon Sep 17 00:00:00 2001 From: Levi Muniz Date: Mon, 6 Jul 2020 15:57:30 -0600 Subject: [PATCH 6/9] Added check to ensure volume is directory ADDED - Present user with error when attempting to pass non-directory as volume --- lib/linter.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/linter.sh b/lib/linter.sh index d06d44cc..4fb1f3c4 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -597,6 +597,11 @@ GetGitHubVars() { GITHUB_WORKSPACE="$DEFAULT_WORKSPACE" fi + 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]" # No need to touch or set the GITHUB_SHA From e5c7ba186d0df25e2dc65216179f9b86bf5c90c8 Mon Sep 17 00:00:00 2001 From: nbrown Date: Mon, 6 Jul 2020 19:04:51 -0400 Subject: [PATCH 7/9] install to /usr and use current rakubrew --- Dockerfile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 538c4e13..355afbff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,8 @@ ARG CLJ_KONDO_VERSION='2020.06.21' ARG GO_VERSION='v1.27.0' # Raku Linter ARG RAKU_VER="2020.06" +ARG RAKU_INSTALL_PATH=/usr +ARG RAKUBREW_HOME=/tmp/rakubrew #################### # Run APK installs # @@ -190,18 +192,18 @@ RUN curl -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktli ################ # Environment -ENV PATH="/root/raku-install/bin:/root/raku-install/share/perl6/site/bin:/root/.rakudobrew/bin:${PATH}" \ - ENV="/root/.profile" +ENV PATH="$RAKU_INSTALL_PATH/share/perl6/site/bin:${PATH}" + # Basic setup, programs and init -RUN git clone https://github.com/tadzik/rakudobrew ~/.rakudobrew \ - && eval "$(~/.rakudobrew/bin/rakudobrew init Sh)"\ - && rakudobrew build moar $RAKU_VER --configure-opts='--prefix=/root/raku-install' \ - && rm -rf /root/.rakudobrew/versions/moar-$RAKU_VER \ - && rakudobrew register moar-$RAKU_VER /root/raku-install \ - && rakudobrew global moar-$RAKU_VER \ - && rakudobrew build-zef \ - && rm -rf /root/.rakudobrew +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 ################################ # Install editorconfig-checker # From 9bb7a1332eb4653f0d1cd2a9d6e13b8ac83fe1a5 Mon Sep 17 00:00:00 2001 From: Levi Muniz Date: Mon, 6 Jul 2020 12:12:13 -0600 Subject: [PATCH 8/9] Fixed #368 config load issue caused by quotes FIXED - Removed quotes surrounding declare causing variable to not read in correctly This is why people don't like BASH... --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index d06d44cc..bed0951b 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -336,7 +336,7 @@ GetLinterRules() { ######################################## # Update the path to the file location # ######################################## - declare -g "${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 # From d02e03878bd9bb0172e84b4eeaeddf160937fc4b Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 6 Jul 2020 15:51:17 -0500 Subject: [PATCH 9/9] Shellcheck other extensions fix --- 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 01001be5..9f7e816d 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -942,7 +942,7 @@ if [ "$VALIDATE_BASH" == "true" ]; then # Lint the bash files # ####################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "BASH" "shellcheck" "shellcheck --color" ".*\.\(sh|bash|dash|ksh\)\$" "${FILE_ARRAY_BASH[@]}" + LintCodebase "BASH" "shellcheck" "shellcheck --color" ".*\.\(sh\|bash\|dash\|ksh\)\$" "${FILE_ARRAY_BASH[@]}" fi ################## diff --git a/lib/worker.sh b/lib/worker.sh index 2c76bf21..e666494f 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -455,7 +455,7 @@ function RunTestCases() { TestCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "json" TestCodebase "XML" "xmllint" "xmllint" ".*\.\(xml\)\$" "xml" TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c $MD_LINTER_RULES" ".*\.\(md\)\$" "markdown" - TestCodebase "BASH" "shellcheck" "shellcheck --color" ".*\.\(sh|bash|dash|ksh\)\$" "shell" + 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 "PHP" "php" "php -l" ".*\.\(php\)\$" "php"