diff --git a/.automation/clean-code-base-for-tests.sh b/.automation/clean-code-base-for-tests.sh index 966f798c..a2372ce9 100755 --- a/.automation/clean-code-base-for-tests.sh +++ b/.automation/clean-code-base-for-tests.sh @@ -7,11 +7,11 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch -TEST_FOLDER='.automation/test' # Folder where test are stored -CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip -(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch +TEST_FOLDER='.automation/test' # Folder where test are stored +CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip +((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ############################ @@ -39,7 +39,10 @@ CleanTestFiles() { ################## # Find the files # ################## - mapfile -t FIND_CMD < <(cd "${GITHUB_WORKSPACE}" || exit 1 ; find "${GITHUB_WORKSPACE}" -type f -name "*_bad_*" 2>&1) + mapfile -t FIND_CMD < <( + cd "${GITHUB_WORKSPACE}" || exit 1 + find "${GITHUB_WORKSPACE}" -type f -name "*_bad_*" 2>&1 + ) ####################### # Load the error code # @@ -70,7 +73,10 @@ CleanTestFiles() { ################################ # Its a test, we can delete it # ################################ - REMOVE_FILE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; rm -f "$FILE" 2>&1) + REMOVE_FILE_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit 1 + rm -f "$FILE" 2>&1 + ) ####################### # Load the error code # @@ -96,7 +102,10 @@ CleanTestDockerFiles() { ################## # Find the files # ################## - mapfile -t FIND_CMD < <(cd "${GITHUB_WORKSPACE}" || exit 1 ; find "${GITHUB_WORKSPACE}" -type f -name "*Dockerfile" 2>&1) + mapfile -t FIND_CMD < <( + cd "${GITHUB_WORKSPACE}" || exit 1 + find "${GITHUB_WORKSPACE}" -type f -name "*Dockerfile" 2>&1 + ) ####################### # Load the error code # @@ -127,7 +136,10 @@ CleanTestDockerFiles() { ################################ # Its a test, we can delete it # ################################ - REMOVE_FILE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; rm -f "$FILE" 2>&1) + REMOVE_FILE_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit 1 + rm -f "$FILE" 2>&1 + ) ####################### # Load the error code # @@ -153,7 +165,10 @@ CleanSHAFolder() { ################## # Find the files # ################## - REMOVE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; sudo rm -rf "${GITHUB_SHA}" 2>&1) + REMOVE_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit 1 + sudo rm -rf "${GITHUB_SHA}" 2>&1 + ) ####################### # Load the error code # @@ -178,7 +193,10 @@ RenameTestFolder() { ##################### # Rename the folder # ##################### - RENAME_FOLDER_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; mv "${TEST_FOLDER}" "${CLEAN_FOLDER}" 2>&1) + RENAME_FOLDER_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit 1 + mv "${TEST_FOLDER}" "${CLEAN_FOLDER}" 2>&1 + ) ####################### # Load the error code # @@ -205,7 +223,10 @@ CleanPowershell() { ################## # Find the files # ################## - mapfile -t FIND_CMD < <(cd "${GITHUB_WORKSPACE}" || exit 1 ; find "${GITHUB_WORKSPACE}" -type f -name "*.psd1" 2>&1) + mapfile -t FIND_CMD < <( + cd "${GITHUB_WORKSPACE}" || exit 1 + find "${GITHUB_WORKSPACE}" -type f -name "*.psd1" 2>&1 + ) ####################### # Load the error code # @@ -236,7 +257,10 @@ CleanPowershell() { ################################ # Its a test, we can delete it # ################################ - REMOVE_FILE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; rm -f "$FILE" 2>&1) + REMOVE_FILE_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit 1 + rm -f "$FILE" 2>&1 + ) ####################### # Load the error code # diff --git a/.automation/cleanup-docker.sh b/.automation/cleanup-docker.sh index d7c3080b..961902d7 100755 --- a/.automation/cleanup-docker.sh +++ b/.automation/cleanup-docker.sh @@ -16,13 +16,13 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub -DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub -IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image -IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image -DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded -(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub +DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub +IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image +IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image +DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded +((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ######################### 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 c7370032..39f16d0d 100644 --- a/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh +++ b/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh @@ -8,21 +8,20 @@ ########### # Globals # ########### -GHE_CONFIG_PID='/var/run/ghe-config.pid' # PID file when a config is running -GHE_APPLY_COMMAND='ghe-config-apply' # Command running when a config run -SLEEP_SECONDS=20 # Seconds to sleep before next check -PID_CHECK_LIMIT=15 # How many times to check the pid before moving on -PID_CHECK=0 # Count of times to check the pid -PROCESS_CHECK_LIMIT=15 # How many times to check the process before moving on -PROCESS_CHECK=0 # Count of times to check the process +GHE_CONFIG_PID='/var/run/ghe-config.pid' # PID file when a config is running +GHE_APPLY_COMMAND='ghe-config-apply' # Command running when a config run +SLEEP_SECONDS=20 # Seconds to sleep before next check +PID_CHECK_LIMIT=15 # How many times to check the pid before moving on +PID_CHECK=0 # Count of times to check the pid +PROCESS_CHECK_LIMIT=15 # How many times to check the process before moving on +PROCESS_CHECK=0 # Count of times to check the process ################################################################################ ########################### SUB ROUTINES BELOW ################################# ################################################################################ ################################################################################ #### Function CheckGHEPid ###################################################### -CheckGHEPid() -{ +CheckGHEPid() { ################################## # Check to prevent infinite loop # ################################## @@ -75,8 +74,7 @@ CheckGHEPid() } ################################################################################ #### Function CheckGHEProcess ################################################## -CheckGHEProcess() -{ +CheckGHEProcess() { ################################## # Check to prevent infinite loop # ################################## @@ -139,8 +137,7 @@ CheckGHEProcess() } ################################################################################ #### Function RunConfigApply ################################################### -RunConfigApply() -{ +RunConfigApply() { ########## # Header # ########## diff --git a/.automation/test/ansible/ghe-initialize/templates/ldap-settings.json.j2 b/.automation/test/ansible/ghe-initialize/templates/ldap-settings.json.j2 index 4b692f95..2391ad23 100644 --- a/.automation/test/ansible/ghe-initialize/templates/ldap-settings.json.j2 +++ b/.automation/test/ansible/ghe-initialize/templates/ldap-settings.json.j2 @@ -4,7 +4,7 @@ "host": "{{ ldap_host }}", "port": {{ ldap_port }}, "base": [ - "{{ ldap_base_dn }}" + "{{ ldap_base_dn }}" ], "uid": null, "bind_dn": "{{ ldap_bind_dn }}", diff --git a/.automation/test/ansible/ghe-initialize/templates/splunk-settings.json.j2 b/.automation/test/ansible/ghe-initialize/templates/splunk-settings.json.j2 index 5c716889..30f63e26 100644 --- a/.automation/test/ansible/ghe-initialize/templates/splunk-settings.json.j2 +++ b/.automation/test/ansible/ghe-initialize/templates/splunk-settings.json.j2 @@ -1,9 +1,9 @@ { "syslog": { - "enabled": true, - "server": "{{ splunk_host }}:{{ splunk_port }}", - "protocol_name": "udp", - "tls_enabled": false, - "cert": null + "enabled": true, + "server": "{{ splunk_host }}:{{ splunk_port }}", + "protocol_name": "udp", + "tls_enabled": false, + "cert": null } } diff --git a/.automation/test/arm/arm_good_1.json b/.automation/test/arm/arm_good_1.json index df09afb7..635144fa 100644 --- a/.automation/test/arm/arm_good_1.json +++ b/.automation/test/arm/arm_good_1.json @@ -50,4 +50,4 @@ "value": "[reference(resourceId('Microsoft.Network/virtualNetworks',variables('Network.Name')), '2019-12-01', 'Full')]" } } -} \ No newline at end of file +} diff --git a/.automation/test/clojure/clojure_good_1.clj b/.automation/test/clojure/clojure_good_1.clj index 391f4688..f10b9497 100644 --- a/.automation/test/clojure/clojure_good_1.clj +++ b/.automation/test/clojure/clojure_good_1.clj @@ -1,6 +1,6 @@ (ns foo (:require - [clojure.string :as str])) + [clojure.string :as str])) (butlast [1 2 3]) @@ -11,8 +11,8 @@ (y))) (letfn - [(f [g] (h g)) - (h [i] (f i))]) + [(f [g] (h g)) + (h [i] (f i))]) (defn foo [] 1) (inc (foo)) @@ -31,4 +31,4 @@ (ns bar-test (:require [clojure.test :as t])) (t/deftest my-tests - (t/is (odd? (inc 1)))) \ No newline at end of file + (t/is (odd? (inc 1)))) diff --git a/.automation/test/cloudformation/cloudformation_good_1.json b/.automation/test/cloudformation/cloudformation_good_1.json index dc944bca..d3ff11e2 100644 --- a/.automation/test/cloudformation/cloudformation_good_1.json +++ b/.automation/test/cloudformation/cloudformation_good_1.json @@ -1,35 +1,35 @@ { - "AWSTemplateFormatVersion": "2010-09-09", - "Description": "A sample template", - "Resources": { - "DNS": { - "Type": "AWS::Route53::HostedZone", - "Properties": { - "HostedZoneConfig": { - "Comment": "Myhostedzoneforexample.com" - }, - "Name": "example.com", - "VPCs": [ - { - "VPCId": "vpc-abcd1234", - "VPCRegion": "ap-northeast-1" - }, - { - "VPCId": "vpc-efgh5678", - "VPCRegion": "us-west-2" - } - ], - "HostedZoneTags": [ - { - "Key": "SampleKey1", - "Value": "SampleValue1" - }, - { - "Key": "SampleKey2", - "Value": "SampleValue2" - } - ] - } - } - } + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "A sample template", + "Resources": { + "DNS": { + "Type": "AWS::Route53::HostedZone", + "Properties": { + "HostedZoneConfig": { + "Comment": "Myhostedzoneforexample.com" + }, + "Name": "example.com", + "VPCs": [ + { + "VPCId": "vpc-abcd1234", + "VPCRegion": "ap-northeast-1" + }, + { + "VPCId": "vpc-efgh5678", + "VPCRegion": "us-west-2" + } + ], + "HostedZoneTags": [ + { + "Key": "SampleKey1", + "Value": "SampleValue1" + }, + { + "Key": "SampleKey2", + "Value": "SampleValue2" + } + ] + } + } + } } diff --git a/.automation/test/cloudformation/cloudformation_good_3.json b/.automation/test/cloudformation/cloudformation_good_3.json index f8602d7a..e38194ce 100644 --- a/.automation/test/cloudformation/cloudformation_good_3.json +++ b/.automation/test/cloudformation/cloudformation_good_3.json @@ -1,16 +1,16 @@ { - "Resources" : { - "myDNSRecord" : { - "Type" : "AWS::Route53::RecordSet", - "Properties" : { - "HostedZoneId" : "Z8VLZEXAMPLE", - "Name" : "test.example.com", - "ResourceRecords" : [ - "192.0.2.99" - ], - "TTL" : 300, - "Type" : "A" - } - } - } + "Resources": { + "myDNSRecord": { + "Type": "AWS::Route53::RecordSet", + "Properties": { + "HostedZoneId": "Z8VLZEXAMPLE", + "Name": "test.example.com", + "ResourceRecords": [ + "192.0.2.99" + ], + "TTL": 300, + "Type": "A" + } + } + } } diff --git a/.automation/test/coffeescript/coffeescript_good_1.coffee b/.automation/test/coffeescript/coffeescript_good_1.coffee index 064f850e..388f28d7 100644 --- a/.automation/test/coffeescript/coffeescript_good_1.coffee +++ b/.automation/test/coffeescript/coffeescript_good_1.coffee @@ -62,8 +62,8 @@ module.exports = (robot) -> # Drop the hammer # ################### robot.respond /drop the hammer/i, (msg) -> - msg.send "Commencing the hammer dropping..." - msg.send msg.random dropHammer + msg.send "Commencing the hammer dropping..." + msg.send msg.random dropHammer ############### # Vape Nation # diff --git a/.automation/test/csharp/csharp_good_01.cs b/.automation/test/csharp/csharp_good_01.cs index a68542dc..b17954e5 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 + class Program + { + static void Main(string[] args) { - static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } + Console.WriteLine("Hello World!"); } + } } diff --git a/.automation/test/editorconfig-checker/.editorconfig b/.automation/test/editorconfig/.editorconfig similarity index 100% rename from .automation/test/editorconfig-checker/.editorconfig rename to .automation/test/editorconfig/.editorconfig diff --git a/.automation/test/editorconfig-checker/README.md b/.automation/test/editorconfig/README.md similarity index 82% rename from .automation/test/editorconfig-checker/README.md rename to .automation/test/editorconfig/README.md index d091c16e..8016cf91 100644 --- a/.automation/test/editorconfig-checker/README.md +++ b/.automation/test/editorconfig/README.md @@ -1,6 +1,6 @@ -# EDITORCONFIG_CHECKER Test Cases +# EDITORCONFIG Test Cases -This folder holds the test cases for **EDITORCONFIG_CHECKER**. +This folder holds the test cases for **EDITORCONFIG**. ## Additional Docs diff --git a/.automation/test/editorconfig-checker/editorconfig-checker_bad_1.ext b/.automation/test/editorconfig/editorconfig-checker_bad_1.ext similarity index 100% rename from .automation/test/editorconfig-checker/editorconfig-checker_bad_1.ext rename to .automation/test/editorconfig/editorconfig-checker_bad_1.ext diff --git a/.automation/test/editorconfig-checker/editorconfig-checker_good_1.ext b/.automation/test/editorconfig/editorconfig-checker_good_1.ext similarity index 100% rename from .automation/test/editorconfig-checker/editorconfig-checker_good_1.ext rename to .automation/test/editorconfig/editorconfig-checker_good_1.ext diff --git a/.automation/test/groovy/README.md b/.automation/test/groovy/README.md index b08a3b4f..8dc5badf 100644 --- a/.automation/test/groovy/README.md +++ b/.automation/test/groovy/README.md @@ -1,5 +1,5 @@ # Groovy Test Cases -This folder holds the test cases for **Groovy**. +This folder holds the test cases for **Groovy**. ## Additional Docs No Additional information is needed for this test case. diff --git a/.automation/test/groovy/groovy_good_01.groovy b/.automation/test/groovy/groovy_good_01.groovy index d0375dab..90941461 100644 --- a/.automation/test/groovy/groovy_good_01.groovy +++ b/.automation/test/groovy/groovy_good_01.groovy @@ -1,6 +1,6 @@ class Example { - static void main(String[] args) { - File file = new File("E:/Example.txt") - println "The file ${file.absolutePath} has ${file.length()} bytes" - } + static void main(String[] args) { + File file = new File("E:/Example.txt") + println "The file ${file.absolutePath} has ${file.length()} bytes" + } } diff --git a/.automation/test/html/html_good_01.html b/.automation/test/html/html_good_01.html index 1b10ca4e..d3a039bf 100644 --- a/.automation/test/html/html_good_01.html +++ b/.automation/test/html/html_good_01.html @@ -1,10 +1,13 @@ - - - Document - - - Good HTML! - - \ No newline at end of file + + + + Document + + + + Good HTML! + + + diff --git a/.automation/test/kotlin/kotlint_good_1.kt b/.automation/test/kotlin/kotlint_good_1.kt index 6e1f1a51..fdda8156 100644 --- a/.automation/test/kotlin/kotlint_good_1.kt +++ b/.automation/test/kotlin/kotlint_good_1.kt @@ -1,6 +1,6 @@ fun main() { - val n = "World" - val v = "Hello, $n!" + val n = "World" + val v = "Hello, $n!" - println(v) + println(v) } diff --git a/.automation/test/kotlin/reports/expected-KOTLIN.tap b/.automation/test/kotlin/reports/expected-KOTLIN.tap index 2ea1a98f..908308a6 100644 --- a/.automation/test/kotlin/reports/expected-KOTLIN.tap +++ b/.automation/test/kotlin/reports/expected-KOTLIN.tap @@ -2,6 +2,6 @@ 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 + 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 1 Unexpected indentation (4) (should be 2)\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 1 Unexpected indentation (4) (should be 2)\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 1 Unexpected indentation (4) (should be 2)\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 5 15 Unnecessary semicolon\n ... ok 2 - /tmp/lint/.automation/test/kotlin/kotlint_good_1.kt diff --git a/.automation/test/latex/README.md b/.automation/test/latex/README.md index d3369dcd..c48b1437 100644 --- a/.automation/test/latex/README.md +++ b/.automation/test/latex/README.md @@ -1,5 +1,5 @@ # LaTeX Test Cases -This folder holds the test cases for **LaTeX**. +This folder holds the test cases for **LaTeX**. ## Additional Docs No Additional information is needed for this test case. @@ -10,4 +10,4 @@ The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should ## 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/latex/latex_good_1.tex b/.automation/test/latex/latex_good_1.tex index a34c6f7a..5b7de792 100644 --- a/.automation/test/latex/latex_good_1.tex +++ b/.automation/test/latex/latex_good_1.tex @@ -115,7 +115,7 @@ Is this an `example', or is it an `example'. %Indexing text \index{text} is fun! Indexing text\index{text} is fun! Indexing text% - \index{text} is fun! + \index{text} is fun! %Indexing text % \index{text} is fun! diff --git a/.automation/test/lua/README.md b/.automation/test/lua/README.md index db695378..01aef10a 100644 --- a/.automation/test/lua/README.md +++ b/.automation/test/lua/README.md @@ -10,4 +10,4 @@ The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should ## 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/lua/lua_good_1.lua b/.automation/test/lua/lua_good_1.lua index f7ade80b..4826fc02 100644 --- a/.automation/test/lua/lua_good_1.lua +++ b/.automation/test/lua/lua_good_1.lua @@ -1,12 +1,12 @@ local embracer = {} local function helper() - -- NYI wontfix + -- NYI wontfix end function embracer.embrace(opt) - opt = opt or "default" - return helper(opt.."?") + opt = opt or "default" + return helper(opt.."?") end return embracer diff --git a/.automation/test/powershell/powershell_bad_1.ps1 b/.automation/test/powershell/powershell_bad_1.ps1 index f1709a0a..12a9f272 100644 --- a/.automation/test/powershell/powershell_bad_1.ps1 +++ b/.automation/test/powershell/powershell_bad_1.ps1 @@ -11,4 +11,3 @@ function BadFunction { 'Empty Catch Block' } catch {} } - diff --git a/.automation/test/powershell/powershell_good_1.ps1 b/.automation/test/powershell/powershell_good_1.ps1 index d762886f..b427aaed 100644 --- a/.automation/test/powershell/powershell_good_1.ps1 +++ b/.automation/test/powershell/powershell_good_1.ps1 @@ -1 +1 @@ -Write-Output "hello world!" \ No newline at end of file +Write-Output "hello world!" diff --git a/.automation/test/powershell/powershell_good_1.psd1 b/.automation/test/powershell/powershell_good_1.psd1 index 68432ff9..1768688e 100644 --- a/.automation/test/powershell/powershell_good_1.psd1 +++ b/.automation/test/powershell/powershell_good_1.psd1 @@ -1,3 +1,3 @@ @{ 'Hello'='World' -} \ No newline at end of file +} diff --git a/.automation/test/powershell/powershell_good_1.psm1 b/.automation/test/powershell/powershell_good_1.psm1 index d762886f..b427aaed 100644 --- a/.automation/test/powershell/powershell_good_1.psm1 +++ b/.automation/test/powershell/powershell_good_1.psm1 @@ -1 +1 @@ -Write-Output "hello world!" \ No newline at end of file +Write-Output "hello world!" diff --git a/.automation/test/r/README.md b/.automation/test/r/README.md index 19e0042f..12f123c1 100644 --- a/.automation/test/r/README.md +++ b/.automation/test/r/README.md @@ -1,5 +1,5 @@ # R Test Cases -This folder holds the test cases for **R**. +This folder holds the test cases for **R**. ## Additional Docs No Additional information is needed for this test case. @@ -10,4 +10,4 @@ The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should ## 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/r/r_good_1.r b/.automation/test/r/r_good_1.r index e6c5c41d..8bd91f2b 100644 --- a/.automation/test/r/r_good_1.r +++ b/.automation/test/r/r_good_1.r @@ -45,4 +45,4 @@ message("single_quotes") # trailing_whitespace y <- 2 + (1:10) -# trailing_blank_lines \ No newline at end of file +# trailing_blank_lines diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index 8f14a92c..32055086 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -17,31 +17,31 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system -DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub -DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub -GCR_USERNAME="${GCR_USERNAME}" # Username to login to GitHub package registry -GCR_TOKEN="${GCR_TOKEN}" # Password to login to GitHub package registry -REGISTRY="${REGISTRY}" # What registry to upload | or -IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image -IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image -DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded -MAJOR_TAG='' # Major tag version if we need to update it -UPDATE_MAJOR_TAG=0 # Flag to deploy the major tag version as well -GCR_URL='ghcr.io' # URL to Github Container Registry -DOCKER_IMAGE_REPO='' # Docker tag for the image when created -GCR_IMAGE_REPO='' # Docker tag for the image when created -FOUND_IMAGE=0 # Flag for if the image has already been built -CONTAINER_URL='' # Final URL to upload +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system +DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub +DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub +GCR_USERNAME="${GCR_USERNAME}" # Username to login to GitHub package registry +GCR_TOKEN="${GCR_TOKEN}" # Password to login to GitHub package registry +REGISTRY="${REGISTRY}" # What registry to upload | or +IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image +IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image +DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded +MAJOR_TAG='' # Major tag version if we need to update it +UPDATE_MAJOR_TAG=0 # Flag to deploy the major tag version as well +GCR_URL='ghcr.io' # URL to Github Container Registry +DOCKER_IMAGE_REPO='' # Docker tag for the image when created +GCR_IMAGE_REPO='' # Docker tag for the image when created +FOUND_IMAGE=0 # Flag for if the image has already been built +CONTAINER_URL='' # Final URL to upload ########################################################### # Dynamic build variables to pass to container when built # ########################################################### -BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') # Current build date EX> "2017-08-28T09:24:41Z" -BUILD_REVISION=$(git rev-parse --short HEAD) # Current git commit EX> "e89faa7" -BUILD_VERSION='' # Current version of the container being built -(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging +BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') # Current build date EX> "2017-08-28T09:24:41Z" +BUILD_REVISION=$(git rev-parse --short HEAD) # Current git commit EX> "e89faa7" +BUILD_VERSION='' # Current version of the container being built +((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ######################### @@ -329,7 +329,7 @@ BuildImage() { ######################################################## if [ ${UPDATE_MAJOR_TAG} -eq 1 ]; then # Tag the image with the major tag as well - docker build --build-arg "BUILD_DATE=${BUILD_DATE}" --build-arg "BUILD_REVISION=${BUILD_REVISION}" --build-arg "BUILD_VERSION=${MAJOR_TAG}" -t "${CONTAINER_URL}:${MAJOR_TAG}" -f "${DOCKERFILE_PATH}" . 2>&1 + docker build --build-arg "BUILD_DATE=${BUILD_DATE}" --build-arg "BUILD_REVISION=${BUILD_REVISION}" --build-arg "BUILD_VERSION=${MAJOR_TAG}" -t "${CONTAINER_URL}:${MAJOR_TAG}" -f "${DOCKERFILE_PATH}" . 2>&1 ####################### # Load the error code # @@ -515,7 +515,7 @@ FindBuiltImage() { ############## # Local vars # ############## - CHECK_IMAGE_REPO='' # Repo to look for + CHECK_IMAGE_REPO='' # Repo to look for #################################### # Set the additional container URL # diff --git a/.automation/validate-docker-labels.sh b/.automation/validate-docker-labels.sh index 100b9812..2ed0d3a9 100755 --- a/.automation/validate-docker-labels.sh +++ b/.automation/validate-docker-labels.sh @@ -7,14 +7,14 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch -BUILD_DATE="${BUILD_DATE}" # Date the container was built -BUILD_REVISION="${GITHUB_SHA}" # GitHub Sha -BUILD_VERSION="${GITHUB_SHA}" # Version of the container -ORG_REPO="github/super-linter" # Org/repo -(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging -ERROR=0 # Error count +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch +BUILD_DATE="${BUILD_DATE}" # Date the container was built +BUILD_REVISION="${GITHUB_SHA}" # GitHub Sha +BUILD_VERSION="${GITHUB_SHA}" # Version of the container +ORG_REPO="github/super-linter" # Org/repo +((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging +ERROR=0 # Error count export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ######################### @@ -39,8 +39,8 @@ ValidateLabel() { ############## # Grab input # ############## - CONTAINER_KEY="$1" # Example: org.opencontainers.image.created - CONTAINER_VALUE="$2" # Example: 1985-04-12T23:20:50.52Z + CONTAINER_KEY="$1" # Example: org.opencontainers.image.created + CONTAINER_VALUE="$2" # Example: 1985-04-12T23:20:50.52Z ######################## # Get the docker label # diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ac0ac8e1..f6e6a287 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,12 @@ { - "name": "SUPER-LINTER", - "context": "..", - "dockerFile": "..//Dockerfile", - "settings": { - "terminal.integrated.shell.linux": "/bin/bash" - }, - "extensions": [ - "github.vscode-pull-request-github", - "rogalmic.bash-debug" - ] + "name": "SUPER-LINTER", + "context": "..", + "dockerFile": "..//Dockerfile", + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + "extensions": [ + "github.vscode-pull-request-github", + "rogalmic.bash-debug" + ] } diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..abf24629 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,30 @@ +# EditorConfig is awesome: http://EditorConfig.org +# top-most EditorConfig file +root = true + +# Unix-style newlines at the bottom of every file +[*] +end_of_line = lf +charset = utf-8 + +# Tab indentation +indent_style = space +indent_size = 2 + +# Make sure every file has a blank line at the end +insert_final_newline = true + +# Remove any whitespace characters preceding newline characters +trim_trailing_whitespace = true + +# Give operators breathing room, but not brackets +spaces_around_operators = true +spaces_around_brackets = false + +# Max line length (not supported by all editors) +# Enable this option by un-commenting the following line +# max_line_length = 150 + +[{Makefile,go.mod,go.sum,*.go,.gitmodules}] +indent_style = tab +indent_size = 4 diff --git a/.gitattributes b/.gitattributes index 5dc46e6b..314766e9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ * text=auto eol=lf *.{cmd,[cC][mM][dD]} text eol=crlf -*.{bat,[bB][aA][tT]} text eol=crlf \ No newline at end of file +*.{bat,[bB][aA][tT]} text eol=crlf diff --git a/.github/ISSUE_TEMPLATE/ENHANCEMENT-REQUEST.md b/.github/ISSUE_TEMPLATE/ENHANCEMENT-REQUEST.md index 039816f9..74cec1fe 100644 --- a/.github/ISSUE_TEMPLATE/ENHANCEMENT-REQUEST.md +++ b/.github/ISSUE_TEMPLATE/ENHANCEMENT-REQUEST.md @@ -14,18 +14,18 @@ about: Used for requesting enhancements to the GitHub Super-Linter **Your impression of priority / how important this request is** - - [ ] Critical: Can't use the tool without it. - - [ ] Business Critical: Immediate opportunity to win business with this feature - - [ ] Important: Will significantly enhance the overall utility of the demo - - [ ] Nice to have: self-explanatory +- [ ] Critical: Can't use the tool without it. +- [ ] Business Critical: Immediate opportunity to win business with this feature +- [ ] Important: Will significantly enhance the overall utility of the demo +- [ ] Nice to have: self-explanatory **Business case or other information justifying priority** **Agreed upon priority** - - [ ] Critical: Can't use the tool without it. - - [ ] Business Critical: Immediate opportunity to win business with this feature - - [ ] Important: Will significantly enhance the overall utility of the demo - - [ ] Nice to have: self-explanatory +- [ ] Critical: Can't use the tool without it. +- [ ] Business Critical: Immediate opportunity to win business with this feature +- [ ] Important: Will significantly enhance the overall utility of the demo +- [ ] Nice to have: self-explanatory **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc) diff --git a/.github/linters/.cfnlintrc.yml b/.github/linters/.cfnlintrc.yml index 545080a4..16e8c976 100644 --- a/.github/linters/.cfnlintrc.yml +++ b/.github/linters/.cfnlintrc.yml @@ -1,2 +1,2 @@ include_checks: -- I + - I diff --git a/.github/linters/.chktexrc b/.github/linters/.chktexrc index 98750c47..c2a96fb1 100644 --- a/.github/linters/.chktexrc +++ b/.github/linters/.chktexrc @@ -175,7 +175,7 @@ TabSize = 8 CmdLine { - -v2 + -v2 } ##################################################################### @@ -756,9 +756,9 @@ MathRoman Primitives { - \above \advance \catcode \chardef \closein \closeout \copy \count - \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide - \expandafter \font \hskip \vskip \openout + \above \advance \catcode \chardef \closein \closeout \copy \count + \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide + \expandafter \font \hskip \vskip \openout } ##################################################################### @@ -771,7 +771,7 @@ Primitives NoCharNext { - \left:{}$ \right:{}$ + \left:{}$ \right:{}$ } ##################################################################### diff --git a/.github/linters/.clj-kondo/config.edn b/.github/linters/.clj-kondo/config.edn index 30cae4c6..8a2999a1 100644 --- a/.github/linters/.clj-kondo/config.edn +++ b/.github/linters/.clj-kondo/config.edn @@ -1,2 +1,7 @@ -{:linters {:unresolved-symbol {:exclude [(compojure.api.sweet/defroutes)]} - :refer-all {:exclude [clj-time.jdbc]}}} +{:linters + {:unresolved-symbol + {:exclude [(compojure.api.sweet/defroutes)]} + :refer-all + {:exclude [clj-time.jdbc]} + } +} diff --git a/.github/linters/.htmlhintrc b/.github/linters/.htmlhintrc index 7fc24f8d..5daf1dd9 100644 --- a/.github/linters/.htmlhintrc +++ b/.github/linters/.htmlhintrc @@ -22,4 +22,4 @@ "href-abs-or-rel": false, "attr-unsafe-chars": true, "head-script-disabled": true -} \ No newline at end of file +} diff --git a/.github/linters/.perlcriticrc b/.github/linters/.perlcriticrc index ad6196a3..eb920334 100644 --- a/.github/linters/.perlcriticrc +++ b/.github/linters/.perlcriticrc @@ -1,2 +1,2 @@ severity = 1 -verbose = %f:%l:%c [%s %p] %m near '%r'\n \ No newline at end of file +verbose = %f:%l:%c [%s %p] %m near '%r'\n diff --git a/.github/linters/.python-lint b/.github/linters/.python-lint index e3d9f5b5..ae374f57 100644 --- a/.github/linters/.python-lint +++ b/.github/linters/.python-lint @@ -323,11 +323,11 @@ function-naming-style=snake_case # Good variable names which should always be accepted, separated by a comma good-names=i, - j, - k, - ex, - Run, - _ + j, + k, + ex, + Run, + _ # Include a hint for the correct naming format with invalid-name include-naming-hint=no @@ -418,8 +418,7 @@ max-module-lines=1000 # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. # `trailing-comma` allows a space between comma and closing bracket: (a, ). # `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator +no-space-check=trailing-comma,dict-separator # Allow the body of a class to be on the same line as the declaration if body # contains single statement. @@ -490,9 +489,9 @@ analyse-fallback-blocks=no # Deprecated modules which should not be used, separated by a comma deprecated-modules=regsub, - TERMIOS, - Bastion, - rexec + TERMIOS, + Bastion, + rexec # Create a graph of external dependencies in the given file (report RP0402 must # not be disabled) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 5cf492db..b012a4f3 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -3,9 +3,9 @@ tag-template: 'v$RESOLVED_VERSION' template: | # Changelog $CHANGES - - See details of [all code changes](https://github.com/github/super-linter/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous 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' labels: diff --git a/.vscode/launch.json b/.vscode/launch.json index 77e1ced2..4e554e66 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -13,4 +13,4 @@ } } ] -} \ No newline at end of file +} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index bda24167..6c96647a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -23,13 +23,13 @@ include: Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or - advances + advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic - address, without explicit permission + address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a - professional setting + professional setting ## Our Responsibilities diff --git a/TEMPLATES/.chktexrc b/TEMPLATES/.chktexrc index 98750c47..c2a96fb1 100644 --- a/TEMPLATES/.chktexrc +++ b/TEMPLATES/.chktexrc @@ -175,7 +175,7 @@ TabSize = 8 CmdLine { - -v2 + -v2 } ##################################################################### @@ -756,9 +756,9 @@ MathRoman Primitives { - \above \advance \catcode \chardef \closein \closeout \copy \count - \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide - \expandafter \font \hskip \vskip \openout + \above \advance \catcode \chardef \closein \closeout \copy \count + \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide + \expandafter \font \hskip \vskip \openout } ##################################################################### @@ -771,7 +771,7 @@ Primitives NoCharNext { - \left:{}$ \right:{}$ + \left:{}$ \right:{}$ } ##################################################################### diff --git a/TEMPLATES/.clj-kondo/config.edn b/TEMPLATES/.clj-kondo/config.edn index 30cae4c6..8a2999a1 100644 --- a/TEMPLATES/.clj-kondo/config.edn +++ b/TEMPLATES/.clj-kondo/config.edn @@ -1,2 +1,7 @@ -{:linters {:unresolved-symbol {:exclude [(compojure.api.sweet/defroutes)]} - :refer-all {:exclude [clj-time.jdbc]}}} +{:linters + {:unresolved-symbol + {:exclude [(compojure.api.sweet/defroutes)]} + :refer-all + {:exclude [clj-time.jdbc]} + } +} diff --git a/TEMPLATES/.htmlhintrc b/TEMPLATES/.htmlhintrc index 7fc24f8d..5daf1dd9 100644 --- a/TEMPLATES/.htmlhintrc +++ b/TEMPLATES/.htmlhintrc @@ -22,4 +22,4 @@ "href-abs-or-rel": false, "attr-unsafe-chars": true, "head-script-disabled": true -} \ No newline at end of file +} diff --git a/TEMPLATES/.perlcriticrc b/TEMPLATES/.perlcriticrc index ad6196a3..eb920334 100644 --- a/TEMPLATES/.perlcriticrc +++ b/TEMPLATES/.perlcriticrc @@ -1,2 +1,2 @@ severity = 1 -verbose = %f:%l:%c [%s %p] %m near '%r'\n \ No newline at end of file +verbose = %f:%l:%c [%s %p] %m near '%r'\n diff --git a/TEMPLATES/.python-lint b/TEMPLATES/.python-lint index 19cc7082..ecb84b71 100644 --- a/TEMPLATES/.python-lint +++ b/TEMPLATES/.python-lint @@ -324,11 +324,11 @@ function-naming-style=snake_case # Good variable names which should always be accepted, separated by a comma good-names=i, - j, - k, - ex, - Run, - _ + j, + k, + ex, + Run, + _ # Include a hint for the correct naming format with invalid-name include-naming-hint=no @@ -419,8 +419,7 @@ max-module-lines=1000 # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. # `trailing-comma` allows a space between comma and closing bracket: (a, ). # `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator +no-space-check=trailing-comma,dict-separator # Allow the body of a class to be on the same line as the declaration if body # contains single statement. @@ -491,9 +490,9 @@ analyse-fallback-blocks=no # Deprecated modules which should not be used, separated by a comma deprecated-modules=regsub, - TERMIOS, - Bastion, - rexec + TERMIOS, + Bastion, + rexec # Create a graph of external dependencies in the given file (report RP0402 must # not be disabled) diff --git a/TEMPLATES/phpstan.neon b/TEMPLATES/phpstan.neon index 069eb1c9..a2b3ad88 100644 --- a/TEMPLATES/phpstan.neon +++ b/TEMPLATES/phpstan.neon @@ -1,2 +1,2 @@ parameters: - level: 5 + level: 5 diff --git a/action.yml b/action.yml index e74b75cc..14644e81 100644 --- a/action.yml +++ b/action.yml @@ -5,5 +5,5 @@ runs: using: 'docker' image: 'docker://ghcr.io/github/super-linter:v3' branding: - icon: 'check-square' + icon: 'check-square' color: 'white' diff --git a/dependencies/Gemfile.lock b/dependencies/Gemfile.lock index 076e8a5e..0638d874 100644 --- a/dependencies/Gemfile.lock +++ b/dependencies/Gemfile.lock @@ -57,4 +57,4 @@ DEPENDENCIES rubocop-rspec (~> 1.41.0) BUNDLED WITH - 2.1.4 + 2.1.4 diff --git a/docs/using-rules-files.md b/docs/using-rules-files.md index 9c1fe052..2eafbe19 100644 --- a/docs/using-rules-files.md +++ b/docs/using-rules-files.md @@ -6,7 +6,7 @@ You can tell Super-Linter where your rules files are located with the ``LINTER_R ## Here is an example -Below is an example of how to configure the ``env`` section of Super-Linter's ``linter.yml`` to lint JavaScript and CSS code using ``eslint`` and ``stylelint`` with your own ``.eslintrc.json`` and ``.stylelintrc.json`` rules files that are located in the root directory of your repository. +Below is an example of how to configure the ``env`` section of Super-Linter's ``linter.yml`` to lint JavaScript and CSS code using ``eslint`` and ``stylelint`` with your own ``.eslintrc.json`` and ``.stylelintrc.json`` rules files that are located in the root directory of your repository. ``` yaml env: diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index 8434926a..50d65700 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -85,7 +85,7 @@ function BuildFileList() { else WORKSPACE_PATH="${GITHUB_WORKSPACE}" if [ "${TEST_CASE_RUN}" == "true" ]; then - WORKSPACE_PATH="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}" + WORKSPACE_PATH="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}" fi ################ @@ -94,12 +94,12 @@ function BuildFileList() { debug "----------------------------------------------" debug "Populating the file list with all the files in the ${WORKSPACE_PATH} workspace" mapfile -t RAW_FILE_ARRAY < <(find "${WORKSPACE_PATH}" \ - -not \( -path '*/\.git' -prune \) \ - -not \( -path '*/\.rbenv' -prune \) \ - -not \( -path '*/\.terragrunt-cache' -prune \) \ - -not \( -path '*/\.venv' -prune \) \ - -type f \ - 2>&1 | sort) + -not \( -path '*/\.git' -prune \) \ + -not \( -path '*/\.rbenv' -prune \) \ + -not \( -path '*/\.terragrunt-cache' -prune \) \ + -not \( -path '*/\.venv' -prune \) \ + -type f \ + 2>&1 | sort) debug "RAW_FILE_ARRAY contents: ${RAW_FILE_ARRAY[*]}" fi @@ -401,12 +401,12 @@ function BuildFileList() { # Get the Powershell files # ############################ elif [ "${FILE_TYPE}" == "ps1" ] || - [ "${FILE_TYPE}" == "psm1" ] || - [ "${FILE_TYPE}" == "psd1" ] || - [ "${FILE_TYPE}" == "ps1xml" ] || - [ "${FILE_TYPE}" == "pssc" ] || - [ "${FILE_TYPE}" == "psrc" ] || - [ "${FILE_TYPE}" == "cdxml" ]; then + [ "${FILE_TYPE}" == "psm1" ] || + [ "${FILE_TYPE}" == "psd1" ] || + [ "${FILE_TYPE}" == "ps1xml" ] || + [ "${FILE_TYPE}" == "pssc" ] || + [ "${FILE_TYPE}" == "psrc" ] || + [ "${FILE_TYPE}" == "cdxml" ]; then ################################ # Append the file to the array # ################################ @@ -703,8 +703,8 @@ function IsValidShellScript() { [ "${FILE_EXTENSION}" == "bash" ] || [ "${FILE_EXTENSION}" == "dash" ] || [ "${FILE_EXTENSION}" == "ksh" ]; then - debug "$FILE is a valid shell script (has a valid extension: ${FILE_EXTENSION})" - return 0 + debug "$FILE is a valid shell script (has a valid extension: ${FILE_EXTENSION})" + return 0 fi if [[ "${GET_FILE_TYPE_CMD}" == *"POSIX shell script"* ]] || @@ -712,8 +712,8 @@ function IsValidShellScript() { [[ ${GET_FILE_TYPE_CMD} == *"dash script"* ]] || [[ ${GET_FILE_TYPE_CMD} == *"ksh script"* ]] || [[ ${GET_FILE_TYPE_CMD} == *"/usr/bin/env sh script"* ]]; then - debug "$FILE is a valid shell script (has a valid file type: ${GET_FILE_TYPE_CMD})" - return 0 + debug "$FILE is a valid shell script (has a valid file type: ${GET_FILE_TYPE_CMD})" + return 0 fi trace "$FILE is NOT a supported shell script. Skipping" diff --git a/lib/linter.sh b/lib/linter.sh index a11a79e8..8dcb4983 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -17,8 +17,8 @@ ACTIONS_RUNNER_DEBUG="${ACTIONS_RUNNER_DEBUG:-false}" # Boolean to see even more # Log Vars # # Define these early, so we can use debug logging ASAP if needed # ################################################################## -LOG_FILE="${LOG_FILE:-super-linter.log}" # Default log file name (located in GITHUB_WORKSPACE folder) -LOG_LEVEL="${LOG_LEVEL:-VERBOSE}" # Default log level (VERBOSE, DEBUG, TRACE) +LOG_FILE="${LOG_FILE:-super-linter.log}" # Default log file name (located in GITHUB_WORKSPACE folder) +LOG_LEVEL="${LOG_LEVEL:-VERBOSE}" # Default log level (VERBOSE, DEBUG, TRACE) if [[ ${ACTIONS_RUNNER_DEBUG} == true ]]; then LOG_LEVEL="DEBUG"; fi # Boolean to see trace logs @@ -56,10 +56,10 @@ source /action/lib/worker.sh # Source the function script(s) # GLOBALS # ########### # Default Vars -DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location +DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory -GITHUB_API_URL='https://api.github.com' # GitHub API root url -VERSION_FILE='/action/lib/linter-versions.txt' # File to store linter versions +GITHUB_API_URL='https://api.github.com' # GitHub API root url +VERSION_FILE='/action/lib/linter-versions.txt' # File to store linter versions ############### # Rules files # @@ -219,20 +219,20 @@ LINTED_LANGUAGES_ARRAY=() # Will be filled at run time with all languages that w ################### # GitHub ENV Vars # ################### -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 -FILTER_REGEX_INCLUDE="${FILTER_REGEX_INCLUDE}" # RegExp defining which files will be processed by linters (all by default) -FILTER_REGEX_EXCLUDE="${FILTER_REGEX_EXCLUDE}" # RegExp defining which files will be excluded from linting (none by default) -GITHUB_EVENT_PATH="${GITHUB_EVENT_PATH}" # Github Event Path -GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system -GITHUB_RUN_ID="${GITHUB_RUN_ID}" # GitHub RUn ID to point to logs -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 -TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases -VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files +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 +FILTER_REGEX_INCLUDE="${FILTER_REGEX_INCLUDE}" # RegExp defining which files will be processed by linters (all by default) +FILTER_REGEX_EXCLUDE="${FILTER_REGEX_EXCLUDE}" # RegExp defining which files will be excluded from linting (none by default) +GITHUB_EVENT_PATH="${GITHUB_EVENT_PATH}" # Github Event Path +GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system +GITHUB_RUN_ID="${GITHUB_RUN_ID}" # GitHub RUn ID to point to logs +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 +TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases +VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files ################ # Default Vars # @@ -245,23 +245,23 @@ DEFAULT_TEST_CASE_RUN='false' # Flag to tell code to run o ############################################################### # Default Vars that are called in Subs and need to be ignored # ############################################################### -DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors -export DEFAULT_DISABLE_ERRORS # Workaround SC2034 +DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors +export DEFAULT_DISABLE_ERRORS # Workaround SC2034 ERROR_ON_MISSING_EXEC_BIT="${ERROR_ON_MISSING_EXEC_BIT:-false}" # Default to report a warning if a shell script doesn't have the executable bit set to 1 export ERROR_ON_MISSING_EXEC_BIT -RAW_FILE_ARRAY=() # Array of all files that were changed -export RAW_FILE_ARRAY # Workaround SC2034 -TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore -export TEST_CASE_FOLDER # Workaround SC2034 -WARNING_ARRAY_TEST=() # Array of warning linters that did not have an expected test result. -export WARNING_ARRAY_TEST # Workaround SC2034 +RAW_FILE_ARRAY=() # Array of all files that were changed +export RAW_FILE_ARRAY # Workaround SC2034 +TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore +export TEST_CASE_FOLDER # Workaround SC2034 +WARNING_ARRAY_TEST=() # Array of warning linters that did not have an expected test result. +export WARNING_ARRAY_TEST # Workaround SC2034 ############## # 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 -OUTPUT_DETAILS="${OUTPUT_DETAILS:-simpler}" # What level of details. (simpler or detailed). Default simpler +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 ########################## # Array of changed files # @@ -279,7 +279,7 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do LINTER_NAME="${LINTER_NAMES_ARRAY["${LANGUAGE}"]}" debug "Checking if linter with name ${LINTER_NAME} for the ${LANGUAGE} language is available..." - if ! command -v "${LINTER_NAME}" 1&>/dev/null 2>&1; then + if ! command -v "${LINTER_NAME}" 1 &>/dev/null 2>&1; then # Failed fatal "Failed to find [${LINTER_NAME}] in system!" else @@ -288,8 +288,6 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do fi done - - ################################################################################ ########################## FUNCTIONS BELOW ##################################### ################################################################################ @@ -1189,9 +1187,9 @@ GetGitHubVars ######################################################## # Initialize variables that depend on GitHub variables # ######################################################## -DEFAULT_ANSIBLE_DIRECTORY="${GITHUB_WORKSPACE}/ansible" # Default Ansible Directory -export DEFAULT_ANSIBLE_DIRECTORY # Workaround SC2034 -REPORT_OUTPUT_FOLDER="${GITHUB_WORKSPACE}/${OUTPUT_FOLDER}" # Location for the report folder +DEFAULT_ANSIBLE_DIRECTORY="${GITHUB_WORKSPACE}/ansible" # Default Ansible Directory +export DEFAULT_ANSIBLE_DIRECTORY # Workaround SC2034 +REPORT_OUTPUT_FOLDER="${GITHUB_WORKSPACE}/${OUTPUT_FOLDER}" # Location for the report folder ############################ # Validate the environment # @@ -1271,7 +1269,6 @@ LINTER_COMMANDS_ARRAY['TYPESCRIPT_STANDARD']="standard --parser @typescript-esli LINTER_COMMANDS_ARRAY['XML']="xmllint" LINTER_COMMANDS_ARRAY['YAML']="yamllint -c ${YAML_LINTER_RULES}" - debug "--- Linter commands ---" debug "-----------------------" for i in "${!LINTER_COMMANDS_ARRAY[@]}"; do @@ -1317,8 +1314,8 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do continue fi elif [ "${LANGUAGE}" = "R" ] && [ ! -f "${GITHUB_WORKSPACE}/.lintr" ] && ((${#FILE_ARRAY_R[@]})); then - info "No .lintr configuration file found, using defaults." - cp "$R_LINTER_RULES" "$GITHUB_WORKSPACE" + info "No .lintr configuration file found, using defaults." + cp "$R_LINTER_RULES" "$GITHUB_WORKSPACE" # Check if there's local configuration for the Raku linter elif [ "${LANGUAGE}" = "RAKU" ] && [ -e "${GITHUB_WORKSPACE}/META6.json" ]; then cd "${GITHUB_WORKSPACE}" && zef install --deps-only --/test . @@ -1331,14 +1328,14 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do LintAnsibleFiles "${ANSIBLE_LINTER_RULES}" # Passing rules but not needed, dont want to exclude unused var else LINTER_NAME="${LINTER_NAMES_ARRAY["${LANGUAGE}"]}" - if [ -z "${LINTER_NAME}" ];then + if [ -z "${LINTER_NAME}" ]; then fatal "Cannot find the linter name for ${LANGUAGE} language." else debug "Setting LINTER_NAME to ${LINTER_NAME}..." fi LINTER_COMMAND="${LINTER_COMMANDS_ARRAY["${LANGUAGE}"]}" - if [ -z "${LINTER_COMMAND}" ];then + if [ -z "${LINTER_COMMAND}" ]; then fatal "Cannot find the linter command for ${LANGUAGE} language." else debug "Setting LINTER_COMMAND to ${LINTER_COMMAND}..." diff --git a/lib/linterVersions.sh b/lib/linterVersions.sh index a9d2eddd..34708a99 100755 --- a/lib/linterVersions.sh +++ b/lib/linterVersions.sh @@ -74,7 +74,7 @@ WriteFile() { ################################# # Write the data to output file # ################################# - echo "${LINTER}: ${VERSION}" >> "${VERSION_FILE}" 2>&1 + echo "${LINTER}: ${VERSION}" >>"${VERSION_FILE}" 2>&1 ####################### # Load the error code # diff --git a/lib/log.sh b/lib/log.sh index cf8be6c9..8f95de0f 100644 --- a/lib/log.sh +++ b/lib/log.sh @@ -29,7 +29,7 @@ export NC # Log Functions LOG_TEMP=$(mktemp) || echo "Failed to create temporary log file." export LOG_TEMP -echo "super-linter Log" > "${LOG_TEMP}" +echo "super-linter Log" >"${LOG_TEMP}" log() { local TOTERM=${1:-} local MESSAGE=${2:-} @@ -37,7 +37,7 @@ log() { if [[ -n ${TOTERM} ]]; then tee -a "${LOG_TEMP}" >&2 else - cat >> "${LOG_TEMP}" 2>&1 + cat >>"${LOG_TEMP}" 2>&1 fi ) } diff --git a/lib/possum.sh b/lib/possum.sh index 92944cdd..7f238f75 100755 --- a/lib/possum.sh +++ b/lib/possum.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -cat << EOF + +# editorconfig-checker-disable +cat <