diff --git a/.automation/test/shell/shell_good_1.sh b/.automation/test/shell/shell_good_1.sh old mode 100644 new mode 100755 diff --git a/.automation/test/terraform/good/terraform_good_1.tf b/.automation/test/terraform/good/terraform_good_1.tf index 59d24f7e..330a28bf 100644 --- a/.automation/test/terraform/good/terraform_good_1.tf +++ b/.automation/test/terraform/good/terraform_good_1.tf @@ -3,6 +3,8 @@ resource "aws_instance" "good" { instance_type = "t2.small" associate_public_ip_address = false + vpc_security_group_ids = ["sg-12345678901234567"] + ebs_block_device { encrypted = true } diff --git a/.automation/test/terraform_terrascan/bad/terraform_bad_1.tf b/.automation/test/terraform_terrascan/bad/terraform_bad_1.tf index 57b891dc..2b2788b1 100644 --- a/.automation/test/terraform_terrascan/bad/terraform_bad_1.tf +++ b/.automation/test/terraform_terrascan/bad/terraform_bad_1.tf @@ -1,9 +1,8 @@ -resource "aws_instance" "bad" { - ami = "ami-0ff8a91507f77f867" - instance_type = "t2.small" - associate_public_ip_address = true +resource "aws_instance" "instanceWithNoVpc" { + ami = "some-id" + instance_type = "t2.micro" - ebs_block_device { - encrypted = true + tags = { + Name = "HelloWorld" } } diff --git a/.automation/test/terraform_terrascan/good/terraform_good_1.tf b/.automation/test/terraform_terrascan/good/terraform_good_1.tf index 59d24f7e..7d4e8853 100644 --- a/.automation/test/terraform_terrascan/good/terraform_good_1.tf +++ b/.automation/test/terraform_terrascan/good/terraform_good_1.tf @@ -1,9 +1,11 @@ -resource "aws_instance" "good" { - ami = "ami-0ff8a91507f77f867" - instance_type = "t2.small" - associate_public_ip_address = false +resource "aws_instance" "instanceWithVpc" { + ami = "some-id" + instance_type = "t2.micro" - ebs_block_device { - encrypted = true + vpc_security_group_ids = ["sg-12345678901234567"] + subnet_id = "subnet-12345678901234567" + + tags = { + Name = "HelloWorld" } } diff --git a/Dockerfile b/Dockerfile index 535289aa..6dee160a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ FROM golangci/golangci-lint:v1.30.0 as golangci-lint FROM yoheimuta/protolint:v0.26.0 as protolint FROM koalaman/shellcheck:v0.7.1 as shellcheck FROM wata727/tflint:0.19.1 as tflint +FROM accurics/terrascan:latest as terrascan FROM hadolint/hadolint:latest-alpine as dockerfile-lint FROM assignuser/lintr-lib:v0.1.0 as lintr-lib FROM assignuser/chktex-alpine:v0.1.0 as chktex @@ -57,6 +58,7 @@ RUN apk add --update --no-cache \ bash \ coreutils \ curl \ + file \ gcc \ git git-lfs\ go \ @@ -177,6 +179,13 @@ COPY --from=golangci-lint /usr/bin/golangci-lint /usr/bin/ ################## COPY --from=tflint /usr/local/bin/tflint /usr/bin/ +################## +# Install Terrascan # +################## +COPY --from=terrascan /go/bin/terrascan /usr/bin/ +RUN terrascan init + + ###################### # Install protolint # ###################### @@ -219,6 +228,12 @@ 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/ +################################ +# Create and install Bash-Exec # +################################ +RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' > /usr/bin/bash-exec \ + && chmod +x /usr/bin/bash-exec + ################################################# # Install Raku and additional Edge dependencies # ################################################# @@ -293,6 +308,7 @@ ENV ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ VALIDATE_ANSIBLE=${VALIDATE_ANSIBLE} \ VALIDATE_ARM=${VALIDATE_ARM} \ VALIDATE_BASH=${VALIDATE_BASH} \ + VALIDATE_BASH_EXEC=${VALIDATE_BASH_EXEC} \ VALIDATE_CLOJURE=${VALIDATE_CLOJURE} \ VALIDATE_CLOUDFORMATION=${VALIDATE_CLOUDFORMATION} \ VALIDATE_COFFEE=${VALIDATE_COFFEE} \ diff --git a/README.md b/README.md index 42fd8e61..6a4a9bba 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base | **R** | [lintr](https://github.com/jimhester/lintr) | | **Raku** | [Raku](https://raku.org) | | **Ruby** | [RuboCop](https://github.com/rubocop-hq/rubocop) | -| **Shell** | [Shellcheck](https://github.com/koalaman/shellcheck) | +| **Shell** | [Shellcheck](https://github.com/koalaman/shellcheck) / [Bash-exec] | | **SQL** | [sql-lint](https://github.com/joereynolds/sql-lint) | | **Terraform** | [tflint](https://github.com/terraform-linters/tflint) / [terrascan](https://github.com/accurics/terrascan) | | **TypeScript** | [eslint](https://eslint.org/) / [standard js](https://standardjs.com/) | @@ -197,6 +197,7 @@ But if you wish to select or exclude specific linters, we give you full control | **VALIDATE_ANSIBLE** | `true` | Flag to enable or disable the linting process of the Ansible language. | | **VALIDATE_ARM** | `true` | Flag to enable or disable the linting process of the ARM language. | | **VALIDATE_BASH** | `true` | Flag to enable or disable the linting process of the Bash language. | +| **VALIDATE_BASH_EXEC** | `true` | Flag to enable or disable the linting process of the Bash language to validate if file is stored as executable. | | **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 . | @@ -238,7 +239,7 @@ But if you wish to select or exclude specific linters, we give you full control | **VALIDATE_STATES** | `true` | Flag to enable or disable the linting process for AWS States Language. | | **VALIDATE_SQL** | `true` | Flag to enable or disable the linting process of the SQL language. | | **VALIDATE_TERRAFORM** | `true` | Flag to enable or disable the linting process of the Terraform language. | -| **VALIDATE_TERRAFORM_TERRASCAN** | `false` | Flag to enable or disable the linting process of the Terraform language for security related issues. | +| **VALIDATE_TERRAFORM_TERRASCAN** | `true` | Flag to enable or disable the linting process of the Terraform language for security related issues. | | **VALIDATE_TSX** | `true` | Flag to enable or disable the linting process for tsx files (Utilizing: eslint) | | **VALIDATE_TYPESCRIPT_ES** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: eslint) | | **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: standard) | diff --git a/dependencies/Pipfile b/dependencies/Pipfile index ffe213f6..a935ed23 100644 --- a/dependencies/Pipfile +++ b/dependencies/Pipfile @@ -10,7 +10,6 @@ black = "*" cfn-lint = "*" flake8 = "*" pylint = "*" -terrascan = "*" yamllint = "*" yq = "*" diff --git a/dependencies/Pipfile.lock b/dependencies/Pipfile.lock index f018ef5f..c18d862b 100644 --- a/dependencies/Pipfile.lock +++ b/dependencies/Pipfile.lock @@ -54,25 +54,25 @@ }, "black": { "hashes": [ - "sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b", - "sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539" + "sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea", + "sha256:70b62ef1527c950db59062cda342ea224d772abdf6adc58b86a45421bab20a6b" ], "index": "pypi", - "version": "==19.10b0" + "version": "==20.8b1" }, "boto3": { "hashes": [ - "sha256:0d9cbeb5c8ca67650cc963c77e2e3b3ab5dffeeee16e03d61d740755f8fc7c44", - "sha256:df73edf3bd6f191870212e04ae9a8bc6245fd6749f464e9fb950392a8d15bd8c" + "sha256:8a7aa1da29b7c8039f81798bd27465f29494629c40280a70c2ef0daed5bb7682", + "sha256:a2bf58d375ad1b918e6007a46e415721b51dd7bb23703332cc64afa1470b056d" ], - "version": "==1.14.47" + "version": "==1.14.49" }, "botocore": { "hashes": [ - "sha256:42b320b449df22cdb1232913e4a066919d127feb8e58ad98898831e6255ccfe0", - "sha256:eca25f01c503c2b86b394497f875a0eb0d3fe367dbc032f3a02851ba7e827109" + "sha256:4433510d12dc783dd068f39ada942008f5792eea0c569f6b357bb751640c6ab4", + "sha256:87326c2d3b68c49a56f2d9237aa47a0476bb9ec6c6bc50d04df8bba66991930c" ], - "version": "==1.17.47" + "version": "==1.17.49" }, "cfn-lint": { "hashes": [ @@ -187,6 +187,13 @@ ], "version": "==0.6.1" }, + "mypy-extensions": { + "hashes": [ + "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d", + "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8" + ], + "version": "==0.4.3" + }, "networkx": { "hashes": [ "sha256:7978955423fbc9639c10498878be59caf99b44dc304c2286162fd24b458c1602", @@ -300,14 +307,6 @@ ], "version": "==1.15.0" }, - "terrascan": { - "hashes": [ - "sha256:2003638e2e38feba9215df3add2ee99565731b86dbd5c43fd8982b1a4ddac927", - "sha256:b44d8c7eac96aa8094865061783ab0e8e849690b8187b75778caf5dd34002d18" - ], - "index": "pypi", - "version": "==0.2.3" - }, "toml": { "hashes": [ "sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f", @@ -341,6 +340,14 @@ ], "version": "==1.4.1" }, + "typing-extensions": { + "hashes": [ + "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918", + "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c", + "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f" + ], + "version": "==3.7.4.3" + }, "urllib3": { "hashes": [ "sha256:91056c15fa70756691db97756772bb1eb9678fa585d9184f24534b100dc60f4a", diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index eef63597..cccea4fd 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -236,14 +236,6 @@ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz", "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==" }, - "@babel/runtime": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.5.tgz", - "integrity": "sha512-otddXKhdNn7d0ptoFRHtMLa8LqDxLYwTjB4nYgM1yy5N6gU/MUf8zqyyLltCH3yAVitBzmwK4us+DD0l/MauAg==", - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, "@babel/template": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", @@ -330,87 +322,120 @@ "fastq": "^1.6.0" } }, - "@stoplight/json": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@stoplight/json/-/json-3.6.0.tgz", - "integrity": "sha512-6hJN735r+aPzHP28HnBj30uC+RGyf/ZWEtAMlrXI4DntzocWvhgDqxLuLgOlmXkMd/4OAlD7fJQ/cI2RXNuWvQ==", + "@stoplight/better-ajv-errors": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@stoplight/better-ajv-errors/-/better-ajv-errors-0.0.0.tgz", + "integrity": "sha512-jA1i4J5HmCXMmZdZigdeEHpisFCGVg5QfK++ouxP58pxshATJ5G40U9uGec2vYnuR2MQnzWHAXYf0f8jvJhBwg==", "requires": { - "@stoplight/types": "^11.4.0", - "jsonc-parser": "~2.2.0", + "jsonpointer": "^4.0.1", + "leven": "^3.1.0" + } + }, + "@stoplight/json": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@stoplight/json/-/json-3.9.0.tgz", + "integrity": "sha512-jgEKIPMLbhaU5Nw9yw+VBw2OSfDxm8VQ/k5JNezAuDMjcmqCPz3rOQTVNOROStzi70l4DRxF7eBN9liYJq5Ojw==", + "requires": { + "@stoplight/ordered-object-literal": "^1.0.1", + "@stoplight/types": "^11.9.0", + "jsonc-parser": "~2.2.1", "lodash": "^4.17.15", "safe-stable-stringify": "^1.1" } }, "@stoplight/json-ref-readers": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@stoplight/json-ref-readers/-/json-ref-readers-1.1.1.tgz", - "integrity": "sha512-yE6SpGaBlj+QM4ony1+ST1Unz4TimZglU1lSJOlyCrVrAC1VoFpoJ1exMnU8Cg/++YzmBN9qBa4jk9s0CBnrTA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@stoplight/json-ref-readers/-/json-ref-readers-1.2.1.tgz", + "integrity": "sha512-fbh8sXRrwfOCx4EA2e6FGUwvu5zxCQ9xHZg3vYDFSb1HLTlrCeRTdx3VCmYjCSGAhpcwgpB4zMc8kiudujo8Yg==", "requires": { "node-fetch": "^2.6.0" } }, "@stoplight/json-ref-resolver": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@stoplight/json-ref-resolver/-/json-ref-resolver-3.0.8.tgz", - "integrity": "sha512-Ns0jsq/qqDdhpd9iPXLUx5YRddUF5gfg0zkxmskV+srXrWlndg0S50dkX/GF0yrExKjru4veqW8Xx+Wo0noPtg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@stoplight/json-ref-resolver/-/json-ref-resolver-3.1.0.tgz", + "integrity": "sha512-tEVlRi9sMVektCiPsnint0OD/2zzQOPb7GoWboBznDc3f/99SAjgL6TBWvuFCJXWLwhZP4GA55FggmtsF5OvQg==", "requires": { - "@stoplight/json": "^3.1.2", - "@stoplight/path": "^1.3.0", - "@stoplight/types": "^11.1.1", - "@types/urijs": "^1.19", + "@stoplight/json": "^3.4.0", + "@stoplight/path": "^1.3.1", + "@stoplight/types": "^11.6.0", + "@types/urijs": "^1.19.9", "dependency-graph": "~0.8.0", "fast-memoize": "^2.5.1", - "immer": "^4.0.1", + "immer": "^5.3.2", "lodash": "^4.17.15", - "tslib": "^1.10.0", - "urijs": "~1.19.1" + "tslib": "^1.13.0", + "urijs": "^1.19.2" + }, + "dependencies": { + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" + } } }, "@stoplight/lifecycle": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@stoplight/lifecycle/-/lifecycle-2.2.1.tgz", - "integrity": "sha512-XOyfoJyWp5tXRFWq43mvnOoYTvkupwqGjDQnQ2o1qRNnfTrE70bjNK5ptD9A6m3zajAXgbl0puFa7P2CMg7+ew==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@stoplight/lifecycle/-/lifecycle-2.3.0.tgz", + "integrity": "sha512-nVeciLEYlj97W4OEwGp7UVGzdTkux8mSacbAARPJboEvVrqW/QHfAc830rcZ/UBvpWuni5WbMAPFpQ9t9Jb/AA==", "requires": { "strict-event-emitter-types": "^2.0.0", "wolfy87-eventemitter": "~5.2.8" } }, + "@stoplight/ordered-object-literal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stoplight/ordered-object-literal/-/ordered-object-literal-1.0.1.tgz", + "integrity": "sha512-kDcBIKwzAXZTkgzaiPXH2I0JXavBkOb3jFzYNFS5cBuvZS3s/K+knpk2wLVt0n8XrnRQsSffzN6XG9HqUhfq6Q==" + }, "@stoplight/path": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@stoplight/path/-/path-1.3.1.tgz", - "integrity": "sha512-I6YEfxspGglxt7MbgNbKThHdqh8CJWnDC1x1JUk2rka2D7mCpMSEu5I8IiAp997Dp4YIXDY6Did6gge8OY8KnA==" + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@stoplight/path/-/path-1.3.2.tgz", + "integrity": "sha512-lyIc6JUlUA8Ve5ELywPC8I2Sdnh1zc1zmbYgVarhXIp9YeAB0ReeqmGEOWNtlHkbP2DAA1AL65Wfn2ncjK/jtQ==" }, "@stoplight/spectral": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@stoplight/spectral/-/spectral-5.4.0.tgz", - "integrity": "sha512-c9NFKnzkiFqkF9RVgr7clfow6pXFKbEs+4bfKvn6PuUAYrTeOwxwYm7Nypf4KlxRGB+01epi9shrLMv4Nb2Kag==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@stoplight/spectral/-/spectral-5.5.0.tgz", + "integrity": "sha512-2TtADRz9yNhBs4m7p9Y25VX/5aoZPNETWRFo14A/a9Tu4oPFmJojJO1FFhk8Hu2kjKHtZeB4zXVuvtmbq/fPtQ==", "requires": { - "@stoplight/json": "3.6.0", - "@stoplight/json-ref-readers": "1.1.1", - "@stoplight/json-ref-resolver": "3.0.8", - "@stoplight/lifecycle": "^2.2.1", - "@stoplight/path": "1.3.1", - "@stoplight/types": "^11.6.0", - "@stoplight/yaml": "3.7.0", + "@stoplight/better-ajv-errors": "0.0.0", + "@stoplight/json": "3.9.0", + "@stoplight/json-ref-readers": "1.2.1", + "@stoplight/json-ref-resolver": "3.1.0", + "@stoplight/lifecycle": "2.3.0", + "@stoplight/path": "1.3.2", + "@stoplight/types": "^11.9.0", + "@stoplight/yaml": "4.2.1", "abort-controller": "3.0.0", "ajv": "6.12.2", "ajv-oai": "1.2.0", - "better-ajv-errors": "0.6.7", "blueimp-md5": "2.13.0", "chalk": "4.0.0", "eol": "0.9.1", "fast-glob": "3.1.0", "jsonpath-plus": "4.0.0", - "lodash": "4.17.15", + "lodash": "4.17.19", "nanoid": "2.1.11", + "nimma": "0.0.0", "node-fetch": "2.6", "proxy-agent": "3.1.1", "strip-ansi": "6.0", "text-table": "0.2", - "tslib": "1.11.1", + "tslib": "1.13.0", "yargs": "15.3.1" }, "dependencies": { + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" + }, + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" + }, "yargs": { "version": "15.3.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", @@ -441,19 +466,27 @@ } }, "@stoplight/yaml": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@stoplight/yaml/-/yaml-3.7.0.tgz", - "integrity": "sha512-lYs577C0tqs3WHtused0hclE+YHVshgeZT8i6kkqSIt1GUP3Hbe4AwZDEvFgZ9+9pa0JGlmKMrm0PJfvfKFxkw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@stoplight/yaml/-/yaml-4.2.1.tgz", + "integrity": "sha512-EnSdRgOv/wrdMtdXdTiP5VvChg8lugDmSZVuhcdK/V1pibWd4+r9S4XpJlCx+xgCzg1oLM8pIv/d9cPwHU8XtA==", "requires": { - "@stoplight/types": "^11.1.1", - "@stoplight/yaml-ast-parser": "0.0.44", - "lodash": "^4.17.15" + "@stoplight/ordered-object-literal": "^1.0.1", + "@stoplight/types": "^11.9.0", + "@stoplight/yaml-ast-parser": "0.0.48", + "tslib": "^1.12.0" + }, + "dependencies": { + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" + } } }, "@stoplight/yaml-ast-parser": { - "version": "0.0.44", - "resolved": "https://registry.npmjs.org/@stoplight/yaml-ast-parser/-/yaml-ast-parser-0.0.44.tgz", - "integrity": "sha512-PdY8p2Ufgtorf4d2DbKMfknILMa8KwuyyMMR/2lgK1mLaU8F5PKWYc+h9hIzC+ar0bh7m9h2rINo32m7ADfVyA==" + "version": "0.0.48", + "resolved": "https://registry.npmjs.org/@stoplight/yaml-ast-parser/-/yaml-ast-parser-0.0.48.tgz", + "integrity": "sha512-sV+51I7WYnLJnKPn2EMWgS4EUfoP4iWEbrWwbXsj0MZCB/xOK8j6+C9fntIdOM50kpx45ZLC3s6kwKivWuqvyg==" }, "@stylelint/postcss-css-in-js": { "version": "0.37.2", @@ -536,9 +569,9 @@ "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==" }, "@types/urijs": { - "version": "1.19.9", - "resolved": "https://registry.npmjs.org/@types/urijs/-/urijs-1.19.9.tgz", - "integrity": "sha512-/tiJyrc0GPcsReHzgC0SXwOmoPjLqYe01W7dLYB0yasQXMbcRee+ZIk+g8MIQhoBS8fPoBQO3Y93+aeBrI93Ug==" + "version": "1.19.10", + "resolved": "https://registry.npmjs.org/@types/urijs/-/urijs-1.19.10.tgz", + "integrity": "sha512-/R3arh6LDmdWYHFsIRM2UgqbsOimc8nR3TNTjEMpEy2lzWkUSPavCN90ihygu2togtc8oB/VRwrevgx6tnzxDA==" }, "@typescript-eslint/eslint-plugin": { "version": "3.10.1", @@ -554,44 +587,16 @@ }, "dependencies": { "@typescript-eslint/experimental-utils": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.0.tgz", - "integrity": "sha512-e5ZLSTuXgqC/Gq3QzK2orjlhTZVXzwxDujQmTBOM1NIVBZgW3wiIZjaXuVutk9R4UltFlwC9UD2+bdxsA7yyNg==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz", + "integrity": "sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw==", "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.10.0", - "@typescript-eslint/typescript-estree": "3.10.0", + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/typescript-estree": "3.10.1", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } - }, - "@typescript-eslint/types": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.10.0.tgz", - "integrity": "sha512-ktUWSa75heQNwH85GRM7qP/UUrXqx9d6yIdw0iLO9/uE1LILW+i+3+B64dUodUS2WFWLzKTlwfi9giqrODibWg==" - }, - "@typescript-eslint/typescript-estree": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.0.tgz", - "integrity": "sha512-yjuY6rmVHRhcUKgXaSPNVloRueGWpFNhxR5EQLzxXfiFSl1U/+FBqHhbaGwtPPEgCSt61QNhZgiFjWT27bgAyw==", - "requires": { - "@typescript-eslint/types": "3.10.0", - "@typescript-eslint/visitor-keys": "3.10.0", - "debug": "^4.1.1", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.0.tgz", - "integrity": "sha512-g4qftk8lWb/rHZe9uEp8oZSvsJhUvR2cfp7F7qE6DyUD2SsovEs8JDQTRP1xHzsD+pERsEpYNqkDgQXW6+ob5A==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - } } } }, @@ -608,57 +613,15 @@ } }, "@typescript-eslint/parser": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.10.0.tgz", - "integrity": "sha512-iJyf3f2HVwscvJR7ySGMXw2DJgIAPKEz8TeU17XVKzgJRV4/VgCeDFcqLzueRe7iFI2gv+Tln4AV88ZOnsCNXg==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.10.1.tgz", + "integrity": "sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw==", "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.10.0", - "@typescript-eslint/types": "3.10.0", - "@typescript-eslint/typescript-estree": "3.10.0", + "@typescript-eslint/experimental-utils": "3.10.1", + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/typescript-estree": "3.10.1", "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "@typescript-eslint/experimental-utils": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.0.tgz", - "integrity": "sha512-e5ZLSTuXgqC/Gq3QzK2orjlhTZVXzwxDujQmTBOM1NIVBZgW3wiIZjaXuVutk9R4UltFlwC9UD2+bdxsA7yyNg==", - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.10.0", - "@typescript-eslint/typescript-estree": "3.10.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/types": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.10.0.tgz", - "integrity": "sha512-ktUWSa75heQNwH85GRM7qP/UUrXqx9d6yIdw0iLO9/uE1LILW+i+3+B64dUodUS2WFWLzKTlwfi9giqrODibWg==" - }, - "@typescript-eslint/typescript-estree": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.0.tgz", - "integrity": "sha512-yjuY6rmVHRhcUKgXaSPNVloRueGWpFNhxR5EQLzxXfiFSl1U/+FBqHhbaGwtPPEgCSt61QNhZgiFjWT27bgAyw==", - "requires": { - "@typescript-eslint/types": "3.10.0", - "@typescript-eslint/visitor-keys": "3.10.0", - "debug": "^4.1.1", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.0.tgz", - "integrity": "sha512-g4qftk8lWb/rHZe9uEp8oZSvsJhUvR2cfp7F7qE6DyUD2SsovEs8JDQTRP1xHzsD+pERsEpYNqkDgQXW6+ob5A==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - } } }, "@typescript-eslint/types": { @@ -869,15 +832,30 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, "ast-types": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.3.tgz", - "integrity": "sha512-XTZ7xGML849LkQP86sWdQzfhwbt3YwIO6MqbX9mUNYY98VKaaVZP7YNNm70IpwecbkkxmfC5IYAzOQ/2p29zRA==" + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.14.1.tgz", + "integrity": "sha512-pfSiukbt23P1qMhNnsozLzhMLBs7EEeXqPyvPmnuZM+RMfwfqwDbSVKYflgGuVI7/VehR4oMks0igzdNAg4VeQ==", + "requires": { + "tslib": "^2.0.1" + }, + "dependencies": { + "tslib": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", + "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==" + } + } }, "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==" }, + "astring": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/astring/-/astring-1.4.3.tgz", + "integrity": "sha512-yJlJU/bmN820vL+cbWShu2YQU87dBP5V7BH2N4wODapRv27A2dZtUD0LgjP9lZENvPe9XRoSyWx+pZR6qKqNBw==" + }, "async": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", @@ -956,53 +934,6 @@ "tweetnacl": "^0.14.3" } }, - "better-ajv-errors": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-0.6.7.tgz", - "integrity": "sha512-PYgt/sCzR4aGpyNy5+ViSQ77ognMnWq7745zM+/flYO4/Yisdtp9wDQW2IKCyVYPUxQt3E/b5GBSwfhd1LPdlg==", - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/runtime": "^7.0.0", - "chalk": "^2.4.1", - "core-js": "^3.2.1", - "json-to-ast": "^2.0.3", - "jsonpointer": "^4.0.1", - "leven": "^3.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - } - } - }, "bignumber.js": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", @@ -1190,11 +1121,6 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" }, - "code-error-fragment": { - "version": "0.0.230", - "resolved": "https://registry.npmjs.org/code-error-fragment/-/code-error-fragment-0.0.230.tgz", - "integrity": "sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==" - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -1274,11 +1200,6 @@ "safe-buffer": "~5.1.1" } }, - "core-js": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", - "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==" - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -2826,11 +2747,6 @@ "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" }, - "grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==" - }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -3027,9 +2943,9 @@ "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" }, "immer": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/immer/-/immer-4.0.2.tgz", - "integrity": "sha512-Q/tm+yKqnKy4RIBmmtISBlhXuSDrB69e9EKTYiIenIKQkXBQir43w+kN/eGiax3wt1J0O1b2fYcNqLSbEcXA7w==" + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/immer/-/immer-5.3.6.tgz", + "integrity": "sha512-pqWQ6ozVfNOUDjrLfm4Pt7q4Q12cGw2HUZgry4Q5+Myxu9nmHRkWBpI0J4+MK0AxbdFtdMTwEGVl7Vd+vEiK+A==" }, "import-fresh": { "version": "3.2.1", @@ -3334,6 +3250,11 @@ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, + "jsep": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/jsep/-/jsep-0.3.5.tgz", + "integrity": "sha512-AoRLBDc6JNnKjNcmonituEABS5bcfqDhQAWWXNTFrqu6nVXBpBAGfcoTGZMFlIrh9FjmE1CQyX9CTNwZrXMMDA==" + }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -3364,15 +3285,6 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, - "json-to-ast": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json-to-ast/-/json-to-ast-2.1.0.tgz", - "integrity": "sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==", - "requires": { - "code-error-fragment": "0.0.230", - "grapheme-splitter": "^1.0.4" - } - }, "json5": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", @@ -3903,6 +3815,15 @@ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, + "nimma": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/nimma/-/nimma-0.0.0.tgz", + "integrity": "sha512-if0VqyHpTMHKFORMiJ2WLWgoIF4xqwjybHZyvodQ/yCmiWag6RhLlMHeFukz4X31DanTBA26U+HwvXIrTaYQkQ==", + "requires": { + "astring": "^1.4.3", + "jsep": "^0.3.4" + } + }, "njre": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/njre/-/njre-0.2.0.tgz", @@ -3998,9 +3919,9 @@ "integrity": "sha1-0LFF62kRicY6eNIB3E/bEpPvDAM=" }, "npm-groovy-lint": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/npm-groovy-lint/-/npm-groovy-lint-7.4.1.tgz", - "integrity": "sha512-hmCs9vA02lAHB6ABupLk4yZzotnl0ekqCeYUMqdSxEQyBNQyXo/vBPRWMAUAtthtlqLNo6PW2b/MZez4BmQUMw==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/npm-groovy-lint/-/npm-groovy-lint-7.4.2.tgz", + "integrity": "sha512-978Zyn4i2MaSlRooyuZIUA9o2MVWKf7qoF3HiW7yaygbnIZZpYafsLZtoc5rWLTOMBp2ZC87i/boVXsq+FXQeA==", "requires": { "@amplitude/node": "^0.3.3", "ansi-colors": "^4.1.1", @@ -4717,9 +4638,9 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, "prettier": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.0.tgz", - "integrity": "sha512-lz28cCbA1cDFHVuY8vvj6QuqOwIpyIfPUYkSl8AZ/vxH8qBXMMjE2knfLHCrZCmUsK/H1bg1P0tOo0dJkTJHvw==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz", + "integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==" }, "prettier-linter-helpers": { "version": "1.0.0", @@ -4889,11 +4810,6 @@ "strip-indent": "^3.0.0" } }, - "regenerator-runtime": { - "version": "0.13.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==" - }, "regexpp": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", diff --git a/dependencies/package.json b/dependencies/package.json index 0686d181..139cf530 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -2,9 +2,9 @@ "name": "super-linter", "dependencies": { "@coffeelint/cli": "^3.2.10", - "@stoplight/spectral": "^5.4.0", + "@stoplight/spectral": "^5.5.0", "@typescript-eslint/eslint-plugin": "^3.10.1", - "@typescript-eslint/parser": "^3.10.0", + "@typescript-eslint/parser": "^3.10.1", "asl-validator": "^1.7.1", "babel-eslint": "^10.1.0", "dockerfilelint": "^1.8.0", @@ -16,8 +16,8 @@ "htmlhint": "^0.14.1", "jsonlint": "^1.6.3", "markdownlint-cli": "^0.23.2", - "npm-groovy-lint": "^7.4.1", - "prettier": "^2.1.0", + "npm-groovy-lint": "^7.4.2", + "prettier": "^2.1.1", "prettyjson": "^1.2.1", "sql-lint": "0.0.15", "standard": "^14.3.4", diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index 50aac7f4..1f9d1159 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -70,7 +70,8 @@ function BuildFileList() { # Iterate through the array of all files found # ################################################ info "----------------------------------------------" - info "Files that have been modified in the commit(s):" + info "------ Files modified in the commit(s): ------" + info "----------------------------------------------" for FILE in "${RAW_FILE_ARRAY[@]}"; do ########################### # Get the files extension # diff --git a/lib/linter.sh b/lib/linter.sh index 7fc396fa..5133418e 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -37,8 +37,8 @@ CLOUDFORMATION_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CLOUDFORMATION_FILE_NAM CLOJURE_FILE_NAME='.clj-kondo/config.edn' # Name of the file CLOJURE_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CLOJURE_FILE_NAME}" # Path to the Clojure lint rules # Coffee Vars -COFFEE_FILE_NAME='.coffee-lint.json' # Name of the file -COFFEESCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${COFFEE_FILE_NAME}" # Path to the coffeescript lint rules +COFFEESCRIPT_FILE_NAME='.coffee-lint.json' # Name of the file +COFFEESCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${COFFEESCRIPT_FILE_NAME}" # Path to the coffeescript lint rules # CSS Vars CSS_FILE_NAME="${CSS_FILE_NAME:-.stylelintrc.json}" # Name of the file CSS_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${CSS_FILE_NAME}" # Path to the CSS lint rules @@ -133,7 +133,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' +LINTER_ARRAY=('ansible-lint' 'arm-ttk' 'asl-validator' 'bash-exec' 'black' 'cfn-lint' 'checkstyle' 'chktex' 'clj-kondo' 'coffeelint' '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' @@ -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' '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' @@ -174,6 +174,7 @@ VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean t VALIDATE_ANSIBLE="${VALIDATE_ANSIBLE}" # Boolean to validate language VALIDATE_ARM="${VALIDATE_ARM}" # Boolean to validate language VALIDATE_BASH="${VALIDATE_BASH}" # Boolean to validate language +VALIDATE_BASH_EXEC="${VALIDATE_BASH_EXEC}" # Boolean to validate language VALIDATE_CLOUDFORMATION="${VALIDATE_CLOUDFORMATION}" # Boolean to validate language VALIDATE_CLOJURE="${VALIDATE_CLOJURE}" # Boolean to validate language VALIDATE_COFFEE="${VALIDATE_COFFEE}" # Boolean to validate language @@ -329,6 +330,8 @@ ERRORS_FOUND_ARM=0 # Count of errors found export ERRORS_FOUND_ARM # Workaround SC2034 ERRORS_FOUND_BASH=0 # Count of errors found export ERRORS_FOUND_BASH # Workaround SC2034 +ERRORS_FOUND_BASH_EXEC=0 # Count of errors found +export ERRORS_FOUND_BASH_EXEC # Workaround SC2034 ERRORS_FOUND_CLOUDFORMATION=0 # Count of errors found export ERRORS_FOUND_CLOUDFORMATION # Workaround SC2034 ERRORS_FOUND_CLOJURE=0 # Count of errors found @@ -1086,7 +1089,7 @@ Footer() { #################################################### # Need to clean up the lanuage array of duplicates # #################################################### - mapfile -t UNIQUE_LINTED_ARRAY < <(echo "${LINTED_LANGUAGES_ARRAY[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ') + mapfile -t UNIQUE_LINTED_ARRAY < <(for LANG in "${LINTED_LANGUAGES_ARRAY[@]}"; do echo "${LANG}"; done | sort -u) ############################## # Prints for errors if found # @@ -1366,6 +1369,17 @@ if [ "${VALIDATE_BASH}" == "true" ]; then LintCodebase "BASH" "shellcheck" "shellcheck --color --external-sources" ".*\.\(sh\|bash\|dash\|ksh\)\$" "${FILE_ARRAY_BASH[@]}" fi +##################### +# BASH_EXEC LINTING # +##################### +if [ "${VALIDATE_BASH_EXEC}" == "true" ]; then + ####################### + # Lint the bash files # + ####################### + # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" + LintCodebase "BASH_EXEC" "bash-exec" "bash-exec" ".*\.\(sh\|bash\|dash\|ksh\)\$" "${FILE_ARRAY_BASH[@]}" +fi + ########################## # CLOUDFORMATION LINTING # ########################## @@ -1786,8 +1800,7 @@ if [ "${VALIDATE_R}" == "true" ]; then ########################## # Check for local config # ########################## - if [ ! -f "${GITHUB_WORKSPACE}/.lintr" ] && [ ${#FILE_ARRAY_R[@]} -ne 0 ]; then - info " " + if [ ! -f "${GITHUB_WORKSPACE}/.lintr" ] && (( ${#FILE_ARRAY_R[@]} )); then info "No .lintr configuration file found, using defaults." cp $R_LINTER_RULES "$GITHUB_WORKSPACE" fi @@ -1805,7 +1818,6 @@ if [ "${VALIDATE_RAKU}" == "true" ]; then ####################### # Lint the raku files # ####################### - info "${GITHUB_WORKSPACE}/META6.json" if [ -e "${GITHUB_WORKSPACE}/META6.json" ]; then cd "${GITHUB_WORKSPACE}" && zef install --deps-only --/test . fi @@ -1884,7 +1896,7 @@ if [ "${VALIDATE_TERRAFORM_TERRASCAN}" == "true" ]; then # Lint the Terraform files # ############################ # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "TERRAFORM_TERRASCAN" "terrascan" "terrascan -f " ".*\.\(tf\)\$" "${FILE_ARRAY_TERRAFORM_TERRASCAN[@]}" + LintCodebase "TERRAFORM_TERRASCAN" "terrascan" "terrascan scan -p /root/.terrascan/pkg/policies/opa/rego/ -t aws -f " ".*\.\(tf\)\$" "${FILE_ARRAY_TERRAFORM_TERRASCAN[@]}" fi ############### diff --git a/lib/worker.sh b/lib/worker.sh index 52e23e3d..29074246 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -247,14 +247,22 @@ function LintCodebase() { # Check the shell for errors # ############################## if [ ${ERROR_CODE} -ne 0 ]; then - ######### - # Error # - ######### - error "Found errors in [${LINTER_NAME}] linter!" - error "[${LINT_CMD}]" - error "Linter CMD:[${LINTER_COMMAND} ${FILE}]" - # Increment the error count - (("ERRORS_FOUND_${FILE_TYPE}++")) + if [[ ${FILE_TYPE} == "BASH_EXEC" ]]; then + ######## + # WARN # + ######## + warn "Warnings found in [${LINTER_NAME}] linter!" + warn "${LINT_CMD}" + else + ######### + # Error # + ######### + error "Found errors in [${LINTER_NAME}] linter!" + error "[${LINT_CMD}]" + error "Linter CMD:[${LINTER_COMMAND} ${FILE}]" + # Increment the error count + (("ERRORS_FOUND_${FILE_TYPE}++")) + fi ####################################################### # Store the linting as a temporary file in TAP format # @@ -614,6 +622,7 @@ function RunTestCases() { TestCodebase "ANSIBLE" "ansible-lint" "ansible-lint -v -c ${ANSIBLE_LINTER_RULES}" ".*\.\(yml\|yaml\)\$" "ansible" TestCodebase "ARM" "arm-ttk" "Import-Module ${ARM_TTK_PSD1} ; \${config} = \$(Import-PowerShellDataFile -Path ${ARM_LINTER_RULES}) ; Test-AzTemplate @config -TemplatePath" ".*\.\(json\)\$" "arm" TestCodebase "BASH" "shellcheck" "shellcheck --color --external-sources" ".*\.\(sh\|bash\|dash\|ksh\)\$" "shell" + TestCodebase "BASH_EXEC" "bash-exec" "bash-exec" ".*\.\(sh\|bash\|dash\|ksh\)\$" "shell" 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" @@ -652,7 +661,7 @@ function RunTestCases() { TestCodebase "STATES" "asl-validator" "asl-validator --json-path" ".*\.\(json\)\$" "states" TestCodebase "SQL" "sql-lint" "sql-lint --config ${SQL_LINTER_RULES}" ".*\.\(sql\)\$" "sql" TestCodebase "TERRAFORM" "tflint" "tflint -c ${TERRAFORM_LINTER_RULES}" ".*\.\(tf\)\$" "terraform" - TestCodebase "TERRAFORM_TERRASCAN" "terrascan" "terrascan -f" ".*\.\(tf\)\$" "terraform_terrascan" + TestCodebase "TERRAFORM_TERRASCAN" "terrascan" "terrascan scan -p /root/.terrascan/pkg/policies/opa/rego/ -t aws -f " ".*\.\(tf\)\$" "terraform_terrascan" TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c ${TYPESCRIPT_LINTER_RULES}" ".*\.\(ts\)\$" "typescript" TestCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin ${TYPESCRIPT_STANDARD_LINTER_RULES}" ".*\.\(ts\)\$" "typescript" TestCodebase "XML" "xmllint" "xmllint" ".*\.\(xml\)\$" "xml"