From 24ce47014de3d4c9a5342785e4f62d5cdf8f771a Mon Sep 17 00:00:00 2001 From: Eddy Nakamura Date: Mon, 24 Aug 2020 21:40:02 -0300 Subject: [PATCH 01/26] Adding C# lint --- lib/linter.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/linter.sh b/lib/linter.sh index 1475c8f6..827e6498 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -177,6 +177,7 @@ VALIDATE_BASH="${VALIDATE_BASH}" # Boolean t 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_CSHARP="${VALIDATE_CSHARP}" # Boolean to validate language VALIDATE_CSS="${VALIDATE_CSS}" # Boolean to validate language VALIDATE_DART="${VALIDATE_DART}" # Boolean to validate language VALIDATE_DOCKERFILE="${VALIDATE_DOCKERFILE}" # Boolean to validate language @@ -1418,6 +1419,17 @@ if [ "${VALIDATE_COFFEE}" == "true" ]; then LintCodebase "COFFEESCRIPT" "coffeelint" "coffeelint -f ${COFFEESCRIPT_LINTER_RULES}" ".*\.\(coffee\)\$" "${FILE_ARRAY_COFFEESCRIPT[@]}" fi +################## +# CSHARP LINTING # +################## +if [ "${VALIDATE_CSHARP}" == "true" ]; then + ######################### + # Lint the C# files # + ######################### + # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" + LintCodebase "CSHARP" "dotnet-format" "dotnet-format --check --files .*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" +fi + ############### # CSS LINTING # ############### From accf805de4313fdd8bb98eee8cc412bb3925fe91 Mon Sep 17 00:00:00 2001 From: Eddy Nakamura Date: Mon, 24 Aug 2020 21:43:50 -0300 Subject: [PATCH 02/26] adding files to buildFileList and linter --- lib/buildFileList.sh | 5 +++++ lib/linter.sh | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index c3cf58cd..fa97ddbe 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -404,6 +404,11 @@ function BuildFileList() { # Append the file to the array # ################################ FILE_ARRAY_POWERSHELL+=("${FILE}") + elif [ "${FILE_TYPE}" == "cs" ]; then + ################################ + # Append the file to the array # + ################################ + FILE_ARRAY_CSHARP+=("${FILE}") elif [ "${FILE_TYPE}" == "css" ] || [ "${FILE_TYPE}" == "scss" ] || [ "${FILE_TYPE}" == "sass" ]; then ################################ diff --git a/lib/linter.sh b/lib/linter.sh index 827e6498..b4555ef9 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -280,6 +280,7 @@ FILE_ARRAY_BASH=() # Array of files to check FILE_ARRAY_CLOUDFORMATION=() # Array of files to check FILE_ARRAY_CLOJURE=() # Array of files to check FILE_ARRAY_COFFEESCRIPT=() # Array of files to check +FILE_ARRAY_CSHARP=() # Array of files to check FILE_ARRAY_CSS=() # Array of files to check FILE_ARRAY_DART=() # Array of files to check FILE_ARRAY_DOCKERFILE=() # Array of files to check From efe1f95c879e715687471fe0f0cac45398821ebe Mon Sep 17 00:00:00 2001 From: Eddy Nakamura Date: Mon, 24 Aug 2020 21:46:55 -0300 Subject: [PATCH 03/26] updating linter script --- lib/linter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index b4555ef9..e2e754f0 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -134,7 +134,7 @@ YAML_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${YAML_FILE_NAME}" # Path to the ya # Linter array for information prints # ####################################### LINTER_ARRAY=('ansible-lint' 'arm-ttk' 'asl-validator' 'black' 'cfn-lint' 'checkstyle' 'chktex' 'clj-kondo' 'coffeelint' - 'dart' 'dockerfilelint' 'dotenv-linter' 'editorconfig-checker' 'eslint' 'flake8' 'golangci-lint' + 'dotnet-format' 'dart' 'dockerfilelint' 'dotenv-linter' 'editorconfig-checker' 'eslint' 'flake8' 'golangci-lint' 'hadolint' 'htmlhint' 'jsonlint' 'ktlint' 'lintr' 'lua' 'markdownlint' 'npm-groovy-lint' 'perl' 'protolint' 'pwsh' 'pylint' 'raku' 'rubocop' 'shellcheck' 'spectral' 'standard' 'stylelint' 'sql-lint' 'terrascan' 'tflint' 'xmllint' 'yamllint') @@ -142,7 +142,7 @@ LINTER_ARRAY=('ansible-lint' 'arm-ttk' 'asl-validator' 'black' 'cfn-lint' 'check ############################# # Language array for prints # ############################# -LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'CLOUDFORMATION' 'CLOJURE' 'COFFEESCRIPT' 'CSS' +LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'CLOUDFORMATION' 'CLOJURE' 'COFFEESCRIPT' 'CSHARP' 'CSS' 'DART' 'DOCKERFILE' 'DOCKERFILE_HADOLINT' 'EDITORCONFIG' 'ENV' 'GO' 'GROOVY' 'HTML' 'JAVA' 'JAVASCRIPT_ES' 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'LATEX' 'LUA' 'MARKDOWN' 'OPENAPI' 'PERL' 'PHP_BUILTIN' 'PHP_PHPCS' 'PHP_PHPSTAN' 'PHP_PSALM' 'POWERSHELL' From 79dccdf62bd5de0d5956ac82e4c34cdb6f2cd78d Mon Sep 17 00:00:00 2001 From: Eddy Nakamura Date: Mon, 24 Aug 2020 21:58:25 -0300 Subject: [PATCH 04/26] updating command --- lib/linter.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index e2e754f0..4af7c864 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -333,6 +333,8 @@ ERRORS_FOUND_CLOUDFORMATION=0 # Count of errors found export ERRORS_FOUND_CLOUDFORMATION # Workaround SC2034 ERRORS_FOUND_CLOJURE=0 # Count of errors found export ERRORS_FOUND_CLOJURE # Workaround SC2034 +ERRORS_FOUND_CSHARP=0 # Count of errors found +export ERRORS_FOUND_CSHARP # Workaround SC2034 ERRORS_FOUND_CSS=0 # Count of errors found export ERRORS_FOUND_CSS # Workaround SC2034 ERRORS_FOUND_COFFEESCRIPT=0 # Count of errors found @@ -1428,7 +1430,7 @@ if [ "${VALIDATE_CSHARP}" == "true" ]; then # Lint the C# files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "CSHARP" "dotnet-format" "dotnet-format --check --files .*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" + LintCodebase "CSHARP" "dotnet-format" "dotnet-format --check --include .*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" fi ############### From 6c25dc24f0a58fd2973d77aa677c7a7e191b1e83 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 25 Aug 2020 12:58:20 -0500 Subject: [PATCH 05/26] got it installed --- Dockerfile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 297bd644..87cf365a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,7 +63,9 @@ RUN apk add --update --no-cache \ gnupg \ icu-libs \ jq \ - libc-dev libxml2-dev libxml2-utils \ + krb5-libs \ + libc-dev libxml2-dev libxml2-utils libgcc \ + libcurl libintl libssl1.1 libstdc++ \ make \ musl-dev \ npm nodejs-current \ @@ -104,6 +106,16 @@ ENV PATH="/node_modules/.bin:${PATH}" ############################## RUN bundle install +################################### +# Install DotNet and Dependancies # +################################### +RUN wget --tries=5 -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ + && chmod +x dotnet-install.sh \ + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel Current -version latest \ + && /usr/share/dotnet/dotnet tool install -g dotnet-format + +ENV PATH="${PATH}:/root/.dotnet/tools" + ############################## # Installs Perl dependencies # ############################## @@ -207,9 +219,9 @@ RUN wget --tries=5 https://storage.googleapis.com/dart-archive/channels/stable/r && mv dart-sdk/bin/* /usr/bin/ && mv dart-sdk/lib/* /usr/lib/ && mv dart-sdk/include/* /usr/include/ \ && rm -r dart-sdk/ -################ -# Install Raku # -################ +################################################# +# Install Raku and additional Edge dependencies # +################################################# # Basic setup, programs and init RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories \ && apk add --update --no-cache rakudo zef From 076fd8a881cdc43e1d1e8e34af84dd2ed631a8dd Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 25 Aug 2020 13:02:30 -0500 Subject: [PATCH 06/26] adding docs --- Dockerfile | 2 +- README.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 87cf365a..413effba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -229,7 +229,6 @@ RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/reposi ###################### # Install CheckStyle # ###################### - RUN CHECKSTYLE_LATEST=$(curl -s https://api.github.com/repos/checkstyle/checkstyle/releases/latest \ | grep browser_download_url \ | grep ".jar" \ @@ -294,6 +293,7 @@ ENV ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ VALIDATE_CLOJURE=${VALIDATE_CLOJURE} \ VALIDATE_CLOUDFORMATION=${VALIDATE_CLOUDFORMATION} \ VALIDATE_COFFEE=${VALIDATE_COFFEE} \ + VALIDATE_CSHARP=${VALIDATE_CSHARP} \ VALIDATE_CSS=${VALIDATE_CSS} \ VALIDATE_DART=${VALIDATE_DART} \ VALIDATE_DOCKERFILE=${VALIDATE_DOCKERFILE} \ diff --git a/README.md b/README.md index 06e41da6..e5a3f04f 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base | **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/) | +| **C#** | [dotnet-format](https://github.com/dotnet/format) | | **CSS** | [stylelint](https://stylelint.io/) | | **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) | | **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) | @@ -196,7 +197,8 @@ But if you wish to select or exclude specific linters, we give you full control | **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_COFFEE** | `true` | Flag to enable or disable the linting process of the Coffeescript language. | +| **VALIDATE_CSHARP** | `true` | Flag to enable or disable the linting process of the C# 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_DOCKERFILE** | `true` | Flag to enable or disable the linting process of the Docker language. | From add83739a71b9e3e2b6d251f59822d683a3a8e27 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 25 Aug 2020 13:07:44 -0500 Subject: [PATCH 07/26] adding test folders --- .automation/test/csharp/README.md | 19 ++++++++++++++++ .automation/test/csharp/csharp_bad_01.cs | 9 ++++++++ .automation/test/csharp/csharp_good_01.cs | 22 +++++++++++++++++++ .../reports/expected-CSHARP.tap.ignored | 7 ++++++ lib/worker.sh | 1 + 5 files changed, 58 insertions(+) create mode 100644 .automation/test/csharp/README.md create mode 100644 .automation/test/csharp/csharp_bad_01.cs create mode 100644 .automation/test/csharp/csharp_good_01.cs create mode 100644 .automation/test/csharp/reports/expected-CSHARP.tap.ignored diff --git a/.automation/test/csharp/README.md b/.automation/test/csharp/README.md new file mode 100644 index 00000000..7c284115 --- /dev/null +++ b/.automation/test/csharp/README.md @@ -0,0 +1,19 @@ +# CSS Test Cases + +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/csharp/csharp_bad_01.cs b/.automation/test/csharp/csharp_bad_01.cs new file mode 100644 index 00000000..6ae90d7e --- /dev/null +++ b/.automation/test/csharp/csharp_bad_01.cs @@ -0,0 +1,9 @@ +/* Bad */ +/* Multi-line */ +/* Comment */ +.selector-3[type="text"] { + background: linear-gradient(#FFFFFF, rgba(0, 0, 0, 0.8)); + box-sizing: border-box; + display: block; + color: #AAAAAA; +} diff --git a/.automation/test/csharp/csharp_good_01.cs b/.automation/test/csharp/csharp_good_01.cs new file mode 100644 index 00000000..a126e5b2 --- /dev/null +++ b/.automation/test/csharp/csharp_good_01.cs @@ -0,0 +1,22 @@ +/** + * Multi-line comment + */ + +.selector-1, +.selector-2, +.selector-3[type="text"] { + background: linear-gradient(#fff, rgba(0, 0, 0, 0.8)); + box-sizing: border-box; + display: block; + color: #333; +} + +.selector-a, +.selector-b:not(:first-child) { + padding: 10px !important; + top: calc(calc(1em * 2) / 3); +} + +.selector-x { width: 10%; } +.selector-y { width: 20%; } +.selector-z { width: 30%; } diff --git a/.automation/test/csharp/reports/expected-CSHARP.tap.ignored b/.automation/test/csharp/reports/expected-CSHARP.tap.ignored new file mode 100644 index 00000000..98d94702 --- /dev/null +++ b/.automation/test/csharp/reports/expected-CSHARP.tap.ignored @@ -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/lib/worker.sh b/lib/worker.sh index e2afbee3..4757931b 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -611,6 +611,7 @@ function RunTestCases() { TestCodebase "CLOUDFORMATION" "cfn-lint" "cfn-lint --config-file ${CLOUDFORMATION_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "cloudformation" 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 "CSHARP" "dotnet-format" "dotnet-format --check --include .*\.\(cs\)\$" "csharp" TestCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\|scss\|sass\)\$" "css" TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "dart" TestCodebase "DOCKERFILE" "dockerfilelint" "dockerfilelint -c ${DOCKERFILE_LINTER_RULES}" ".*\(Dockerfile\)\$" "docker" From 2ff9be6197e1b550cf114090dacd187b98b6fd60 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 25 Aug 2020 14:05:42 -0500 Subject: [PATCH 08/26] adding testes --- .automation/test/csharp/csharp_bad_01.cs | 19 ++++++++------ .automation/test/csharp/csharp_good_01.cs | 30 ++++++++--------------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/.automation/test/csharp/csharp_bad_01.cs b/.automation/test/csharp/csharp_bad_01.cs index 6ae90d7e..63144941 100644 --- a/.automation/test/csharp/csharp_bad_01.cs +++ b/.automation/test/csharp/csharp_bad_01.cs @@ -1,9 +1,12 @@ -/* Bad */ -/* Multi-line */ -/* Comment */ -.selector-3[type="text"] { - background: linear-gradient(#FFFFFF, rgba(0, 0, 0, 0.8)); - box-sizing: border-box; - display: block; - color: #AAAAAA; +using System; + +namespace HelloWorld +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine(Hello World); + } + } } diff --git a/.automation/test/csharp/csharp_good_01.cs b/.automation/test/csharp/csharp_good_01.cs index a126e5b2..b17954e5 100644 --- a/.automation/test/csharp/csharp_good_01.cs +++ b/.automation/test/csharp/csharp_good_01.cs @@ -1,22 +1,12 @@ -/** - * Multi-line comment - */ +using System; -.selector-1, -.selector-2, -.selector-3[type="text"] { - background: linear-gradient(#fff, rgba(0, 0, 0, 0.8)); - box-sizing: border-box; - display: block; - color: #333; +namespace HelloWorld +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } } - -.selector-a, -.selector-b:not(:first-child) { - padding: 10px !important; - top: calc(calc(1em * 2) / 3); -} - -.selector-x { width: 10%; } -.selector-y { width: 20%; } -.selector-z { width: 30%; } From 9b129f48732a7215e7b106ce7bfc325ce9ea3e8f Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 25 Aug 2020 14:21:22 -0500 Subject: [PATCH 09/26] fixed it again --- lib/buildFileList.sh | 8 ++++++++ lib/linter.sh | 2 +- lib/worker.sh | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index fa97ddbe..50aac7f4 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -404,11 +404,19 @@ function BuildFileList() { # Append the file to the array # ################################ FILE_ARRAY_POWERSHELL+=("${FILE}") + ########################################################## + # Set the READ_ONLY_CHANGE_FLAG since this could be exec # + ########################################################## + READ_ONLY_CHANGE_FLAG=1 elif [ "${FILE_TYPE}" == "cs" ]; then ################################ # Append the file to the array # ################################ FILE_ARRAY_CSHARP+=("${FILE}") + ########################################################## + # Set the READ_ONLY_CHANGE_FLAG since this could be exec # + ########################################################## + READ_ONLY_CHANGE_FLAG=1 elif [ "${FILE_TYPE}" == "css" ] || [ "${FILE_TYPE}" == "scss" ] || [ "${FILE_TYPE}" == "sass" ]; then ################################ diff --git a/lib/linter.sh b/lib/linter.sh index 9bbacc3b..8799c0f5 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1430,7 +1430,7 @@ if [ "${VALIDATE_CSHARP}" == "true" ]; then # Lint the C# files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "CSHARP" "dotnet-format" "dotnet-format --check --include .*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" + LintCodebase "CSHARP" "dotnet-format" "dotnet-format --check --include" ".*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" fi ############### diff --git a/lib/worker.sh b/lib/worker.sh index ac484cae..f8ae24b7 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -617,7 +617,7 @@ function RunTestCases() { TestCodebase "CLOUDFORMATION" "cfn-lint" "cfn-lint --config-file ${CLOUDFORMATION_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "cloudformation" 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 "CSHARP" "dotnet-format" "dotnet-format --check --include .*\.\(cs\)\$" "csharp" + TestCodebase "CSHARP" "dotnet-format" "dotnet-format --check --include" ".*\.\(cs\)\$" "csharp" TestCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\|scss\|sass\)\$" "css" TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "dart" TestCodebase "DOCKERFILE" "dockerfilelint" "dockerfilelint -c ${DOCKERFILE_LINTER_RULES}" ".*\(Dockerfile\)\$" "docker" From 33872f99a0cf12749824917c9ec92ec1a32b1123 Mon Sep 17 00:00:00 2001 From: Thomas Hughes Date: Tue, 25 Aug 2020 14:26:43 -0500 Subject: [PATCH 10/26] Update csharp test README --- .automation/test/csharp/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.automation/test/csharp/README.md b/.automation/test/csharp/README.md index 7c284115..eadae5be 100644 --- a/.automation/test/csharp/README.md +++ b/.automation/test/csharp/README.md @@ -1,6 +1,6 @@ -# CSS Test Cases +# CSharp Test Cases -This folder holds the test cases for **CSS**. +This folder holds the test cases for **CSharp**. ## Additional Docs From 7486ddb784596d68d5a2c4fb038c60743c80b96e Mon Sep 17 00:00:00 2001 From: Thomas Hughes Date: Tue, 25 Aug 2020 14:31:13 -0500 Subject: [PATCH 11/26] Update C# Bad test (curly brace should be newline) --- .automation/test/csharp/csharp_bad_01.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.automation/test/csharp/csharp_bad_01.cs b/.automation/test/csharp/csharp_bad_01.cs index 63144941..132f5d24 100644 --- a/.automation/test/csharp/csharp_bad_01.cs +++ b/.automation/test/csharp/csharp_bad_01.cs @@ -1,12 +1,9 @@ using System; -namespace HelloWorld -{ - class Program - { - static void Main(string[] args) - { - Console.WriteLine(Hello World); +namespace HelloWorld { + class Program { + static void Main(string[] args) { + Console.WriteLine("Hello World"); } } } From 74160885884ae86e816df8e9c17e77bb513be0cf Mon Sep 17 00:00:00 2001 From: Eddy Nakamura Date: Tue, 25 Aug 2020 16:52:52 -0300 Subject: [PATCH 12/26] updating spaces to be correct --- .automation/test/csharp/csharp_good_01.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.automation/test/csharp/csharp_good_01.cs b/.automation/test/csharp/csharp_good_01.cs index b17954e5..a68542dc 100644 --- a/.automation/test/csharp/csharp_good_01.cs +++ b/.automation/test/csharp/csharp_good_01.cs @@ -2,11 +2,11 @@ using System; namespace HelloWorld { - class Program - { - static void Main(string[] args) + class Program { - Console.WriteLine("Hello World!"); + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } } - } } From a766e5f624cf885e6dece53bbebe69a0bf41b413 Mon Sep 17 00:00:00 2001 From: Eddy Nakamura Date: Tue, 25 Aug 2020 19:20:02 -0300 Subject: [PATCH 13/26] updating format command --- lib/worker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/worker.sh b/lib/worker.sh index f8ae24b7..610271e6 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -617,7 +617,7 @@ function RunTestCases() { TestCodebase "CLOUDFORMATION" "cfn-lint" "cfn-lint --config-file ${CLOUDFORMATION_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "cloudformation" 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 "CSHARP" "dotnet-format" "dotnet-format --check --include" ".*\.\(cs\)\$" "csharp" + TestCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --include" ".*\.\(cs\) --check\$" "csharp" TestCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\|scss\|sass\)\$" "css" TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "dart" TestCodebase "DOCKERFILE" "dockerfilelint" "dockerfilelint -c ${DOCKERFILE_LINTER_RULES}" ".*\(Dockerfile\)\$" "docker" From 6157d8a2ae7f9a38fbc45f6a0a8dd3b16346fa5f Mon Sep 17 00:00:00 2001 From: Eddy Nakamura Date: Tue, 25 Aug 2020 19:52:04 -0300 Subject: [PATCH 14/26] trying to solve command issue --- lib/worker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/worker.sh b/lib/worker.sh index 610271e6..921c2cac 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -617,7 +617,7 @@ function RunTestCases() { TestCodebase "CLOUDFORMATION" "cfn-lint" "cfn-lint --config-file ${CLOUDFORMATION_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "cloudformation" 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 "CSHARP" "dotnet-format" "dotnet-format --folder --include" ".*\.\(cs\) --check\$" "csharp" + TestCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --include" ".*\.\(cs\)\$ --check" "csharp" TestCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\|scss\|sass\)\$" "css" TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "dart" TestCodebase "DOCKERFILE" "dockerfilelint" "dockerfilelint -c ${DOCKERFILE_LINTER_RULES}" ".*\(Dockerfile\)\$" "docker" From 454fa09b81d128512ae2ec894c2c301c4a05a31a Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Wed, 26 Aug 2020 08:50:53 -0500 Subject: [PATCH 15/26] Fixed it? --- Dockerfile | 2 +- lib/linter.sh | 2 +- lib/worker.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d6f5a5a..535289aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -114,7 +114,7 @@ RUN wget --tries=5 -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel Current -version latest \ && /usr/share/dotnet/dotnet tool install -g dotnet-format -ENV PATH="${PATH}:/root/.dotnet/tools" +ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" ############################## # Installs Perl dependencies # diff --git a/lib/linter.sh b/lib/linter.sh index 8799c0f5..7fc396fa 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1430,7 +1430,7 @@ if [ "${VALIDATE_CSHARP}" == "true" ]; then # Lint the C# files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "CSHARP" "dotnet-format" "dotnet-format --check --include" ".*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" + LintCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --check --include" ".*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" fi ############### diff --git a/lib/worker.sh b/lib/worker.sh index 921c2cac..52e23e3d 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -617,7 +617,7 @@ function RunTestCases() { TestCodebase "CLOUDFORMATION" "cfn-lint" "cfn-lint --config-file ${CLOUDFORMATION_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "cloudformation" 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 "CSHARP" "dotnet-format" "dotnet-format --folder --include" ".*\.\(cs\)\$ --check" "csharp" + TestCodebase "CSHARP" "dotnet-format" "dotnet-format --check --folder --include" ".*\.\(cs\)\$" "csharp" TestCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\|scss\|sass\)\$" "css" TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "dart" TestCodebase "DOCKERFILE" "dockerfilelint" "dockerfilelint -c ${DOCKERFILE_LINTER_RULES}" ".*\(Dockerfile\)\$" "docker" From b83e4c99ed7d7b36c9bb4a5b4229ca42eb2f14d4 Mon Sep 17 00:00:00 2001 From: Eddy Nakamura Date: Wed, 26 Aug 2020 11:42:05 -0300 Subject: [PATCH 16/26] updating command --- 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 7fc396fa..53975317 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1430,7 +1430,7 @@ if [ "${VALIDATE_CSHARP}" == "true" ]; then # Lint the C# files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --check --include" ".*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" + LintCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --check --include" ".\**\*.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" fi ############### diff --git a/lib/worker.sh b/lib/worker.sh index 52e23e3d..eddd028a 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -617,7 +617,7 @@ function RunTestCases() { TestCodebase "CLOUDFORMATION" "cfn-lint" "cfn-lint --config-file ${CLOUDFORMATION_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "cloudformation" 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 "CSHARP" "dotnet-format" "dotnet-format --check --folder --include" ".*\.\(cs\)\$" "csharp" + TestCodebase "CSHARP" "dotnet-format" "dotnet-format --check --folder --include" ".\**\*.\(cs\)\$" "csharp" TestCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\|scss\|sass\)\$" "css" TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "dart" TestCodebase "DOCKERFILE" "dockerfilelint" "dockerfilelint -c ${DOCKERFILE_LINTER_RULES}" ".*\(Dockerfile\)\$" "docker" From 9c44d2d503f1e91fdd997494f0f048bfd8b75088 Mon Sep 17 00:00:00 2001 From: Eddy Nakamura Date: Wed, 26 Aug 2020 11:58:28 -0300 Subject: [PATCH 17/26] changing command - 2 --- 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 53975317..53ed512e 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1430,7 +1430,7 @@ if [ "${VALIDATE_CSHARP}" == "true" ]; then # Lint the C# files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --check --include" ".\**\*.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" + LintCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --check --include" "**.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" fi ############### diff --git a/lib/worker.sh b/lib/worker.sh index eddd028a..5cd34847 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -617,7 +617,7 @@ function RunTestCases() { TestCodebase "CLOUDFORMATION" "cfn-lint" "cfn-lint --config-file ${CLOUDFORMATION_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "cloudformation" 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 "CSHARP" "dotnet-format" "dotnet-format --check --folder --include" ".\**\*.\(cs\)\$" "csharp" + TestCodebase "CSHARP" "dotnet-format" "dotnet-format --check --folder --include" "**.\(cs\)\$" "csharp" TestCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\|scss\|sass\)\$" "css" TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "dart" TestCodebase "DOCKERFILE" "dockerfilelint" "dockerfilelint -c ${DOCKERFILE_LINTER_RULES}" ".*\(Dockerfile\)\$" "docker" From 345a6626e7bfbec602ff4f32fd0cffd01eee41a9 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Fri, 28 Aug 2020 11:42:14 -0500 Subject: [PATCH 18/26] put it back --- 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 53ed512e..7fc396fa 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1430,7 +1430,7 @@ if [ "${VALIDATE_CSHARP}" == "true" ]; then # Lint the C# files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --check --include" "**.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" + LintCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --check --include" ".*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" fi ############### diff --git a/lib/worker.sh b/lib/worker.sh index 5cd34847..52e23e3d 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -617,7 +617,7 @@ function RunTestCases() { TestCodebase "CLOUDFORMATION" "cfn-lint" "cfn-lint --config-file ${CLOUDFORMATION_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "cloudformation" 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 "CSHARP" "dotnet-format" "dotnet-format --check --folder --include" "**.\(cs\)\$" "csharp" + TestCodebase "CSHARP" "dotnet-format" "dotnet-format --check --folder --include" ".*\.\(cs\)\$" "csharp" TestCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\|scss\|sass\)\$" "css" TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "dart" TestCodebase "DOCKERFILE" "dockerfilelint" "dockerfilelint -c ${DOCKERFILE_LINTER_RULES}" ".*\(Dockerfile\)\$" "docker" From b7781ba295118469bd58c3b18059c3ba146234f3 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Fri, 28 Aug 2020 11:54:31 -0500 Subject: [PATCH 19/26] forgot quote --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index 5133418e..a4ce7bb7 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -142,7 +142,7 @@ LINTER_ARRAY=('ansible-lint' 'arm-ttk' 'asl-validator' 'bash-exec' 'black' 'cfn- ############################# # Language array for prints # ############################# -LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' BASH_EXEC' 'CLOUDFORMATION' 'CLOJURE' 'COFFEESCRIPT' 'CSHARP' 'CSS' +LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'BASH_EXEC' 'CLOUDFORMATION' 'CLOJURE' 'COFFEESCRIPT' 'CSHARP' 'CSS' 'DART' 'DOCKERFILE' 'DOCKERFILE_HADOLINT' 'EDITORCONFIG' 'ENV' 'GO' 'GROOVY' 'HTML' 'JAVA' 'JAVASCRIPT_ES' 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'LATEX' 'LUA' 'MARKDOWN' 'OPENAPI' 'PERL' 'PHP_BUILTIN' 'PHP_PHPCS' 'PHP_PHPSTAN' 'PHP_PSALM' 'POWERSHELL' From 62130639f1be4e52d78b4e250edaaf24ccb65552 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Fri, 28 Aug 2020 12:06:31 -0500 Subject: [PATCH 20/26] bad internet --- Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6dee160a..1836431b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -111,7 +111,7 @@ RUN bundle install ################################### # Install DotNet and Dependancies # ################################### -RUN wget --tries=5 -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ +RUN wget --tries=5 --waitretry=2 -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel Current -version latest \ && /usr/share/dotnet/dotnet tool install -g dotnet-format @@ -126,8 +126,8 @@ RUN curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wge ############################## # Install Phive dependencies # ############################## -RUN wget --tries=5 -O phive.phar https://phar.io/releases/phive.phar \ - && wget --tries=5 -O phive.phar.asc https://phar.io/releases/phive.phar.asc \ +RUN wget --tries=5 --waitretry=2 -O phive.phar https://phar.io/releases/phive.phar \ + && wget --tries=5 --waitretry=2 -O phive.phar.asc https://phar.io/releases/phive.phar.asc \ && gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79 \ && gpg --verify phive.phar.asc phive.phar \ && chmod +x phive.phar \ @@ -220,10 +220,10 @@ RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/rel #################### # Install dart-sdk # #################### -RUN wget --tries=5 -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -RUN wget --tries=5 https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk +RUN wget --tries=5 --waitretry=2 -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub +RUN wget --tries=5 --waitretry=2 https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk RUN apk add --no-cache glibc-${GLIBC_VERSION}.apk && rm glibc-${GLIBC_VERSION}.apk -RUN wget --tries=5 https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip -q - \ +RUN wget --tries=5 --waitretry=2 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/ @@ -254,13 +254,13 @@ RUN CHECKSTYLE_LATEST=$(curl -s https://api.github.com/repos/checkstyle/checksty #################### # Install luacheck # #################### -RUN wget --tries=5 https://www.lua.org/ftp/lua-5.3.5.tar.gz -O - -q | tar -xzf - \ +RUN wget --tries=5 --waitretry=2 https://www.lua.org/ftp/lua-5.3.5.tar.gz -O - -q | tar -xzf - \ && cd lua-5.3.5 \ && make linux \ && make install \ && cd .. && rm -r lua-5.3.5/ -RUN wget --tries=5 https://github.com/cvega/luarocks/archive/v3.3.1-super-linter.tar.gz -O - -q | tar -xzf - \ +RUN wget --tries=5 --waitretry=2 https://github.com/cvega/luarocks/archive/v3.3.1-super-linter.tar.gz -O - -q | tar -xzf - \ && cd luarocks-3.3.1-super-linter \ && ./configure --with-lua-include=/usr/local/include \ && make \ From 44bfbdb2b10cc0d2a6c48dd1ea88d001548e9224 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Fri, 28 Aug 2020 12:14:49 -0500 Subject: [PATCH 21/26] put it back --- Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1836431b..6dee160a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -111,7 +111,7 @@ RUN bundle install ################################### # Install DotNet and Dependancies # ################################### -RUN wget --tries=5 --waitretry=2 -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ +RUN wget --tries=5 -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel Current -version latest \ && /usr/share/dotnet/dotnet tool install -g dotnet-format @@ -126,8 +126,8 @@ RUN curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wge ############################## # Install Phive dependencies # ############################## -RUN wget --tries=5 --waitretry=2 -O phive.phar https://phar.io/releases/phive.phar \ - && wget --tries=5 --waitretry=2 -O phive.phar.asc https://phar.io/releases/phive.phar.asc \ +RUN wget --tries=5 -O phive.phar https://phar.io/releases/phive.phar \ + && wget --tries=5 -O phive.phar.asc https://phar.io/releases/phive.phar.asc \ && gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79 \ && gpg --verify phive.phar.asc phive.phar \ && chmod +x phive.phar \ @@ -220,10 +220,10 @@ RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/rel #################### # Install dart-sdk # #################### -RUN wget --tries=5 --waitretry=2 -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -RUN wget --tries=5 --waitretry=2 https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk +RUN wget --tries=5 -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub +RUN wget --tries=5 https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk RUN apk add --no-cache glibc-${GLIBC_VERSION}.apk && rm glibc-${GLIBC_VERSION}.apk -RUN wget --tries=5 --waitretry=2 https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip -q - \ +RUN wget --tries=5 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/ @@ -254,13 +254,13 @@ RUN CHECKSTYLE_LATEST=$(curl -s https://api.github.com/repos/checkstyle/checksty #################### # Install luacheck # #################### -RUN wget --tries=5 --waitretry=2 https://www.lua.org/ftp/lua-5.3.5.tar.gz -O - -q | tar -xzf - \ +RUN wget --tries=5 https://www.lua.org/ftp/lua-5.3.5.tar.gz -O - -q | tar -xzf - \ && cd lua-5.3.5 \ && make linux \ && make install \ && cd .. && rm -r lua-5.3.5/ -RUN wget --tries=5 --waitretry=2 https://github.com/cvega/luarocks/archive/v3.3.1-super-linter.tar.gz -O - -q | tar -xzf - \ +RUN wget --tries=5 https://github.com/cvega/luarocks/archive/v3.3.1-super-linter.tar.gz -O - -q | tar -xzf - \ && cd luarocks-3.3.1-super-linter \ && ./configure --with-lua-include=/usr/local/include \ && make \ From e9c3938982a0057a1fcd78e589f45dd278eaee5e Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Fri, 28 Aug 2020 13:44:11 -0500 Subject: [PATCH 22/26] fix tty issues --- lib/worker.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/worker.sh b/lib/worker.sh index 29074246..1beed4aa 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -229,6 +229,14 @@ function LintCodebase() { R --slave -e "errors <- lintr::lint('$FILE');print(errors);quit(save = 'no', status = if (length(errors) > 0) 1 else 0)" 2>&1 ) #LINTER_COMMAND="lintr::lint('${FILE}')" + ######################################################### + # Corner case for C# as it writes to tty and not stdout # + ######################################################### + elif [[ ${FILE_TYPE} == "CSHARP" ]]; then + LINT_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit + ${LINTER_CMD} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" + ) else ################################ # Lint the file with the rules # @@ -468,6 +476,14 @@ function TestCodebase() { cd "${GITHUB_WORKSPACE}" || exit R --slave -e "errors <- lintr::lint('$FILE');print(errors);quit(save = 'no', status = if (length(errors) > 0) 1 else 0)" 2>&1 ) + ######################################################### + # Corner case for C# as it writes to tty and not stdout # + ######################################################### + elif [[ ${FILE_TYPE} == "CSHARP" ]]; then + LINT_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit + ${LINTER_CMD} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" + ) else ################################ # Lint the file with the rules # From 633418aa8af57fd738663bba251f3da3b311e96c Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Fri, 28 Aug 2020 13:47:15 -0500 Subject: [PATCH 23/26] fix var --- lib/worker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/worker.sh b/lib/worker.sh index 1beed4aa..52ca044f 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -482,7 +482,7 @@ function TestCodebase() { elif [[ ${FILE_TYPE} == "CSHARP" ]]; then LINT_CMD=$( cd "${GITHUB_WORKSPACE}" || exit - ${LINTER_CMD} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" + ${LINTER_COMMAND} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" ) else ################################ From a9bc2068f7e111568bacbce7356578aa28b47549 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Fri, 28 Aug 2020 13:50:23 -0500 Subject: [PATCH 24/26] they come in pairs --- lib/worker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/worker.sh b/lib/worker.sh index 52ca044f..ce064762 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -235,7 +235,7 @@ function LintCodebase() { elif [[ ${FILE_TYPE} == "CSHARP" ]]; then LINT_CMD=$( cd "${GITHUB_WORKSPACE}" || exit - ${LINTER_CMD} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" + ${LINTER_COMMAND} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" ) else ################################ From a32d0c1314ede9fb6036796b2dc98c34a2e6b00f Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Fri, 28 Aug 2020 14:08:08 -0500 Subject: [PATCH 25/26] here --- lib/linter.sh | 2 +- lib/worker.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index a4ce7bb7..f27b3da7 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1444,7 +1444,7 @@ if [ "${VALIDATE_CSHARP}" == "true" ]; then # Lint the C# files # ######################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --check --include" ".*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" + LintCodebase "CSHARP" "dotnet-format" "dotnet-format --folder --check --exclude / --include" ".*\.\(cs\)\$" "${FILE_ARRAY_CSHARP[@]}" fi ############### diff --git a/lib/worker.sh b/lib/worker.sh index ce064762..6a172bcf 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -233,6 +233,7 @@ function LintCodebase() { # Corner case for C# as it writes to tty and not stdout # ######################################################### elif [[ ${FILE_TYPE} == "CSHARP" ]]; then + info "got into the csharp loop" LINT_CMD=$( cd "${GITHUB_WORKSPACE}" || exit ${LINTER_COMMAND} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" @@ -480,6 +481,7 @@ function TestCodebase() { # Corner case for C# as it writes to tty and not stdout # ######################################################### elif [[ ${FILE_TYPE} == "CSHARP" ]]; then + info "got into the csharp loop" LINT_CMD=$( cd "${GITHUB_WORKSPACE}" || exit ${LINTER_COMMAND} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" @@ -642,7 +644,7 @@ function RunTestCases() { TestCodebase "CLOUDFORMATION" "cfn-lint" "cfn-lint --config-file ${CLOUDFORMATION_LINTER_RULES}" ".*\.\(json\|yml\|yaml\)\$" "cloudformation" 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 "CSHARP" "dotnet-format" "dotnet-format --check --folder --include" ".*\.\(cs\)\$" "csharp" + TestCodebase "CSHARP" "dotnet-format" "dotnet-format --check --folder --exclude / --include" ".*\.\(cs\)\$" "csharp" TestCodebase "CSS" "stylelint" "stylelint --config ${CSS_LINTER_RULES}" ".*\.\(css\|scss\|sass\)\$" "css" TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}" ".*\.\(dart\)\$" "dart" TestCodebase "DOCKERFILE" "dockerfilelint" "dockerfilelint -c ${DOCKERFILE_LINTER_RULES}" ".*\(Dockerfile\)\$" "docker" From 958f70fe67a47a65646cbf4251539234fe549d25 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 31 Aug 2020 10:11:12 -0500 Subject: [PATCH 26/26] its real picky --- lib/worker.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/worker.sh b/lib/worker.sh index 6a172bcf..2e00c952 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -233,10 +233,9 @@ function LintCodebase() { # Corner case for C# as it writes to tty and not stdout # ######################################################### elif [[ ${FILE_TYPE} == "CSHARP" ]]; then - info "got into the csharp loop" LINT_CMD=$( - cd "${GITHUB_WORKSPACE}" || exit - ${LINTER_COMMAND} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" + cd "${DIR_NAME}" || exit + ${LINTER_COMMAND} "${FILE_NAME}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" ) else ################################ @@ -481,10 +480,9 @@ function TestCodebase() { # Corner case for C# as it writes to tty and not stdout # ######################################################### elif [[ ${FILE_TYPE} == "CSHARP" ]]; then - info "got into the csharp loop" LINT_CMD=$( - cd "${GITHUB_WORKSPACE}" || exit - ${LINTER_COMMAND} "${FILE}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" + cd "${DIR_NAME}" || exit + ${LINTER_COMMAND} "${FILE_NAME}" | tee /dev/tty2 2>&1; exit "${PIPESTATUS[0]}" ) else ################################