From c043e87ef12c637420fb8437d13616007af16fa8 Mon Sep 17 00:00:00 2001 From: Julie Garrone Date: Fri, 14 Aug 2020 10:38:26 +0200 Subject: [PATCH 01/37] Fix VALIDATE variables name for Dockerfile linters --- Dockerfile | 4 ++-- README.md | 4 ++-- lib/linter.sh | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 98b7a3e2..226c030e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -269,8 +269,8 @@ ENV ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ VALIDATE_COFFEE=${VALIDATE_COFFEE} \ VALIDATE_CSS=${VALIDATE_CSS} \ VALIDATE_DART=${VALIDATE_DART} \ - VALIDATE_DOCKER=${VALIDATE_DOCKER} \ - VALIDATE_DOCKER_HADOLINT=${VALIDATE_DOCKER_HADOLINT} \ + VALIDATE_DOCKERFILE=${VALIDATE_DOCKERFILE} \ + VALIDATE_DOCKERFILE_HADOLINT=${VALIDATE_DOCKERFILE_HADOLINT} \ VALIDATE_EDITORCONFIG=${VALIDATE_EDITORCONFIG} \ VALIDATE_ENV=${VALIDATE_ENV} \ VALIDATE_GO=${VALIDATE_GO} \ diff --git a/README.md b/README.md index 324a5aae..295826a1 100644 --- a/README.md +++ b/README.md @@ -200,8 +200,8 @@ But if you wish to select or exclude specific linters, we give you full control | **VALIDATE_COFFEE** | `true` | Flag to enable or disable the linting process of the Coffeescript language . | | **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the CSS language. | | **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the Dart language. | -| **VALIDATE_DOCKER** | `true` | Flag to enable or disable the linting process of the Docker language. | -| **VALIDATE_DOCKER_HADOLINT** | `true` | Flag to enable or disable the linting process of the Docker language. | +| **VALIDATE_DOCKERFILE** | `true` | Flag to enable or disable the linting process of the Docker language. | +| **VALIDATE_DOCKERFILE_HADOLINT** | `true` | Flag to enable or disable the linting process of the Docker language. | | **VALIDATE_EDITORCONFIG** | `true` | Flag to enable or disable the linting process with the editorconfig. | | **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the ENV language. | | **VALIDATE_GO** | `true` | Flag to enable or disable the linting process of the Golang language. | diff --git a/lib/linter.sh b/lib/linter.sh index ab5c4d0f..9912e1a2 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -173,8 +173,8 @@ VALIDATE_CLOJURE="${VALIDATE_CLOJURE}" # Boolean t VALIDATE_COFFEE="${VALIDATE_COFFEE}" # Boolean to validate language VALIDATE_CSS="${VALIDATE_CSS}" # Boolean to validate language VALIDATE_DART="${VALIDATE_DART}" # Boolean to validate language -VALIDATE_DOCKER="${VALIDATE_DOCKER}" # Boolean to validate language -VALIDATE_DOCKER_HADOLINT="${VALIDATE_DOCKER_HADOLINT}" # Boolean to validate language +VALIDATE_DOCKERFILE="${VALIDATE_DOCKERFILE}" # Boolean to validate language +VALIDATE_DOCKERFILE_HADOLINT="${VALIDATE_DOCKERFILE_HADOLINT}" # Boolean to validate language VALIDATE_EDITORCONFIG="${VALIDATE_EDITORCONFIG}" # Boolean to validate files with editorconfig VALIDATE_ENV="${VALIDATE_ENV}" # Boolean to validate language VALIDATE_GO="${VALIDATE_GO}" # Boolean to validate language @@ -1381,7 +1381,7 @@ fi ################## # DOCKER LINTING # ################## -if [ "${VALIDATE_DOCKER}" == "true" ]; then +if [ "${VALIDATE_DOCKERFILE}" == "true" ]; then ######################### # Lint the docker files # ######################### @@ -1393,7 +1393,7 @@ fi ########################### # DOCKER LINTING HADOLINT # ########################### -if [ "${VALIDATE_DOCKER_HADOLINT}" == "true" ]; then +if [ "${VALIDATE_DOCKERFILE_HADOLINT}" == "true" ]; then ######################### # Lint the docker files # ######################### From dbf2a64c3a440704afd970bd91586d2149b554f2 Mon Sep 17 00:00:00 2001 From: NicolasVuillamy Date: Mon, 17 Aug 2020 02:13:18 +0200 Subject: [PATCH 02/37] Upgrade npm-groovy-lint to 7.3.1 --- dependencies/package-lock.json | 12 ++++++------ dependencies/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index 96b22a54..19475dc3 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -3232,9 +3232,9 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "java-caller": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/java-caller/-/java-caller-2.0.0.tgz", - "integrity": "sha512-oSv2BCo1zZWo1Q6t01Bs1Gef4NXv36Rbu39n2M9vQ5Iacsopplx9ik38gfeHp4vLMuvOTVlTEnl9uAU+g3rzlA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/java-caller/-/java-caller-2.1.0.tgz", + "integrity": "sha512-akhcPM1YKmOWoVaNnAh0rrlyWkESa+tU9E1GxfdyotDVMe6r2w/gBJUaTmngihRbYL4QwA3NB3pu7x7sq2YH8g==", "requires": { "debug": "^4.1.1", "fs-extra": "^9.0.1", @@ -3958,9 +3958,9 @@ "integrity": "sha1-0LFF62kRicY6eNIB3E/bEpPvDAM=" }, "npm-groovy-lint": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/npm-groovy-lint/-/npm-groovy-lint-7.2.0.tgz", - "integrity": "sha512-USoW673L/+0/rj+kKmLPVjCtsW5Izi4T0N4ov3wjdamdeUy67/kH1VawaHiB+F3lEPjVpnkOtUDrzn3mQw5bbQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/npm-groovy-lint/-/npm-groovy-lint-7.3.1.tgz", + "integrity": "sha512-XtVeirukkDX8gBZetIpgzrmaun8UQAQarW/zFaqyM2j1HAi5eBEr6JHRwM20kbUuEpYdkczlHVIz1S7Tqex6Ew==", "requires": { "@amplitude/node": "^0.3.3", "ansi-colors": "^4.1.1", diff --git a/dependencies/package.json b/dependencies/package.json index b408bed8..1ee0c616 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -16,7 +16,7 @@ "htmlhint": "^0.14.1", "jsonlint": "^1.6.3", "markdownlint-cli": "^0.23.2", - "npm-groovy-lint": "^7.2.0", + "npm-groovy-lint": "^7.3.1", "prettier": "^2.0.5", "prettyjson": "^1.2.1", "sql-lint": "0.0.15", From e6a120be19ee6996664fe6fe3047bbbfaa12814d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Aug 2020 05:43:27 +0000 Subject: [PATCH 03/37] Bump eslint from 7.6.0 to 7.7.0 in /dependencies Bumps [eslint](https://github.com/eslint/eslint) from 7.6.0 to 7.7.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.6.0...v7.7.0) Signed-off-by: dependabot[bot] --- dependencies/package-lock.json | 12 ++++++------ dependencies/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index 96b22a54..91d0eddd 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -1823,9 +1823,9 @@ } }, "eslint": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.6.0.tgz", - "integrity": "sha512-QlAManNtqr7sozWm5TF4wIH9gmUm2hE3vNRUvyoYAa4y1l5/jxD/PQStEjBMQtCqZmSep8UxrcecI60hOpe61w==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz", + "integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==", "requires": { "@babel/code-frame": "^7.0.0", "ajv": "^6.10.0", @@ -1888,9 +1888,9 @@ } }, "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" }, "optionator": { "version": "0.9.1", diff --git a/dependencies/package.json b/dependencies/package.json index b408bed8..b1d5ab7a 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -8,7 +8,7 @@ "asl-validator": "^1.7.1", "babel-eslint": "^10.1.0", "dockerfilelint": "^1.8.0", - "eslint": "^7.6.0", + "eslint": "^7.7.0", "eslint-config-airbnb": "^18.2.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-jest": "^23.20.0", From e32fecc778df04413ef16847a36083ea4a377ad9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Aug 2020 05:43:57 +0000 Subject: [PATCH 04/37] Bump npm-groovy-lint from 7.2.0 to 7.3.1 in /dependencies Bumps [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint) from 7.2.0 to 7.3.1. - [Release notes](https://github.com/nvuillam/npm-groovy-lint/releases) - [Changelog](https://github.com/nvuillam/npm-groovy-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/nvuillam/npm-groovy-lint/commits) Signed-off-by: dependabot[bot] --- dependencies/package-lock.json | 12 ++++++------ dependencies/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index 96b22a54..19475dc3 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -3232,9 +3232,9 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "java-caller": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/java-caller/-/java-caller-2.0.0.tgz", - "integrity": "sha512-oSv2BCo1zZWo1Q6t01Bs1Gef4NXv36Rbu39n2M9vQ5Iacsopplx9ik38gfeHp4vLMuvOTVlTEnl9uAU+g3rzlA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/java-caller/-/java-caller-2.1.0.tgz", + "integrity": "sha512-akhcPM1YKmOWoVaNnAh0rrlyWkESa+tU9E1GxfdyotDVMe6r2w/gBJUaTmngihRbYL4QwA3NB3pu7x7sq2YH8g==", "requires": { "debug": "^4.1.1", "fs-extra": "^9.0.1", @@ -3958,9 +3958,9 @@ "integrity": "sha1-0LFF62kRicY6eNIB3E/bEpPvDAM=" }, "npm-groovy-lint": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/npm-groovy-lint/-/npm-groovy-lint-7.2.0.tgz", - "integrity": "sha512-USoW673L/+0/rj+kKmLPVjCtsW5Izi4T0N4ov3wjdamdeUy67/kH1VawaHiB+F3lEPjVpnkOtUDrzn3mQw5bbQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/npm-groovy-lint/-/npm-groovy-lint-7.3.1.tgz", + "integrity": "sha512-XtVeirukkDX8gBZetIpgzrmaun8UQAQarW/zFaqyM2j1HAi5eBEr6JHRwM20kbUuEpYdkczlHVIz1S7Tqex6Ew==", "requires": { "@amplitude/node": "^0.3.3", "ansi-colors": "^4.1.1", diff --git a/dependencies/package.json b/dependencies/package.json index b408bed8..1ee0c616 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -16,7 +16,7 @@ "htmlhint": "^0.14.1", "jsonlint": "^1.6.3", "markdownlint-cli": "^0.23.2", - "npm-groovy-lint": "^7.2.0", + "npm-groovy-lint": "^7.3.1", "prettier": "^2.0.5", "prettyjson": "^1.2.1", "sql-lint": "0.0.15", From 714afda35729a3e509f4d4b9376fc701678f6452 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Aug 2020 05:49:48 +0000 Subject: [PATCH 05/37] Bump cfn-lint from 0.34.1 to 0.35.0 in /dependencies Bumps [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint) from 0.34.1 to 0.35.0. - [Release notes](https://github.com/aws-cloudformation/cfn-python-lint/releases) - [Changelog](https://github.com/aws-cloudformation/cfn-python-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws-cloudformation/cfn-python-lint/compare/v0.34.1...v0.35.0) Signed-off-by: dependabot[bot] --- dependencies/Pipfile.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/dependencies/Pipfile.lock b/dependencies/Pipfile.lock index e8e7a7e8..de2a9a11 100644 --- a/dependencies/Pipfile.lock +++ b/dependencies/Pipfile.lock @@ -39,33 +39,33 @@ }, "aws-sam-translator": { "hashes": [ - "sha256:33c5e9a04584a88b2dc730991f7aea52acc4a077a194444e16728dd2be997dc0", - "sha256:5b31769d271fa6c7e87cde076ce819f9f9c7da324b3880f2cd0f5f5aa837e520", - "sha256:f2d0585fc7dd071f136b543e9a614945cb80bbd3113a25f260797c126456dd25" + "sha256:1a3fd8e48a745967e8457b9cefdc3ad0f139ac4a25af4db9c13a9e1c19ea6910", + "sha256:3a200e6475f11726732b9b9c070ca4d58d2fe5ecc40e8fb629b09a053fba5640", + "sha256:de2f1b4efd83347639eb19fea37989e9da9a3c59da277320cf1e58a2f0ff6dd0" ], - "version": "==1.25.0" + "version": "==1.26.0" }, "boto3": { "hashes": [ - "sha256:726937b33b5bf6036a3889ea6ecad632439d1a53c3dd4497c1c426d348e2dae3", - "sha256:781f5d1bbec6c2fe902e8855c1c8a576845eaa06630e817b0e422afa4788620e" + "sha256:640a8372ce0edfbb84a8f63584a0b64c78d61a751a27c2a47f92d2ebaf021ce4", + "sha256:a6c9a3d3abbad2ff2e5751af599492a9271633a7c9fef343482524464c53e451" ], - "version": "==1.14.34" + "version": "==1.14.43" }, "botocore": { "hashes": [ - "sha256:8170f6a236cdfd053275be7b2f1531c90c517d903d38b21d064dc6ba23f20870", - "sha256:ff39ec54893397df3c14dd516aedeaff12bb7c363051d8b9bd5fc86bc3e68231" + "sha256:3fb144d2b5d705127f394f7483737ece6fa79577ca7c493e4f42047ac8636200", + "sha256:f8801ce7f7603922ccab1c86c448e802f94183e31d99457e85fb9985a20d3abc" ], - "version": "==1.17.34" + "version": "==1.17.43" }, "cfn-lint": { "hashes": [ - "sha256:85df66deca0319003b4af3efbd4689e5004608b4e9ee7cc54c7a27e5c0ca1685", - "sha256:f7c63a4bf6c32c56cbe1af023ff93eb88a4bad784368dcb25724941981e92f16" + "sha256:42023d89520e3a29891ec2eb4c326eef9d1f7516fe9abee8b6c97ce064187b45", + "sha256:8439925531fdd4c94e5b50974d067857b3af50b04b61254d3eae9b1e0ce20007" ], "index": "pypi", - "version": "==0.34.1" + "version": "==0.35.0" }, "decorator": { "hashes": [ From 1022ad20f53dc7ac94592b33301336f3b8e73e91 Mon Sep 17 00:00:00 2001 From: Julie Garrone Date: Mon, 17 Aug 2020 09:59:09 +0200 Subject: [PATCH 06/37] Fix indentation in comment and table --- README.md | 4 ++-- lib/linter.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 295826a1..b93a2acb 100644 --- a/README.md +++ b/README.md @@ -200,8 +200,8 @@ But if you wish to select or exclude specific linters, we give you full control | **VALIDATE_COFFEE** | `true` | Flag to enable or disable the linting process of the Coffeescript language . | | **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the CSS language. | | **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the Dart language. | -| **VALIDATE_DOCKERFILE** | `true` | Flag to enable or disable the linting process of the Docker language. | -| **VALIDATE_DOCKERFILE_HADOLINT** | `true` | Flag to enable or disable the linting process of the Docker language. | +| **VALIDATE_DOCKERFILE** | `true` | Flag to enable or disable the linting process of the Docker language. | +| **VALIDATE_DOCKERFILE_HADOLINT** | `true` | Flag to enable or disable the linting process of the Docker language. | | **VALIDATE_EDITORCONFIG** | `true` | Flag to enable or disable the linting process with the editorconfig. | | **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the ENV language. | | **VALIDATE_GO** | `true` | Flag to enable or disable the linting process of the Golang language. | diff --git a/lib/linter.sh b/lib/linter.sh index 9912e1a2..ba7a0c4a 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -173,8 +173,8 @@ VALIDATE_CLOJURE="${VALIDATE_CLOJURE}" # Boolean t VALIDATE_COFFEE="${VALIDATE_COFFEE}" # Boolean to validate language VALIDATE_CSS="${VALIDATE_CSS}" # Boolean to validate language VALIDATE_DART="${VALIDATE_DART}" # Boolean to validate language -VALIDATE_DOCKERFILE="${VALIDATE_DOCKERFILE}" # Boolean to validate language -VALIDATE_DOCKERFILE_HADOLINT="${VALIDATE_DOCKERFILE_HADOLINT}" # Boolean to validate language +VALIDATE_DOCKERFILE="${VALIDATE_DOCKERFILE}" # Boolean to validate language +VALIDATE_DOCKERFILE_HADOLINT="${VALIDATE_DOCKERFILE_HADOLINT}" # Boolean to validate language VALIDATE_EDITORCONFIG="${VALIDATE_EDITORCONFIG}" # Boolean to validate files with editorconfig VALIDATE_ENV="${VALIDATE_ENV}" # Boolean to validate language VALIDATE_GO="${VALIDATE_GO}" # Boolean to validate language From 2a272a5925ef1ed47a416ee8aa0653af3b6dbf17 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 17 Aug 2020 09:09:05 -0500 Subject: [PATCH 07/37] adding more logic --- .github/workflows/automerge-dependabot.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automerge-dependabot.yml b/.github/workflows/automerge-dependabot.yml index e00b6c22..ff106ad2 100644 --- a/.github/workflows/automerge-dependabot.yml +++ b/.github/workflows/automerge-dependabot.yml @@ -37,8 +37,16 @@ jobs: checkName: Deploy Docker Image - DEV ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Wait for CI/CT/CD to succeed pt2 + uses: fountainhead/action-wait-for-check@v1.0.0 + id: wait-for-ci + with: + token: ${{ secrets.GITHUB_TOKEN }} + checkName: Stack linter + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: merge - if: steps.wait-for-build.outputs.conclusion == 'success' || steps.wait-for-build.outputs.conclusion == 'skipped' + if: steps.wait-for-build.outputs.conclusion == 'success' || steps.wait-for-build.outputs.conclusion == 'skipped' && steps.wait-for-ci.outputs.conclusion == 'success' uses: actions/github-script@v2 with: script: | From 4af758c3ee01a6bfb9c0d4fd00abb1f248020baf Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 17 Aug 2020 09:46:14 -0500 Subject: [PATCH 08/37] fixing cleanup --- .automation/clean-code-base-for-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.automation/clean-code-base-for-tests.sh b/.automation/clean-code-base-for-tests.sh index 9e22531c..c7c00494 100755 --- a/.automation/clean-code-base-for-tests.sh +++ b/.automation/clean-code-base-for-tests.sh @@ -121,7 +121,7 @@ CleanTestDockerFiles() { ################################## # Check if from the tests folder # ################################## - if [[ $FILE_DIR == **".automation/test/docker/bad"** ]]; then + if [[ $FILE_DIR != **".automation/test/docker/good"** ]]; then ################################ # Its a test, we can delete it # ################################ From 0744055595da9908dff217b26640f8db016ec764 Mon Sep 17 00:00:00 2001 From: Ahmad Nassri Date: Mon, 17 Aug 2020 12:55:11 -0400 Subject: [PATCH 09/37] docs: remove note about using docker:// it seems GitHub Actions now respects `actions.yml` directives when using docker actions, thus making this note redundant --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index b93a2acb..b2c4d095 100644 --- a/README.md +++ b/README.md @@ -148,16 +148,13 @@ jobs: # Run Linter against code base # ################################ - name: Lint Code Base - uses: docker://github/super-linter:v3 + uses: github/super-linter@v3 env: VALIDATE_ALL_CODEBASE: false DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` -**NOTE:** -Using the line:`uses: docker://github/super-linter:v3` will pull the image down from **DockerHub** and run the **GitHub Super-Linter**. Using the line: `uses: github/super-linter@v3` will build and compile the **GitHub Super-Linter** at build time. _This can be far more costly in time..._ - ## Environment variables The super-linter allows you to pass the following `ENV` variables to be able to trigger different functionality. From 931eba8a105e8ddaa295cdd607bfe29cb382b9a1 Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Mon, 17 Aug 2020 12:42:15 -0500 Subject: [PATCH 10/37] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index bc454ec1..743494c2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ ###################################################################### # These owners will be the default owners for everything in the repo # ###################################################################### -* @admiralawkbar @jwiebalk @zkoppert @IAmHughes @nemchik @Hanse00 @dependabot-bot +* @admiralawkbar @jwiebalk @zkoppert @IAmHughes @nemchik @Hanse00 @dependabot-bot @GaboFDC From 2248c5300203192ae8042c4f3ff3433ab7b2dbbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2020 05:21:41 +0000 Subject: [PATCH 11/37] Bump wata727/tflint from 0.18.0 to 0.19.0 Bumps wata727/tflint from 0.18.0 to 0.19.0. Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 226c030e..2018c288 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ FROM mstruebing/editorconfig-checker:2.1.0 as editorconfig-checker 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.18.0 as tflint +FROM wata727/tflint:0.19.0 as tflint FROM hadolint/hadolint:latest-alpine as dockerfile-lint ################## From 3cda243c9cabc698450607ba2135025528716da5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2020 05:23:45 +0000 Subject: [PATCH 12/37] Bump @typescript-eslint/parser from 3.9.0 to 3.9.1 in /dependencies Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 3.9.0 to 3.9.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v3.9.1/packages/parser) Signed-off-by: dependabot[bot] --- dependencies/package-lock.json | 94 +++++++++++++++++----------------- dependencies/package.json | 2 +- 2 files changed, 47 insertions(+), 49 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index 98c8cbbd..068054f4 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -595,58 +595,56 @@ } } }, + "@typescript-eslint/experimental-utils": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.1.tgz", + "integrity": "sha512-lkiZ8iBBaYoyEKhCkkw4SAeatXyBq9Ece5bZXdLe1LWBUwTszGbmbiqmQbwWA8cSYDnjWXp9eDbXpf9Sn0hLAg==", + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/types": "3.9.1", + "@typescript-eslint/typescript-estree": "3.9.1", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, "@typescript-eslint/parser": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.9.0.tgz", - "integrity": "sha512-rDHOKb6uW2jZkHQniUQVZkixQrfsZGUCNWWbKWep4A5hGhN5dLHMUCNAWnC4tXRlHedXkTDptIpxs6e4Pz8UfA==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.9.1.tgz", + "integrity": "sha512-y5QvPFUn4Vl4qM40lI+pNWhTcOWtpZAJ8pOEQ21fTTW4xTJkRplMjMRje7LYTXqVKKX9GJhcyweMz2+W1J5bMg==", "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.9.0", - "@typescript-eslint/types": "3.9.0", - "@typescript-eslint/typescript-estree": "3.9.0", + "@typescript-eslint/experimental-utils": "3.9.1", + "@typescript-eslint/types": "3.9.1", + "@typescript-eslint/typescript-estree": "3.9.1", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/types": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.9.1.tgz", + "integrity": "sha512-15JcTlNQE1BsYy5NBhctnEhEoctjXOjOK+Q+rk8ugC+WXU9rAcS2BYhoh6X4rOaXJEpIYDl+p7ix+A5U0BqPTw==" + }, + "@typescript-eslint/typescript-estree": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.1.tgz", + "integrity": "sha512-IqM0gfGxOmIKPhiHW/iyAEXwSVqMmR2wJ9uXHNdFpqVvPaQ3dWg302vW127sBpAiqM9SfHhyS40NKLsoMpN2KA==", + "requires": { + "@typescript-eslint/types": "3.9.1", + "@typescript-eslint/visitor-keys": "3.9.1", + "debug": "^4.1.1", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.1.tgz", + "integrity": "sha512-zxdtUjeoSh+prCpogswMwVUJfEFmCOjdzK9rpNjNBfm6EyPt99x3RrJoBOGZO23FCt0WPKUCOL5mb/9D5LjdwQ==", + "requires": { "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "@typescript-eslint/experimental-utils": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.0.tgz", - "integrity": "sha512-/vSHUDYizSOhrOJdjYxPNGfb4a3ibO8zd4nUKo/QBFOmxosT3cVUV7KIg8Dwi6TXlr667G7YPqFK9+VSZOorNA==", - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.9.0", - "@typescript-eslint/typescript-estree": "3.9.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/types": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.9.0.tgz", - "integrity": "sha512-rb6LDr+dk9RVVXO/NJE8dT1pGlso3voNdEIN8ugm4CWM5w5GimbThCMiMl4da1t5u3YwPWEwOnKAULCZgBtBHg==" - }, - "@typescript-eslint/typescript-estree": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.0.tgz", - "integrity": "sha512-N+158NKgN4rOmWVfvKOMoMFV5n8XxAliaKkArm/sOypzQ0bUL8MSnOEBW3VFIeffb/K5ce/cAV0yYhR7U4ALAA==", - "requires": { - "@typescript-eslint/types": "3.9.0", - "@typescript-eslint/visitor-keys": "3.9.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.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.0.tgz", - "integrity": "sha512-O1qeoGqDbu0EZUC/MZ6F1WHTIzcBVhGqDj3LhTnj65WUA548RXVxUHbYhAW9bZWfb2rnX9QsbbP5nmeJ5Z4+ng==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - } } }, "JSV": { diff --git a/dependencies/package.json b/dependencies/package.json index aaccbddb..c59a5459 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -4,7 +4,7 @@ "@coffeelint/cli": "^3.2.10", "@stoplight/spectral": "^5.4.0", "@typescript-eslint/eslint-plugin": "^3.9.0", - "@typescript-eslint/parser": "^3.8.0", + "@typescript-eslint/parser": "^3.9.1", "asl-validator": "^1.7.1", "babel-eslint": "^10.1.0", "dockerfilelint": "^1.8.0", From 9456cc1c6d5b3bd7dc6f2c099b847053f01d10b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2020 05:24:13 +0000 Subject: [PATCH 13/37] Bump npm-groovy-lint from 7.3.1 to 7.4.0 in /dependencies Bumps [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint) from 7.3.1 to 7.4.0. - [Release notes](https://github.com/nvuillam/npm-groovy-lint/releases) - [Changelog](https://github.com/nvuillam/npm-groovy-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/nvuillam/npm-groovy-lint/commits/v7.4.0) Signed-off-by: dependabot[bot] --- dependencies/package-lock.json | 6 +++--- dependencies/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index 98c8cbbd..a3fcc693 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -3958,9 +3958,9 @@ "integrity": "sha1-0LFF62kRicY6eNIB3E/bEpPvDAM=" }, "npm-groovy-lint": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/npm-groovy-lint/-/npm-groovy-lint-7.3.1.tgz", - "integrity": "sha512-XtVeirukkDX8gBZetIpgzrmaun8UQAQarW/zFaqyM2j1HAi5eBEr6JHRwM20kbUuEpYdkczlHVIz1S7Tqex6Ew==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/npm-groovy-lint/-/npm-groovy-lint-7.4.0.tgz", + "integrity": "sha512-Kb+BP/cKbgISsQx5IkGnIjijheFgOFhgCFsiR4axVvgaqBMx7z43+hrfhB7lquXz2s4BFqC+j8qKijarvOfbUg==", "requires": { "@amplitude/node": "^0.3.3", "ansi-colors": "^4.1.1", diff --git a/dependencies/package.json b/dependencies/package.json index aaccbddb..db22623f 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -16,7 +16,7 @@ "htmlhint": "^0.14.1", "jsonlint": "^1.6.3", "markdownlint-cli": "^0.23.2", - "npm-groovy-lint": "^7.3.1", + "npm-groovy-lint": "^7.4.0", "prettier": "^2.0.5", "prettyjson": "^1.2.1", "sql-lint": "0.0.15", From 0c5b28ce15911e4fab4eab22ecda49a7f28ef851 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2020 05:24:36 +0000 Subject: [PATCH 14/37] Bump @typescript-eslint/eslint-plugin in /dependencies Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 3.9.0 to 3.9.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v3.9.1/packages/eslint-plugin) Signed-off-by: dependabot[bot] --- dependencies/package-lock.json | 90 +++++++++++++++++----------------- dependencies/package.json | 2 +- 2 files changed, 45 insertions(+), 47 deletions(-) diff --git a/dependencies/package-lock.json b/dependencies/package-lock.json index 98c8cbbd..a2b7ce80 100644 --- a/dependencies/package-lock.json +++ b/dependencies/package-lock.json @@ -541,58 +541,28 @@ "integrity": "sha512-/tiJyrc0GPcsReHzgC0SXwOmoPjLqYe01W7dLYB0yasQXMbcRee+ZIk+g8MIQhoBS8fPoBQO3Y93+aeBrI93Ug==" }, "@typescript-eslint/eslint-plugin": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.9.0.tgz", - "integrity": "sha512-UD6b4p0/hSe1xdTvRCENSx7iQ+KR6ourlZFfYuPC7FlXEzdHuLPrEmuxZ23b2zW96KJX9Z3w05GE/wNOiEzrVg==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.9.1.tgz", + "integrity": "sha512-XIr+Mfv7i4paEdBf0JFdIl9/tVxyj+rlilWIfZ97Be0lZ7hPvUbS5iHt9Glc8kRI53dsr0PcAEudbf8rO2wGgg==", "requires": { - "@typescript-eslint/experimental-utils": "3.9.0", + "@typescript-eslint/experimental-utils": "3.9.1", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", "semver": "^7.3.2", "tsutils": "^3.17.1" - }, - "dependencies": { - "@typescript-eslint/experimental-utils": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.0.tgz", - "integrity": "sha512-/vSHUDYizSOhrOJdjYxPNGfb4a3ibO8zd4nUKo/QBFOmxosT3cVUV7KIg8Dwi6TXlr667G7YPqFK9+VSZOorNA==", - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.9.0", - "@typescript-eslint/typescript-estree": "3.9.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/types": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.9.0.tgz", - "integrity": "sha512-rb6LDr+dk9RVVXO/NJE8dT1pGlso3voNdEIN8ugm4CWM5w5GimbThCMiMl4da1t5u3YwPWEwOnKAULCZgBtBHg==" - }, - "@typescript-eslint/typescript-estree": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.0.tgz", - "integrity": "sha512-N+158NKgN4rOmWVfvKOMoMFV5n8XxAliaKkArm/sOypzQ0bUL8MSnOEBW3VFIeffb/K5ce/cAV0yYhR7U4ALAA==", - "requires": { - "@typescript-eslint/types": "3.9.0", - "@typescript-eslint/visitor-keys": "3.9.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.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.0.tgz", - "integrity": "sha512-O1qeoGqDbu0EZUC/MZ6F1WHTIzcBVhGqDj3LhTnj65WUA548RXVxUHbYhAW9bZWfb2rnX9QsbbP5nmeJ5Z4+ng==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.1.tgz", + "integrity": "sha512-lkiZ8iBBaYoyEKhCkkw4SAeatXyBq9Ece5bZXdLe1LWBUwTszGbmbiqmQbwWA8cSYDnjWXp9eDbXpf9Sn0hLAg==", + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/types": "3.9.1", + "@typescript-eslint/typescript-estree": "3.9.1", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { @@ -649,6 +619,34 @@ } } }, + "@typescript-eslint/types": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.9.1.tgz", + "integrity": "sha512-15JcTlNQE1BsYy5NBhctnEhEoctjXOjOK+Q+rk8ugC+WXU9rAcS2BYhoh6X4rOaXJEpIYDl+p7ix+A5U0BqPTw==" + }, + "@typescript-eslint/typescript-estree": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.1.tgz", + "integrity": "sha512-IqM0gfGxOmIKPhiHW/iyAEXwSVqMmR2wJ9uXHNdFpqVvPaQ3dWg302vW127sBpAiqM9SfHhyS40NKLsoMpN2KA==", + "requires": { + "@typescript-eslint/types": "3.9.1", + "@typescript-eslint/visitor-keys": "3.9.1", + "debug": "^4.1.1", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.1.tgz", + "integrity": "sha512-zxdtUjeoSh+prCpogswMwVUJfEFmCOjdzK9rpNjNBfm6EyPt99x3RrJoBOGZO23FCt0WPKUCOL5mb/9D5LjdwQ==", + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, "JSV": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", diff --git a/dependencies/package.json b/dependencies/package.json index aaccbddb..366b42d5 100644 --- a/dependencies/package.json +++ b/dependencies/package.json @@ -3,7 +3,7 @@ "dependencies": { "@coffeelint/cli": "^3.2.10", "@stoplight/spectral": "^5.4.0", - "@typescript-eslint/eslint-plugin": "^3.9.0", + "@typescript-eslint/eslint-plugin": "^3.9.1", "@typescript-eslint/parser": "^3.8.0", "asl-validator": "^1.7.1", "babel-eslint": "^10.1.0", From 173294201dbc10f89bef1800fa609ed7d2a72a68 Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Tue, 18 Aug 2020 08:51:15 -0500 Subject: [PATCH 15/37] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 743494c2..ae1aa35c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ ###################################################################### # These owners will be the default owners for everything in the repo # ###################################################################### -* @admiralawkbar @jwiebalk @zkoppert @IAmHughes @nemchik @Hanse00 @dependabot-bot @GaboFDC +* @admiralawkbar @jwiebalk @zkoppert @IAmHughes @nemchik @Hanse00 @github-actions @GaboFDC From 1f55b422daa852a633de9524e6b1e0f99244ff4f Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 18 Aug 2020 09:51:38 -0500 Subject: [PATCH 16/37] fix folder for persistance --- lib/linter.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index ba7a0c4a..075df623 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -260,7 +260,7 @@ export WARNING_ARRAY_TEST # Workaround SC2034 OUTPUT_FORMAT="${OUTPUT_FORMAT}" # Output format to be generated. Default none OUTPUT_FOLDER="${OUTPUT_FOLDER:-super-linter.report}" # Folder where the reports are generated. Default super-linter.report OUTPUT_DETAILS="${OUTPUT_DETAILS:-simpler}" # What level of details. (simpler or detailed). Default simpler -REPORT_OUTPUT_FOLDER="${DEFAULT_WORKSPACE}/${OUTPUT_FOLDER}" # Location for the report folder +REPORT_OUTPUT_FOLDER="${GITHUB_WORKSPACE}/${OUTPUT_FOLDER}" # Location for the report folder ########################## # Array of changed files # @@ -795,6 +795,11 @@ GetGitHubVars() { fatal "Provided volume is not a directory!" fi + ################################ + # Set the report output folder # + ################################ + REPORT_OUTPUT_FOLDER="${DEFAULT_WORKSPACE}/${OUTPUT_FOLDER}" + info "Linting all files in mapped directory:[${DEFAULT_WORKSPACE}]" # No need to touch or set the GITHUB_SHA @@ -1024,6 +1029,12 @@ Reports() { ################################### if [ -z "${FORMAT_REPORT}" ]; then info "Reports generated in folder ${REPORT_OUTPUT_FOLDER}" + ############################################# + # Print info on reports that were generated # + ############################################# + info "Contents of report folder:" + OUTPUT_CONTENTS_CMD=$(ls "${REPORT_OUTPUT_FOLDER}") + info "$REPORT_OUTPUT_FOLDER" fi ################################ From f5752cfd452938932ae445c664284d17e981b1df Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 18 Aug 2020 10:09:18 -0500 Subject: [PATCH 17/37] adding the right var --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index 075df623..09ae346c 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1034,7 +1034,7 @@ Reports() { ############################################# info "Contents of report folder:" OUTPUT_CONTENTS_CMD=$(ls "${REPORT_OUTPUT_FOLDER}") - info "$REPORT_OUTPUT_FOLDER" + info "$OUTPUT_CONTENTS_CMD" fi ################################ From 1395dcc55e9e6b11c6c3e351c437534efec821d3 Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Tue, 18 Aug 2020 10:40:14 -0500 Subject: [PATCH 18/37] Update upload-docker.sh --- .automation/upload-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index 9cb15ac9..b3b96007 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -142,7 +142,7 @@ ValidateInput() { # Need to see if GPR registry and update name # ############################################### if [[ ${REGISTRY} == "GPR" ]]; then - NAME="docker.pkg.github.com/${IMAGE_REPO}/super-linter" + NAME="containers.pkg.github.com/${IMAGE_REPO}/super-linter" IMAGE_REPO="${NAME}" info "Updated [IMAGE_REPO] to:[${IMAGE_REPO}] for GPR" fi From 721e6dbc7ef7b41147fbedecba1184e112a60337 Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Tue, 18 Aug 2020 10:41:20 -0500 Subject: [PATCH 19/37] Update upload-docker.sh --- .automation/upload-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index b3b96007..91ad532a 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -459,7 +459,7 @@ if [[ ${REGISTRY} == "Docker" ]]; then #################################### elif [[ ${REGISTRY} == "GPR" ]]; then # Authenticate "Username" "Password" "Url" "Name" - Authenticate "${GPR_USERNAME}" "${GPR_TOKEN}" "https://docker.pkg.github.com" "GitHub Package Registry" + Authenticate "${GPR_USERNAME}" "${GPR_TOKEN}" "https://containers.pkg.github.com" "GitHub Package Registry" else ######### From e1bc1df9e71680bde09f0d4f664108ba8b147928 Mon Sep 17 00:00:00 2001 From: assignUser Date: Tue, 18 Aug 2020 22:54:32 +0000 Subject: [PATCH 20/37] add latex support --- .automation/test/latex/README.md | 13 + .automation/test/latex/latex_bad_1.tex | 237 +++++++ .automation/test/latex/latex_bad_2.tex | 1 + .automation/test/latex/latex_good_1.tex | 237 +++++++ .automation/test/latex/latex_good_2.tex | 1 + .github/linters/chktexrc | 802 ++++++++++++++++++++++++ Dockerfile | 14 +- README.md | 4 +- TEMPLATES/chktexrc | 802 ++++++++++++++++++++++++ docs/disabling-linters.md | 43 ++ lib/buildFileList.sh | 22 +- lib/linter.sh | 26 +- lib/worker.sh | 1 + 13 files changed, 2190 insertions(+), 13 deletions(-) create mode 100644 .automation/test/latex/README.md create mode 100644 .automation/test/latex/latex_bad_1.tex create mode 100644 .automation/test/latex/latex_bad_2.tex create mode 100644 .automation/test/latex/latex_good_1.tex create mode 100644 .automation/test/latex/latex_good_2.tex create mode 100644 .github/linters/chktexrc create mode 100644 TEMPLATES/chktexrc diff --git a/.automation/test/latex/README.md b/.automation/test/latex/README.md new file mode 100644 index 00000000..d3369dcd --- /dev/null +++ b/.automation/test/latex/README.md @@ -0,0 +1,13 @@ +# LaTeX Test Cases +This folder holds the test cases for **LaTeX**. + +## Additional Docs +No Additional information is needed for this test case. + +## Good Test Cases +The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. +- **Note:** They are linted utilizing the default linter rules. + +## Bad Test Cases +The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. +- **Note:** They are linted utilizing the default linter rules. \ No newline at end of file diff --git a/.automation/test/latex/latex_bad_1.tex b/.automation/test/latex/latex_bad_1.tex new file mode 100644 index 00000000..8ab2af6d --- /dev/null +++ b/.automation/test/latex/latex_bad_1.tex @@ -0,0 +1,237 @@ +Note: This file was written with only two purposes in mind: + o To test the program upon it + o To show off some of the features + +Most of the file does thus consist of lots of pseudo-commands, which +are nonsense in a TeXnical manner. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Warning 1 + +\foo This is an error. +So is this \foo +\smallskip This is a not. $\foo Neither$ is this. + +\startsection[title={Testing ConTeXt}] +These should now be an error. +\stoptext + +% Warning 2 + +This is a faulty reference to \ref{foo} +This is not a faulty reference to~\ref{foo} + +% Warning 3 + +$[(ab)^{-1}]^{-2}$ is not beautiful +${{[{(ab)}^{-1}]}}^{-2}$ is beautiful + +% Warning 4-6, 28 + +Testing {\it italic} in \/ this {\em sentence\/}, as {\em you \/ see\/}. +Testing {\it italic\/} in this {\em sentence,} as {\em you see}. + +% LaTeX2e + +Testing \textem{italic} in \/ this \textit{sentence\/}, as \textem{you \/ see\/}. +Testing \textem{italic\/} in this \textit{sentence}, as \textem{you see}. + +% Warning 7 + +This \'is a test of $\hat{j}$ accents. +This \'{\i}s a test of $\hat{\jmath}$ accents. + +% Warning 8 + +It wasn't anything - just a 2---3 star--shots. +It wasn't anything --- just a 2--3 star-shots. +It's just a start-shot. +is also used to send cross-calls (xc) and cross-traps (xt) to other +% From Knuths TeXbook Chapter 14 +% "How TeX Breaks Paragraphs into Lines", fourth paragraph: +in plain TeX---are the key + +% Using DashExcpt +The Birch--Swinnerton-Dyer conjecture is correct. +The Birch--Swinnerton--Dyer conjecture is not correct. +The Birch-Swinnerton-Dyer conjecture is not correct (but not caught). + +% Warning 9-10 + +% Brackets: + +)}{[])} }}}]]]))) +{[]} ((([[[{{{}}}]]]))) + +% Envs: + +\begin{quux} \begin{baz} \end{quux} \end{baz} \end{asoi} \begin{dobedo} + +\begin{foo} \begin{bar} \end{bar}\end{foo} + +% Warning 11 + +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + +% Warning 12 + +1st. Foo Inc. Ab.cd. foo ab.cd. Foo. bar baz., billy.; bob.: joe.! frank.? james.. george +1st.\ foo Inc.\ ab.cd.\ foo ab.cd.\ Foo.\ bar baz., billy.; bob.:\ joe.!\ frank.?\ james..\ george + +% Warning 13 + +Look at THIS! It's an error. +Look at THIS\@! It's an error. D. E. Knuth. + +% Warning 14 + +\hat +\hat{a} + +% Warning 18,19 + +Is this an "example", or is it an �example�. +Is this an `example', or is it an `example'. + +% Warning 20 + +That bug is \unknown\ to me. +% That bug is \unknown\ to me. + +% Warning 21 + +\LaTeX\ is an extension of \TeX\. Right? +\LaTeX\ is an extension of \TeX. Right? + +% Warning 23 + +```Hello', I heard him said'', she remembered. +``\,`Hello', I heard him said'', she remembered. + +% Warning 24 + +Indexing text \index{text} is fun! +Indexing text\index{text} is fun! +Indexing text% + \index{text} is fun! +Indexing text + \index{text} is fun! + +% Warning 25 + +$5\cdot10^10$ +$5\cdot10^{10}$ + +% Warning 26 + +Do you understand ? +Do you understand? + +% Warning 27 + +\input latex_bad_2.tex +\input latex_bad_2 + +% Warning 29 +The program opens a screen sized 640x200 pixels +The program opens a screen sized $640\times200$ pixels + +% Warning 30 + +White is a beautiful colour. +White is a beautiful colour. + +% Warning 31 +\begin{verbatim} +\this is +\end{verbatim} foo bar + +% Warning 32-34 + +This is either an 'example`, an ''example`` or an `"`example'`'. +This is either an `example', an ``example'' or an ``example''. + +% Warning 35 + +$sin^2 + cos^2 = 1$ +$\sin^2 + \cos^2 = 1$ + +% Warning 36-37 + +This( an example( Nuff said )), illustrates( ``my'' )point. +This (an example (Nuff said)), illustrates (``my'') point. + +% Warning 38 +``An example,'' he said, ``would be great.'' +``An example'', he said, ``would be great''. + +% Warning 39 + +For output codes, see table ~\ref{tab:fmtout}. +For output codes, see table~\ref{tab:fmtout}. + +% Warning 40 +$\this,$ and $$this$$. +$\this$, and $$this.$$ + +% Warning 41 +foo \above qux +\frac{foo}{qux} + +% Warning 42 +This is a footnote \footnote{foo}. +This is a footnote\footnote{foo}. + +% Warning 43 +Here is a mistake $\left{x\right}$. +This one triggers warning 22 $\left\{x\right\}$. +Here \chktex\ doesn't complain $\left\lbrace x\right\rbrace$. + +% Warning 44 -- user regex -- default message +You should always write a good intro. +You should always write a good introduction. + +% Warning 44 -- user regex -- user message +For every $p\not|n$ you have an ugly prime which doesn't divide $n$. +For every $p\nmid n$ you have a cute prime which doesn't divide $n$. + +% Math mode check +\ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}} +Also, $x(3)\text{ is not x(3) but it is $x(3)$}$ + +This is\\% a comment. Nothing here should be checked(right)? +a broken line. +But this is not a \% comment, so we should find this error(right)? + +Here(on this line only)is a warning $sin(x)$ suppressed. % chktex 36 chktex 35 +Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 + +In section~\ref{sec:3} we have a warning. +In section~\ref{sec:4} it is suppressed. % chktex -1 +% In section~\ref{sec:5} we don't have a warning. + +\begin{tabular*}{1.0\linewidth}[h]{|c|cc|} + a & b \\ + \hline + c & d +\end{tabular*} + +% Verb check + +\verb@\this is )() lots of errors, etc. Or what?@ +\verb# + +\begin{verbatim} +\this is +\end{verbatim} FOO + +% Warning 16,15 + +$$( + +% Local Variables: +% require-final-newline: nil +% End: +% There should be no newline at the end of this file to test bug #46539 \ No newline at end of file diff --git a/.automation/test/latex/latex_bad_2.tex b/.automation/test/latex/latex_bad_2.tex new file mode 100644 index 00000000..76bc301f --- /dev/null +++ b/.automation/test/latex/latex_bad_2.tex @@ -0,0 +1 @@ +\this is a test of whether the file is actually inputted... diff --git a/.automation/test/latex/latex_good_1.tex b/.automation/test/latex/latex_good_1.tex new file mode 100644 index 00000000..9f00e6ff --- /dev/null +++ b/.automation/test/latex/latex_good_1.tex @@ -0,0 +1,237 @@ +Note: This file was written with only two purposes in mind: + o To test the program upon it + o To show off some of the features + +Most of the file does thus consist of lots of pseudo-commands, which +are nonsense in a TeXnical manner. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Warning 1 + +\foo\ This is an error. +So is this \foo\ +\smallskip This is a not. $\foo Neither$ is this. + +\startsection[title={Testing ConTeXt}] +These should now be an error. +\stopsection + +% Warning 2 + +%This is a faulty reference to~\ref{foo} +This is not a faulty reference to~\ref{foo} + +% Warning 3 + +%$[(ab)^{-1}]^{-2}$ is not beautiful +${{[{(ab)}^{-1}]}}^{-2}$ is beautiful + +% Warning 4-6, 28 + +%Testing {\it italic} in \/ this {\em sentence\/}, as {\em you \/ see\/}. +Testing {\it italic\/} in this {\em sentence,} as {\em you see}. + +% LaTeX2e + +%Testing \textem{italic} in \/ this \textit{sentence\/}, as \textem{you \/ see\/}. +Testing \textem{italic} in this \textit{sentence}, as \textem{you see}. + +% Warning 7 + +%This \'is a test of $\hat{j}$ accents. +This \'{\i}s a test of $\hat{\jmath}$ accents. + +% Warning 8 + +%It wasn't anything - just a 2---3 star--shots. +It wasn't anything --- just a 2--3 star-shots. +It's just a start-shot. +is also used to send cross-calls (xc) and cross-traps (xt) to other +% From Knuths TeXbook Chapter 14 +% "How TeX Breaks Paragraphs into Lines", fourth paragraph: +in plain TeX---are the key + +% Using DashExcpt +The Birch--Swinnerton-Dyer conjecture is correct. +%The Birch--Swinnerton--Dyer conjecture is not correct. +The Birch-Swinnerton-Dyer conjecture is not correct (but not caught). + +% Warning 9-10 + +% Brackets: + +%)}{[])} }}}]]]))) +{[]} ((([[[{{{}}}]]]))) + +% Envs: + +%\begin{quux} \begin{baz} \end{quux} \end{baz} \end{asoi} \begin{dobedo} + +\begin{foo} \begin{bar} \end{bar}\end{foo} + +% Warning 11 + +%Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + +% Warning 12 + +%1st. Foo Inc. Ab.cd. foo ab.cd. Foo. bar baz., billy.; bob.: joe.! frank.? james.. george +1st.\ foo Inc.\ ab.cd.\ foo ab.cd.\ Foo.\ bar baz., billy.; bob.:\ joe.!\ frank.?\ james..\ george + +% Warning 13 + +%Look at THIS! It's an error. +Look at THIS\@! It's an error. D. E. Knuth. + +% Warning 14 + +%\hat +\hat{a} + +% Warning 18,19 + +%Is this an "example", or is it an �example�. +Is this an `example', or is it an `example'. + +% Warning 20 + +%That bug is \unknown\ to me. +% That bug is \unknown\ to me. + +% Warning 21 + +\LaTeX\ is an extension of \TeX\. Right? +\LaTeX\ is an extension of \TeX. Right? + +% Warning 23 + +%```Hello', I heard him said'', she remembered. +``\,`Hello', I heard him said'', she remembered. + +% Warning 24 + +%Indexing text \index{text} is fun! +Indexing text\index{text} is fun! +Indexing text% + \index{text} is fun! +%Indexing text +% \index{text} is fun! + +% Warning 25 + +%$5\cdot10^10$ +$5\cdot10^{10}$ + +% Warning 26 + +%Do you understand ? +Do you understand? + +% Warning 27 + +\input laetx_good_2.tex +\input latex_good_2 + +% Warning 29 +%The program opens a screen sized 640x200 pixels +The program opens a screen sized $640\times200$ pixels + +% Warning 30 + +%White is a beautiful colour. +White is a beautiful colour. + +% Warning 31 +\begin{verbatim} +\this is +\end{verbatim} %foo bar + +% Warning 32-34 + +%This is either an 'example`, an ''example`` or an `"`example'`'. +This is either an `example', an ``example'' or an ``example''. + +% Warning 35 + +%$sin^2 + cos^2 = 1$ +$\sin^2 + \cos^2 = 1$ + +% Warning 36-37 + +%This( an example( Nuff said )), illustrates( ``my'' )point. +This (an example (Nuff said)), illustrates (``my'') point. + +% Warning 38 +%``An example,'' he said, ``would be great.'' +``An example'', he said, ``would be great''. + +% Warning 39 + +%For output codes, see table ~\ref{tab:fmtout}. +For output codes, see table~\ref{tab:fmtout}. + +% Warning 40 +%$\this,$ and $$this$$. +$\this$, and \[this.\] + +% Warning 41 +%foo \above\ qux +\frac{foo}{qux} + +% Warning 42 +%This is a footnote \footnote{foo}. +This is a footnote\footnote{foo}. + +% Warning 43 +%Here is a mistake $\left{x\right}$. +%This one triggers warning 22 $\left\{x\right\}$. +Here \chktex\ doesn't complain $\left\lbrace x\right\rbrace$. + +% Warning 44 -- user regex -- default message +%You should always write a good intro. +You should always write a good introduction. + +% Warning 44 -- user regex -- user message +%For every $p\not|n$ you have an ugly prime which doesn't divide $n$. +For every $p\nmid n$ you have a cute prime which doesn't divide $n$. + +% Math mode check +\ensuremath{\sin\ x\text{is not the same as \sin\ x, but is the same as $\sin x$}} +Also, $x(3)\text{ is not x (3) but it is $x(3)$}$ + +This is\\% a comment. Nothing here should be checked(right)? +a broken line. +But this is not a \% comment, so we should find this error (right)? + +Here(on this line only)is a warning $sin(x)$ suppressed. % chktex 36 chktex 35 +%Here (on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 + +%In section~\ref{sec:3} we have a warning. +In section~\ref{sec:4} it is suppressed. % chktex -1 +% In section~\ref{sec:5} we don't have a warning. + +% \begin{tabular*}{1.0\linewidth}[h]{|c|cc|} +% a & b \\ +% \hline +% c & d +% \end{tabular*} + +% Verb check + +\verb@\this is )() lots of errors, etc. Or what?@ +%\verb# + +\begin{verbatim} +\this is +\end{verbatim} + +% Warning 16,15 + +\[\] + +% Local Variables: +% require-final-newline: nil +% End: +% There should be no newline at the end of this file to test bug #46539 diff --git a/.automation/test/latex/latex_good_2.tex b/.automation/test/latex/latex_good_2.tex new file mode 100644 index 00000000..b8e263a9 --- /dev/null +++ b/.automation/test/latex/latex_good_2.tex @@ -0,0 +1 @@ +\this\ is a test of whether the file is actually inputted\ldots diff --git a/.github/linters/chktexrc b/.github/linters/chktexrc new file mode 100644 index 00000000..98750c47 --- /dev/null +++ b/.github/linters/chktexrc @@ -0,0 +1,802 @@ +## +## ChkTeX, example resource file for ChkTeX. +## Copyright (C) 1995-96 Jens T. Berger Thielemann +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +## +## Contact the author at: +## Jens Berger +## Spektrumvn. 4 +## N-0666 Oslo +## Norway +## E-mail: +## + +##################################################################### +# +# Note: The format has changed slightly (again). The { ... } +# syntax does now mean case-sensitive comparing, while [ ... ] means +# case-insensitive comparing of the keywords. Case-insensitive +# comparing of the keywords is only supported on a few of the +# keywords (it's not meaningful in all contexts, and it slows ChkTeX +# down). Keywords supporting this are marked throughout the file. +# +# You may also reset a list by saying "KEYWORD = { ... }"; it will +# then be set equal to the contents of the list you specify. +# +# Comments begin with `#', and continues for the rest of the line. +# Blank lines plus leading and trailing spaces are of course ignored. +# +# The general format of this file is the following: +# +# KEYWORD { item item ...} [ item item ... ] /* Adds items */ +# +# KEYWORD [ item item ...] { item item ... } /* Adds items */ +# +# KEYWORD = item +# +# KEYWORD = { item item ... } /* Clears list before adding */ +# +# KEYWORD = [ item item ... ] /* Clears list before adding */ +# +# This does _not_ mean that you may alternate the forms; certain +# keywords demands a list, other a single value. You thus have to +# look at the examples of their use. +# +# Please also note that if you specify a list-keyword twice, we'll +# concatenate the lists. If you specify a item-keyword twice, we'll +# kill the previous value. +# +# We are slightly context-sensitive when detecting tokens like "}" +# and "]"; they have to be preceded by a space. This generally makes +# life easier. +# +# Items are separated by spaces. Newlines are considered as spaces, +# but can't be escaped. You may surround items with quotes (`"') to +# easily put spaces into them. +# +# Escape sequences available: +# +# Sequence Resulting character +# ! A space (type `! ', not just a exclamation mark) +# !" " +# !# # +# !! ! +# !{ { +# !} } +# ![ [ +# !] ] +# != = +# !b Backspace +# !n New line +# !r Carriage return +# !t Tab +# !f Form feed +# !xNN NN must be a hexadecimal number (00 - ff), +# _both_ characters must be included. +# !dNNN DDD must be a decimal number (000 - 255), all +# three characters must be included. Unspecified +# results if DDD > 255. +# !NNN DDD must be a octal number (000 - 377), all +# three characters must be included. Unspecified +# results if DDD > 377. +# +# Minor note: As you can see, most of these escape sequences are +# equal to those in C (with some extensions); however, we use ! +# instead of \ as escape character for obvious reasons. +# +# +# Quick summary of keywords follows. Keywords marked with a * accept +# keywords accepting case-insensitive lists. +# +# Abbrev* - A list of abbreviations not automatically caught. +# CenterDots - Commands/characters which should have \cdots in +# between. +# CmdLine - Default commandline options. These will be +# processed before the ones you give on the command +# line. +# HyphDash \ +# NumDash - Number of dashes allowed in different contexts. +# WordDash / +# IJAccent - Commands which puts an accent _over_ their +# argument. +# Italic - Commands immediately turning on italic mode. +# ItalCmd - Commands putting their argument into italic. +# Linker - Commands which should have a non-breaking space in +# front. +# LowDots - Commands/characters which should have \ldots in +# between. +# MathEnvir - Environments which turn on math mode. +# MathCmd - Commands which turn on math mode. +# TextCmd - Commands which turn off math mode. +# MathRoman - Mathematical operators with LaTeX replacement +# defined. +# NoCharNext - Insists on that certain commands aren't followed by +# certain characters. +# NonItalic - Commands immediately turning off italic mode. +# NotPreSpaced- Commands which should not have a space in front of +# them. +# Primitives - Primitive TeX commands. +# PostLink - Commands which generates a page reference. +# OutFormat - Formats to use for output. See the -f & -v switch +# in the main doc. +# QuoteStyle - Either "Traditional" or "Logical". See main doc, +# warning 38. +# Silent - These commands do not produce any textual output; +# and are thus allowed to have a space after them. +# TabSize - Tab size you are using. +# TeXInputs - Paths to search \input and \include files for. +# UserWarn* - These strings will be searched for throughout the +# text. +# VerbEnvir - Environments which contents should be ignored. +# VerbClear - String we will overwrite unwanted data with. +# WipeArg - Commands (with arguments) which should be ignored +# in the checking. +# + + +##################################################################### +# +# Enter which type of quote-style you are using here. Currently, we +# support the following styles: +# +# Style Example of use +# Traditional "An example," he said, "would be great." +# Logical "An example", he said, "would be great". +# + +QuoteStyle = Logical + +##################################################################### +# +# Enter here what interval you have between your tabs. Only regular +# intervals are supported. +# + +TabSize = 8 + +##################################################################### +# +# Here, you can put default commandline options; most users would for +# instance like to put -v2 here. +# + +CmdLine +{ + -v2 +} + +##################################################################### +# +# These patterns will be searched for through the text; no matter +# whether they appear as normal text, commands or whatever. +# Currently case-sensitive. They are not found in comments. +# +# I usually define a special command like this: +# +# \def\unknown{\large\bf??} +# +# which I use whenever there is some information I don't have at the +# moment of writing. Thus, it makes sense to search for it. +# +# You should be able to develop your own uses for this. +# + +UserWarn +{ + + \unknown +### +# +# Another example; one should write \chktex or Chk\TeX - never ChkTeX. +# +### + + ChkTeX +} +[ + +### +# +# You may put case-insensitive patterns here. +# +### + +] + + +### +# +# These patterns will be searched for, no matter whether they appear +# as normal text, commands or arguments. However, they will _not_ +# match in verbatim environments. +# +# Remember that you have to escape (with a !) the following +# characters: "#!= as well as spaces and {}[] if they are proceeded by +# a space. +# +# Since these are PCRE regular expressions, you can use (?i) to make +# the expression case insensitive. See the man pages (man pcresyntax) +# or the nicely formatted http://perldoc.perl.org/perlre.html for +# documentation on the regular expression syntax. Note however that +# some the features of perl regular expression are not available such +# as running code (callouts), and replacing. +# +# An initial PCRE comment (?# ... ) can be used change what is +# displayed, thereby reminding yourself how to fix the problem. +# +### +UserWarnRegex +{ + + (?!#Always! use! \nmid)\\not! *(\||\\mid) + + # capitalize section when saying Section 6. + (?!#-1:Capitalize! before! references)PCRE:\b(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref + (?!#1:Capitalize! before! references)POSIX:([^[:alnum:]]|^)(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref + + # spell it out. + # PCRE:(?i)\bintro\b(?!#Spell! it! out.! This! comment! is! not! used.) + # POSIX:([^[:alnum:]]|^)intro([^[:alnum:]]|$) + + # Pretty tables--see http://texdoc.net/texmf-dist/doc/latex/booktabs/booktabs.pdf + (?!#-2:Use! \toprule,! midrule,! or! \bottomrule! from! booktabs)\\hline + # This relies on it being on a single line, and not having anything + # else on that line. With PCRE we could match balanced [] and {}, + # but I wonder if it's worth the complexity... + (?!#-2:Vertical! rules! in! tables! are! ugly)\\begin\{(array|tabularx?\*?)\}(\[.*\])?\{.*\|.*\} + +} + + +##################################################################### +# +# Here you can list the path of where ChkTeX should look for files it +# \inputs. The // postfix is now supported; if you append a double +# path-separator we'll recursively search that directory directories. +# MS-DOS users must append \\ instead, e.g. "C:\EMTEX\\". +# +# If you under either MS-DOS or UNIX wish to search an entire +# partition or the complete directory tree, you must use *three* +# slashes, e.g. "c:\\\" or "///". This may be considered to be a bug. +# +# By default, we'll search the current directory (not recursively, +# put "//" in the list for this); any paths specified below will be +# searched in addition to this. +# + +TeXInputs +{ + +} + +##################################################################### +# +# Here you may specify more output formats for use with the -v option, +# it simply indexes into this list. Remember to use ! instead of \, +# though. +# +# For explanation of how % fields expand; look at ChkTeX.{dvi,ps,pdf}. +# +# We will by default select entry number _two_ in this list (we count +# from 0), and -v without any parameter selects entry number _three_. +# + +OutFormat +{ + +# -v0; silent mode +%f%b%l%b%c%b%n%b%m!n + +# -v1; normal mode +"%k %n in %f line %l: %m!n%r%s%t!n%u!n" + +# -v2; fancy mode +"%k %n in %f line %l: %m!n%r%i%s%I%t!n!n" + +# -v3; lacheck mode +"!"%f!", line %l: %m!n" + +# -v4; verbose lacheck mode +"!"%f!", line %l: %m!n%r%s%t!n%u!n" + +# -v5; no line number, ease auto-test +"%k %n in %f: %m!n%r%s%t!n%u!n" + +# -v6; emacs compilation mode +"!"%f!", line %l.%c:(#%n) %m!n" + +} + + + +##################################################################### +# +# These commands should be ignored when detecting whether a command +# is ended by a space. You can specify regular expressions in the [] +# section in case you have many custom macros that can be safely +# terminated with a space. +# + +Silent +{ + \rm \em \bf \it \sl \sf \sc \tt \selectfont + \rmfamily \sffamily \ttfamily \mdseries \bfseries + \slshape \scshape \relax + \vskip \pagebreak \nopagebreak + + \textrm \textem \textbf \textit \textsl \textsf \textsc \texttt + + \clearpage \ddots \dotfill \flushbottom \fussy \indent \linebreak + \onecolumn \pagebreak \pushtabs \poptabs \scriptsize \sloppy + \twocolumn \vdots + \today \kill \newline \thicklines \thinlines + + \columnsep \space \item \tiny \footnotesize \small \normalsize + \normal \large \Large \LARGE \huge \Huge \printindex + + \newpage \listoffigures \listoftables \tableofcontents + \maketitle \makeindex + + \hline \hrule \vrule + + \centering + + \bigskip \medskip \smallskip + + \noindent \expandafter + + \makeatletter \makeatother + + \columnseprule + + \textwidth \textheight \hsize \vsize + + \if \fi \else + + \csname \endcsname + + \z@ \p@ \@warning \typeout + + \dots \ldots \input \endinput \nextline \leavevmode \cdots + \appendix \listfiles \and \quad + \hskip \vfill \vfil \hfill \hfil \topmargin \oddsidemargin + \frenchspacing \nonfrenchspacing + \begingroup \endgroup \par + + \vrefwarning \upshape \headheight \headsep \hoffset \voffset + \cdot \qquad + \left \right + \qedhere + + \xspace + + \addlinespace \cr \fill \frontmatter + \toprule \midrule \bottomrule + +}[ +# Here you can put regular expressions to match Silent macros. It was +# designed for the case where you have many custom macros sharing a +# common prefix, but can of course be used for other things. + +# Support ConTeXt to at least some extent +\\start.* \\stop.* + +] + +##################################################################### +# +# Here, you can specify the length of various dashes. We sort the +# dash according to which type of characters that are on the left and +# right of it. We are only conclusive if they are the same. +# +# We associate as follows: +# +# Name Type of character on each side +# HyphDash Alphabetic (foo-bar) +# NumDash Numeric (2--3) +# WordDash Space (like this --- see?) +# +# Below you specify how many dashes which are legal in each case. We +# define 0 as a magic constant which always generates an error. You +# may specify more than one legal dash-length. +# +# Let's look at an example. You use the following dash-syntax: +# +# foo-bar +# 2--3 +# like this---see? +# +# +# HYPHDASH { 1 3 } # Either a hyphen, or inter-word +# NUMDASH { 2 } # Between words +# WORDDASH { 0 } # We never use this +# + +HyphDash +{ + 1 3 +} + +NumDash +{ + 2 +} + +WordDash +{ + 3 +} + +##################################################################### +# +# Here are exceptions to the dash rules above. For example, an +# n-dash -- between words is usually wrong, but in some cases it is +# correct, such as when naming a theorem. The Birch--Swinnerton-Dyer +# conjecture is one example where the difference matters. You can +# tell that Birch is one person and Swinnerton-Dyer is another. +# +# Adding line suppressions for these is possible, but can quickly +# become tedious if a certain theorem is referenced often. For this +# reason exceptions can be specified here. They are case-sensitive. +# + +DashExcpt +{ + Birch--Swinnerton-Dyer +} + +##################################################################### +# +# This keyword indicates commands whose argument isn't LaTeX code, +# and thus should be ignored. +# +# After the command, you may place arguments that you wish that +# should be wiped in the process; use [] for optional arguments, {} +# for required ones and * if the command supports an alternative +# variant. These should be separated from the command with a colon. +# Some commands (e.g. \cmidrule) use () to delimit and optional +# argument and so this syntax is supported as well. +# +# For instance, if you would like to wipe the \newcommand command, +# you would declare it as \newcommand:*[][]{} +# +# These commands may be "executed" before they're wiped, so you will +# typically also wish to list filehandling commands and similar here. +# + +WipeArg +{ + \label:{} \ref:{} \eqref:{} \vref:{} \pageref:{} \index:[]{} + \cite:[][]{} \nocite:{} + \input:{} \verbatiminput:[]{} \listinginput:[]{}{} + \verbatimtabinput:[]{} \include:{} \includeonly:{} + \bibitem:[]{} + \cline:{} \cmidrule:[](){} + \href:{}{} + # Cleveref -- there are many others that could be here as well... + \cref:*{} \cpageref:*{} \crefrange:*{}{} \cpagerefrange:*{}{} + \Cref:*{} \Cpageref:*{} \Crefrange:*{}{} \Cpagerefrange:*{}{} + # natbib + \citet:*[][]{} \citep:*[][]{} \citealt:*{} \citealp:*[]{} \citeauthor:*{} + \Citet:*[][]{} \Citep:*[][]{} \Citealt:*{} \Citealp:*[]{} \Citeauthor:{} + \citetext:{} \citeyear:*{} \citeyearpar:{} + # tipa which uses " + \textipa:{} +} + +##################################################################### +# +# These environments contain material which will be typeset as +# mathematics by LaTeX. This turns on/off some warnings. +# +# We will automagically append a * to each keyword. +# + +MathEnvir +{ + displaymath math eqnarray array equation + align alignat gather flalign multline +} + +##################################################################### +# +# These commands contain material which will be typeset as mathematics +# by LaTeX. The commands are assumed to have one mandatory argument +# which is in math mode. This turns on/off some warnings. +# + +MathCmd +{ + \ensuremath +} + +##################################################################### +# +# These commands contain material which will _not_ be typeset as +# mathematics by LaTeX even if it would otherwise be in mathmode. The +# commands are assumed to have one mandatory argument which is in text +# mode. This turns on/off some warnings. +# + +TextCmd +{ + \text \intertext \shortintertext \mbox +} + +##################################################################### +# +# These environments contains material which contents should be +# ignored. +# +# We will automagically append a * to each keyword. +# + +VerbEnvir +{ + verbatim comment listing verbatimtab rawhtml errexam picture texdraw + filecontents pgfpicture tikzpicture minted lstlisting IPA ignore +} + +##################################################################### +# +# ChkTeX does automagically catch most abbreviations; the ones we +# need to list here, are those which are most likely to be followed +# by a word with an upper-case letter (that is not the beginning of a +# new sentence). +# +# The case-insensitive abbreviations are not really case-insensitive, +# it seems to be more practical to only let the first character be +# case-insensitive, while the remaining are case-sensitive. +# +# To speed up the searching process somewhat, we require that these +# end in a `.', this should not be a problem. +# +# Much of this work (both the abbreviations below, and the regexps +# necessary to catch the remaining automatically) have been provided +# by Russ Bubley, . +# + +Abbrev +{ +# Ordinals +1st. 2nd. 3rd. 4th. +# Titles +Mr. Mrs. Miss. Ms. Dr. Prof. St. + +# +# Days +# Mon. Tue. Wed. Thu. Fri. Sat. Sun. +# +# Months +# Jan. Feb. Mar. Apr. May. Jun. Jul. Aug. Sep. Oct. Nov. Dec. +# +# Letters +# Kt. Jr. +# +# Corporate +# Co. Ltd. +# +# Addresses +# Rd. Dr. St. Ave. Cres. Gdns. Sq. Circ. Terr. Pl. Arc. La. Clo. Ho. Est. Gn. +# +# Misc. +# oe. pbab. ps. rsvp. Tx. +} +[ +### +# +# The first letter is case-insensitive in the abbrevs in this +# list. Due to the nature of the checking algorithm used for +# this, entries consisting of only one character will be +# silently ignored. +# +## + +# Latin +# cf. "et al." etc. qed. qv. viz. +# +# Corporate +# inc. plc. +# +# Misc +# fax. pcs. qty. tel. misc. +] + +##################################################################### +# +# Commands which accent characters, meaning that \i or \j (\imath and +# \jmath in mathmode) should be used instead of `i' and `j' +# + +IJAccent +{ + \hat \check \breve \acute \grave \tilde \bar \vec \dot \ddot + + \' \` \^ \" \~ \= \. \u \v \H \t + +### +# +# The remaining accent commands (\c,\d,\b) put their accent _under_ +# the character, not above, and should thus be used with normal i's +# and j's. +# +### + +} + +##################################################################### +# +# Commands which, when the group is terminated, needs italic +# correction. +# + +Italic +{ + \it \em \sl + \itshape \slshape +} + +##################################################################### +# +# Commands which makes the font non-italic. +# + +NonItalic +{ + \bf \rm \sf \tt \sc + \upshape +} + +##################################################################### +# +# Commands which put their argument into italic (and thus possibly +# needs italic correction in the end). +# +# This is currently empty, since \textit, \textsl and \emph do that +# automatically. +# + +ItalCmd +{ +} + +##################################################################### +# +# These commands all have in common that a pagebreak right in front +# of them is highly undesirable; thus there should be no space in +# front of them. +# + +PostLink +{ + \index \label +} + +##################################################################### +# +# These commands should not have a space in front of them for various +# reasons. I.e. much the same as POSTLINK, but produces another +# warning. +# + +NotPreSpaced +{ + \footnote \footnotemark \/ +} + +##################################################################### +# +# The commands listed here, should be prepended with a `~', as in +# "look in table~\ref{foo}", to avoid the references being split +# across lines. +# + +Linker +{ + \ref \vref \pageref \eqref \cite +} + +##################################################################### +# +# Commands/characters which should have \cdots in between, e.g. +# $1+2+3+\cdots+n$. +# + +CenterDots +{ + = + - \cdot \div & \times \geq \leq < > +} + +##################################################################### +# +# Commands/characters which should have \ldots in between, e.g. +# $1,2,3,\ldots,n$. +# + +LowDots +{ + . , ; +} + +##################################################################### +# +# In maths mode, there are certain aliases for mathematical operators +# like sin, cos, etc. Ignore the leading backslash in the commands, +# and so forth. You should list these below. +# + +MathRoman +{ + log lg ln lim limsup liminf sin arcsin sinh cos arccos cosh tan + arctan tanh cot coth sec csc max min sup inf arg ker dim hom det + exp Pr gcd deg bmod pmod mod +} + +##################################################################### +# +# These TeX commands have become unnecessary, as there are LaTeX +# commands that does the same. Purists should thus avoid these in +# their code. +# +# (These are a spell-corrected version of those lacheck uses). +# + +Primitives +{ + \above \advance \catcode \chardef \closein \closeout \copy \count + \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide + \expandafter \font \hskip \vskip \openout +} + +##################################################################### +# +# Format: \command:characters +# +# We'll emit a warning if any of characters are found after the +# command. +# + +NoCharNext +{ + \left:{}$ \right:{}$ +} + +##################################################################### +# +# We're killing \verb@...@ commands and the arguments of the commands +# listed above in WipeArg by overwriting them with a string or a +# single character. +# +# This should not contain an alphabetic character (in case the user +# writes (\foo\verb@bar@), neither should it contain be one of +# LaTeX's reserved characters (`#$%&~_^\{}'), or any parenthesis +# character ('()[]{}'). If possible, don't use a punctuation +# character, either, or any spacing character. +# +# The asterisk is also unsuitable, as some commands behave in another +# way if they are appended with an asterisk. Which more or less +# leaves us with the pipe. +# +# Please note that this may also be a _string_, which will be +# repeated until the proper length is reached. +# + +VerbClear = "|" + +# +# All for now - have fun. +# +##################################################################### diff --git a/Dockerfile b/Dockerfile index f57d8573..4a072c0c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,6 +59,7 @@ RUN apk add --update --no-cache \ gcc \ git git-lfs\ go \ + gnupg \ icu-libs \ jq \ libc-dev libxml2-dev libxml2-utils \ @@ -73,7 +74,7 @@ RUN apk add --update --no-cache \ R \ readline-dev \ ruby ruby-dev ruby-bundler ruby-rdoc \ - gnupg + zip ######################################## # Copy dependencies files to container # @@ -248,6 +249,16 @@ RUN luarocks install luacheck COPY --from=lintr-lib /usr/lib/R/library/ /home/r-library RUN R -e "install.packages(list.dirs('/home/r-library',recursive = FALSE), repos = NULL, type = 'source')" +################## +# Install chktex # +################## +RUN wget --tries=5 http://mirrors.ctan.org/support/chktex.zip -O chktex.zip -q \ + && unzip chktex.zip \ + && cd chktex \ + && ./configure && make \ + && mv chktex /usr/bin \ + && cd .. && rm -rf chktex* + ########################################### # Load GitHub Env Vars for GitHub Actions # ########################################### @@ -288,6 +299,7 @@ ENV ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ VALIDATE_JAVASCRIPT_STANDARD=${VALIDATE_JAVASCRIPT_STANDARD} \ VALIDATE_JSON=${VALIDATE_JSON} \ VALIDATE_KOTLIN=${VALIDATE_KOTLIN} \ + VALIDATE_LATEX=${VALIDATE_LATEX} \ VALIDATE_LUA=${VALIDATE_LUA} \ VALIDATE_MD=${VALIDATE_MD} \ VALIDATE_OPENAPI=${VALIDATE_OPENAPI} \ diff --git a/README.md b/README.md index fd917855..dd7b43b4 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base | **JavaScript** | [eslint](https://eslint.org/) [standard js](https://standardjs.com/) | | **JSON** | [jsonlint](https://github.com/zaach/jsonlint) | | **Kotlin** | [ktlint](https://github.com/pinterest/ktlint) | +| **LaTeX** | [ChkTex](https://www.nongnu.org/chktex/) | | **Lua** | [luacheck](https://github.com/luarocks/luacheck) | | **Markdown** | [markdownlint](https://github.com/igorshubovych/markdownlint-cli#readme) | | **OpenAPI** | [spectral](https://github.com/stoplightio/spectral) | @@ -214,6 +215,7 @@ But if you wish to select or exclude specific linters, we give you full control | **VALIDATE_JSON** | `true` | Flag to enable or disable the linting process of the JSON language. | | **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: eslint) | | **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the Kotlin language. | +| **VALIDATE_LATEX** | `true` | Flag to enable or disable the linting process of the LaTeX language. | | **VALIDATE_LUA** | `true` | Flag to enable or disable the linting process of the language. | | **VALIDATE_MD** | `true` | Flag to enable or disable the linting process of the Markdown language. | | **VALIDATE_OPENAPI** | `true` | Flag to enable or disable the linting process of the OpenAPI language. | @@ -228,7 +230,7 @@ But if you wish to select or exclude specific linters, we give you full control | **VALIDATE_PYTHON_PYLINT** | `true` | Flag to enable or disable the linting process of the Python language. (Utilizing: pylint) | | **VALIDATE_PYTHON_FLAKE8** | `true` | Flag to enable or disable the linting process of the Python language. (Utilizing: flake8) | | **VALIDATE_POWERSHELL** | `true` | Flag to enable or disable the linting process of the Powershell language. | -| **VALIDATE_R** | `true` | Flag to enable or disable the linting process of the R language. | +| **VALIDATE_R** | `true` | Flag to enable or disable the linting process of the R language. | | **VALIDATE_RAKU** | `true` | Flag to enable or disable the linting process of the Raku language. | | **VALIDATE_RUBY** | `true` | Flag to enable or disable the linting process of the Ruby language. | | **VALIDATE_STATES** | `true` | Flag to enable or disable the linting process for AWS States Language. | diff --git a/TEMPLATES/chktexrc b/TEMPLATES/chktexrc new file mode 100644 index 00000000..98750c47 --- /dev/null +++ b/TEMPLATES/chktexrc @@ -0,0 +1,802 @@ +## +## ChkTeX, example resource file for ChkTeX. +## Copyright (C) 1995-96 Jens T. Berger Thielemann +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +## +## Contact the author at: +## Jens Berger +## Spektrumvn. 4 +## N-0666 Oslo +## Norway +## E-mail: +## + +##################################################################### +# +# Note: The format has changed slightly (again). The { ... } +# syntax does now mean case-sensitive comparing, while [ ... ] means +# case-insensitive comparing of the keywords. Case-insensitive +# comparing of the keywords is only supported on a few of the +# keywords (it's not meaningful in all contexts, and it slows ChkTeX +# down). Keywords supporting this are marked throughout the file. +# +# You may also reset a list by saying "KEYWORD = { ... }"; it will +# then be set equal to the contents of the list you specify. +# +# Comments begin with `#', and continues for the rest of the line. +# Blank lines plus leading and trailing spaces are of course ignored. +# +# The general format of this file is the following: +# +# KEYWORD { item item ...} [ item item ... ] /* Adds items */ +# +# KEYWORD [ item item ...] { item item ... } /* Adds items */ +# +# KEYWORD = item +# +# KEYWORD = { item item ... } /* Clears list before adding */ +# +# KEYWORD = [ item item ... ] /* Clears list before adding */ +# +# This does _not_ mean that you may alternate the forms; certain +# keywords demands a list, other a single value. You thus have to +# look at the examples of their use. +# +# Please also note that if you specify a list-keyword twice, we'll +# concatenate the lists. If you specify a item-keyword twice, we'll +# kill the previous value. +# +# We are slightly context-sensitive when detecting tokens like "}" +# and "]"; they have to be preceded by a space. This generally makes +# life easier. +# +# Items are separated by spaces. Newlines are considered as spaces, +# but can't be escaped. You may surround items with quotes (`"') to +# easily put spaces into them. +# +# Escape sequences available: +# +# Sequence Resulting character +# ! A space (type `! ', not just a exclamation mark) +# !" " +# !# # +# !! ! +# !{ { +# !} } +# ![ [ +# !] ] +# != = +# !b Backspace +# !n New line +# !r Carriage return +# !t Tab +# !f Form feed +# !xNN NN must be a hexadecimal number (00 - ff), +# _both_ characters must be included. +# !dNNN DDD must be a decimal number (000 - 255), all +# three characters must be included. Unspecified +# results if DDD > 255. +# !NNN DDD must be a octal number (000 - 377), all +# three characters must be included. Unspecified +# results if DDD > 377. +# +# Minor note: As you can see, most of these escape sequences are +# equal to those in C (with some extensions); however, we use ! +# instead of \ as escape character for obvious reasons. +# +# +# Quick summary of keywords follows. Keywords marked with a * accept +# keywords accepting case-insensitive lists. +# +# Abbrev* - A list of abbreviations not automatically caught. +# CenterDots - Commands/characters which should have \cdots in +# between. +# CmdLine - Default commandline options. These will be +# processed before the ones you give on the command +# line. +# HyphDash \ +# NumDash - Number of dashes allowed in different contexts. +# WordDash / +# IJAccent - Commands which puts an accent _over_ their +# argument. +# Italic - Commands immediately turning on italic mode. +# ItalCmd - Commands putting their argument into italic. +# Linker - Commands which should have a non-breaking space in +# front. +# LowDots - Commands/characters which should have \ldots in +# between. +# MathEnvir - Environments which turn on math mode. +# MathCmd - Commands which turn on math mode. +# TextCmd - Commands which turn off math mode. +# MathRoman - Mathematical operators with LaTeX replacement +# defined. +# NoCharNext - Insists on that certain commands aren't followed by +# certain characters. +# NonItalic - Commands immediately turning off italic mode. +# NotPreSpaced- Commands which should not have a space in front of +# them. +# Primitives - Primitive TeX commands. +# PostLink - Commands which generates a page reference. +# OutFormat - Formats to use for output. See the -f & -v switch +# in the main doc. +# QuoteStyle - Either "Traditional" or "Logical". See main doc, +# warning 38. +# Silent - These commands do not produce any textual output; +# and are thus allowed to have a space after them. +# TabSize - Tab size you are using. +# TeXInputs - Paths to search \input and \include files for. +# UserWarn* - These strings will be searched for throughout the +# text. +# VerbEnvir - Environments which contents should be ignored. +# VerbClear - String we will overwrite unwanted data with. +# WipeArg - Commands (with arguments) which should be ignored +# in the checking. +# + + +##################################################################### +# +# Enter which type of quote-style you are using here. Currently, we +# support the following styles: +# +# Style Example of use +# Traditional "An example," he said, "would be great." +# Logical "An example", he said, "would be great". +# + +QuoteStyle = Logical + +##################################################################### +# +# Enter here what interval you have between your tabs. Only regular +# intervals are supported. +# + +TabSize = 8 + +##################################################################### +# +# Here, you can put default commandline options; most users would for +# instance like to put -v2 here. +# + +CmdLine +{ + -v2 +} + +##################################################################### +# +# These patterns will be searched for through the text; no matter +# whether they appear as normal text, commands or whatever. +# Currently case-sensitive. They are not found in comments. +# +# I usually define a special command like this: +# +# \def\unknown{\large\bf??} +# +# which I use whenever there is some information I don't have at the +# moment of writing. Thus, it makes sense to search for it. +# +# You should be able to develop your own uses for this. +# + +UserWarn +{ + + \unknown +### +# +# Another example; one should write \chktex or Chk\TeX - never ChkTeX. +# +### + + ChkTeX +} +[ + +### +# +# You may put case-insensitive patterns here. +# +### + +] + + +### +# +# These patterns will be searched for, no matter whether they appear +# as normal text, commands or arguments. However, they will _not_ +# match in verbatim environments. +# +# Remember that you have to escape (with a !) the following +# characters: "#!= as well as spaces and {}[] if they are proceeded by +# a space. +# +# Since these are PCRE regular expressions, you can use (?i) to make +# the expression case insensitive. See the man pages (man pcresyntax) +# or the nicely formatted http://perldoc.perl.org/perlre.html for +# documentation on the regular expression syntax. Note however that +# some the features of perl regular expression are not available such +# as running code (callouts), and replacing. +# +# An initial PCRE comment (?# ... ) can be used change what is +# displayed, thereby reminding yourself how to fix the problem. +# +### +UserWarnRegex +{ + + (?!#Always! use! \nmid)\\not! *(\||\\mid) + + # capitalize section when saying Section 6. + (?!#-1:Capitalize! before! references)PCRE:\b(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref + (?!#1:Capitalize! before! references)POSIX:([^[:alnum:]]|^)(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref + + # spell it out. + # PCRE:(?i)\bintro\b(?!#Spell! it! out.! This! comment! is! not! used.) + # POSIX:([^[:alnum:]]|^)intro([^[:alnum:]]|$) + + # Pretty tables--see http://texdoc.net/texmf-dist/doc/latex/booktabs/booktabs.pdf + (?!#-2:Use! \toprule,! midrule,! or! \bottomrule! from! booktabs)\\hline + # This relies on it being on a single line, and not having anything + # else on that line. With PCRE we could match balanced [] and {}, + # but I wonder if it's worth the complexity... + (?!#-2:Vertical! rules! in! tables! are! ugly)\\begin\{(array|tabularx?\*?)\}(\[.*\])?\{.*\|.*\} + +} + + +##################################################################### +# +# Here you can list the path of where ChkTeX should look for files it +# \inputs. The // postfix is now supported; if you append a double +# path-separator we'll recursively search that directory directories. +# MS-DOS users must append \\ instead, e.g. "C:\EMTEX\\". +# +# If you under either MS-DOS or UNIX wish to search an entire +# partition or the complete directory tree, you must use *three* +# slashes, e.g. "c:\\\" or "///". This may be considered to be a bug. +# +# By default, we'll search the current directory (not recursively, +# put "//" in the list for this); any paths specified below will be +# searched in addition to this. +# + +TeXInputs +{ + +} + +##################################################################### +# +# Here you may specify more output formats for use with the -v option, +# it simply indexes into this list. Remember to use ! instead of \, +# though. +# +# For explanation of how % fields expand; look at ChkTeX.{dvi,ps,pdf}. +# +# We will by default select entry number _two_ in this list (we count +# from 0), and -v without any parameter selects entry number _three_. +# + +OutFormat +{ + +# -v0; silent mode +%f%b%l%b%c%b%n%b%m!n + +# -v1; normal mode +"%k %n in %f line %l: %m!n%r%s%t!n%u!n" + +# -v2; fancy mode +"%k %n in %f line %l: %m!n%r%i%s%I%t!n!n" + +# -v3; lacheck mode +"!"%f!", line %l: %m!n" + +# -v4; verbose lacheck mode +"!"%f!", line %l: %m!n%r%s%t!n%u!n" + +# -v5; no line number, ease auto-test +"%k %n in %f: %m!n%r%s%t!n%u!n" + +# -v6; emacs compilation mode +"!"%f!", line %l.%c:(#%n) %m!n" + +} + + + +##################################################################### +# +# These commands should be ignored when detecting whether a command +# is ended by a space. You can specify regular expressions in the [] +# section in case you have many custom macros that can be safely +# terminated with a space. +# + +Silent +{ + \rm \em \bf \it \sl \sf \sc \tt \selectfont + \rmfamily \sffamily \ttfamily \mdseries \bfseries + \slshape \scshape \relax + \vskip \pagebreak \nopagebreak + + \textrm \textem \textbf \textit \textsl \textsf \textsc \texttt + + \clearpage \ddots \dotfill \flushbottom \fussy \indent \linebreak + \onecolumn \pagebreak \pushtabs \poptabs \scriptsize \sloppy + \twocolumn \vdots + \today \kill \newline \thicklines \thinlines + + \columnsep \space \item \tiny \footnotesize \small \normalsize + \normal \large \Large \LARGE \huge \Huge \printindex + + \newpage \listoffigures \listoftables \tableofcontents + \maketitle \makeindex + + \hline \hrule \vrule + + \centering + + \bigskip \medskip \smallskip + + \noindent \expandafter + + \makeatletter \makeatother + + \columnseprule + + \textwidth \textheight \hsize \vsize + + \if \fi \else + + \csname \endcsname + + \z@ \p@ \@warning \typeout + + \dots \ldots \input \endinput \nextline \leavevmode \cdots + \appendix \listfiles \and \quad + \hskip \vfill \vfil \hfill \hfil \topmargin \oddsidemargin + \frenchspacing \nonfrenchspacing + \begingroup \endgroup \par + + \vrefwarning \upshape \headheight \headsep \hoffset \voffset + \cdot \qquad + \left \right + \qedhere + + \xspace + + \addlinespace \cr \fill \frontmatter + \toprule \midrule \bottomrule + +}[ +# Here you can put regular expressions to match Silent macros. It was +# designed for the case where you have many custom macros sharing a +# common prefix, but can of course be used for other things. + +# Support ConTeXt to at least some extent +\\start.* \\stop.* + +] + +##################################################################### +# +# Here, you can specify the length of various dashes. We sort the +# dash according to which type of characters that are on the left and +# right of it. We are only conclusive if they are the same. +# +# We associate as follows: +# +# Name Type of character on each side +# HyphDash Alphabetic (foo-bar) +# NumDash Numeric (2--3) +# WordDash Space (like this --- see?) +# +# Below you specify how many dashes which are legal in each case. We +# define 0 as a magic constant which always generates an error. You +# may specify more than one legal dash-length. +# +# Let's look at an example. You use the following dash-syntax: +# +# foo-bar +# 2--3 +# like this---see? +# +# +# HYPHDASH { 1 3 } # Either a hyphen, or inter-word +# NUMDASH { 2 } # Between words +# WORDDASH { 0 } # We never use this +# + +HyphDash +{ + 1 3 +} + +NumDash +{ + 2 +} + +WordDash +{ + 3 +} + +##################################################################### +# +# Here are exceptions to the dash rules above. For example, an +# n-dash -- between words is usually wrong, but in some cases it is +# correct, such as when naming a theorem. The Birch--Swinnerton-Dyer +# conjecture is one example where the difference matters. You can +# tell that Birch is one person and Swinnerton-Dyer is another. +# +# Adding line suppressions for these is possible, but can quickly +# become tedious if a certain theorem is referenced often. For this +# reason exceptions can be specified here. They are case-sensitive. +# + +DashExcpt +{ + Birch--Swinnerton-Dyer +} + +##################################################################### +# +# This keyword indicates commands whose argument isn't LaTeX code, +# and thus should be ignored. +# +# After the command, you may place arguments that you wish that +# should be wiped in the process; use [] for optional arguments, {} +# for required ones and * if the command supports an alternative +# variant. These should be separated from the command with a colon. +# Some commands (e.g. \cmidrule) use () to delimit and optional +# argument and so this syntax is supported as well. +# +# For instance, if you would like to wipe the \newcommand command, +# you would declare it as \newcommand:*[][]{} +# +# These commands may be "executed" before they're wiped, so you will +# typically also wish to list filehandling commands and similar here. +# + +WipeArg +{ + \label:{} \ref:{} \eqref:{} \vref:{} \pageref:{} \index:[]{} + \cite:[][]{} \nocite:{} + \input:{} \verbatiminput:[]{} \listinginput:[]{}{} + \verbatimtabinput:[]{} \include:{} \includeonly:{} + \bibitem:[]{} + \cline:{} \cmidrule:[](){} + \href:{}{} + # Cleveref -- there are many others that could be here as well... + \cref:*{} \cpageref:*{} \crefrange:*{}{} \cpagerefrange:*{}{} + \Cref:*{} \Cpageref:*{} \Crefrange:*{}{} \Cpagerefrange:*{}{} + # natbib + \citet:*[][]{} \citep:*[][]{} \citealt:*{} \citealp:*[]{} \citeauthor:*{} + \Citet:*[][]{} \Citep:*[][]{} \Citealt:*{} \Citealp:*[]{} \Citeauthor:{} + \citetext:{} \citeyear:*{} \citeyearpar:{} + # tipa which uses " + \textipa:{} +} + +##################################################################### +# +# These environments contain material which will be typeset as +# mathematics by LaTeX. This turns on/off some warnings. +# +# We will automagically append a * to each keyword. +# + +MathEnvir +{ + displaymath math eqnarray array equation + align alignat gather flalign multline +} + +##################################################################### +# +# These commands contain material which will be typeset as mathematics +# by LaTeX. The commands are assumed to have one mandatory argument +# which is in math mode. This turns on/off some warnings. +# + +MathCmd +{ + \ensuremath +} + +##################################################################### +# +# These commands contain material which will _not_ be typeset as +# mathematics by LaTeX even if it would otherwise be in mathmode. The +# commands are assumed to have one mandatory argument which is in text +# mode. This turns on/off some warnings. +# + +TextCmd +{ + \text \intertext \shortintertext \mbox +} + +##################################################################### +# +# These environments contains material which contents should be +# ignored. +# +# We will automagically append a * to each keyword. +# + +VerbEnvir +{ + verbatim comment listing verbatimtab rawhtml errexam picture texdraw + filecontents pgfpicture tikzpicture minted lstlisting IPA ignore +} + +##################################################################### +# +# ChkTeX does automagically catch most abbreviations; the ones we +# need to list here, are those which are most likely to be followed +# by a word with an upper-case letter (that is not the beginning of a +# new sentence). +# +# The case-insensitive abbreviations are not really case-insensitive, +# it seems to be more practical to only let the first character be +# case-insensitive, while the remaining are case-sensitive. +# +# To speed up the searching process somewhat, we require that these +# end in a `.', this should not be a problem. +# +# Much of this work (both the abbreviations below, and the regexps +# necessary to catch the remaining automatically) have been provided +# by Russ Bubley, . +# + +Abbrev +{ +# Ordinals +1st. 2nd. 3rd. 4th. +# Titles +Mr. Mrs. Miss. Ms. Dr. Prof. St. + +# +# Days +# Mon. Tue. Wed. Thu. Fri. Sat. Sun. +# +# Months +# Jan. Feb. Mar. Apr. May. Jun. Jul. Aug. Sep. Oct. Nov. Dec. +# +# Letters +# Kt. Jr. +# +# Corporate +# Co. Ltd. +# +# Addresses +# Rd. Dr. St. Ave. Cres. Gdns. Sq. Circ. Terr. Pl. Arc. La. Clo. Ho. Est. Gn. +# +# Misc. +# oe. pbab. ps. rsvp. Tx. +} +[ +### +# +# The first letter is case-insensitive in the abbrevs in this +# list. Due to the nature of the checking algorithm used for +# this, entries consisting of only one character will be +# silently ignored. +# +## + +# Latin +# cf. "et al." etc. qed. qv. viz. +# +# Corporate +# inc. plc. +# +# Misc +# fax. pcs. qty. tel. misc. +] + +##################################################################### +# +# Commands which accent characters, meaning that \i or \j (\imath and +# \jmath in mathmode) should be used instead of `i' and `j' +# + +IJAccent +{ + \hat \check \breve \acute \grave \tilde \bar \vec \dot \ddot + + \' \` \^ \" \~ \= \. \u \v \H \t + +### +# +# The remaining accent commands (\c,\d,\b) put their accent _under_ +# the character, not above, and should thus be used with normal i's +# and j's. +# +### + +} + +##################################################################### +# +# Commands which, when the group is terminated, needs italic +# correction. +# + +Italic +{ + \it \em \sl + \itshape \slshape +} + +##################################################################### +# +# Commands which makes the font non-italic. +# + +NonItalic +{ + \bf \rm \sf \tt \sc + \upshape +} + +##################################################################### +# +# Commands which put their argument into italic (and thus possibly +# needs italic correction in the end). +# +# This is currently empty, since \textit, \textsl and \emph do that +# automatically. +# + +ItalCmd +{ +} + +##################################################################### +# +# These commands all have in common that a pagebreak right in front +# of them is highly undesirable; thus there should be no space in +# front of them. +# + +PostLink +{ + \index \label +} + +##################################################################### +# +# These commands should not have a space in front of them for various +# reasons. I.e. much the same as POSTLINK, but produces another +# warning. +# + +NotPreSpaced +{ + \footnote \footnotemark \/ +} + +##################################################################### +# +# The commands listed here, should be prepended with a `~', as in +# "look in table~\ref{foo}", to avoid the references being split +# across lines. +# + +Linker +{ + \ref \vref \pageref \eqref \cite +} + +##################################################################### +# +# Commands/characters which should have \cdots in between, e.g. +# $1+2+3+\cdots+n$. +# + +CenterDots +{ + = + - \cdot \div & \times \geq \leq < > +} + +##################################################################### +# +# Commands/characters which should have \ldots in between, e.g. +# $1,2,3,\ldots,n$. +# + +LowDots +{ + . , ; +} + +##################################################################### +# +# In maths mode, there are certain aliases for mathematical operators +# like sin, cos, etc. Ignore the leading backslash in the commands, +# and so forth. You should list these below. +# + +MathRoman +{ + log lg ln lim limsup liminf sin arcsin sinh cos arccos cosh tan + arctan tanh cot coth sec csc max min sup inf arg ker dim hom det + exp Pr gcd deg bmod pmod mod +} + +##################################################################### +# +# These TeX commands have become unnecessary, as there are LaTeX +# commands that does the same. Purists should thus avoid these in +# their code. +# +# (These are a spell-corrected version of those lacheck uses). +# + +Primitives +{ + \above \advance \catcode \chardef \closein \closeout \copy \count + \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide + \expandafter \font \hskip \vskip \openout +} + +##################################################################### +# +# Format: \command:characters +# +# We'll emit a warning if any of characters are found after the +# command. +# + +NoCharNext +{ + \left:{}$ \right:{}$ +} + +##################################################################### +# +# We're killing \verb@...@ commands and the arguments of the commands +# listed above in WipeArg by overwriting them with a string or a +# single character. +# +# This should not contain an alphabetic character (in case the user +# writes (\foo\verb@bar@), neither should it contain be one of +# LaTeX's reserved characters (`#$%&~_^\{}'), or any parenthesis +# character ('()[]{}'). If possible, don't use a punctuation +# character, either, or any spacing character. +# +# The asterisk is also unsuitable, as some commands behave in another +# way if they are appended with an asterisk. Which more or less +# leaves us with the pipe. +# +# Please note that this may also be a _string_, which will be +# repeated until the proper length is reached. +# + +VerbClear = "|" + +# +# All for now - have fun. +# +##################################################################### diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index ec6b81b6..f46f527e 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -34,6 +34,7 @@ For some linters it is also possible to override rules on a case by case level w - [Javascript standard](#javascript-standard) - [JSON](#json) - [Kotlin](#kotlin) + - [LaTeX](#latex) - [Lua](#lua) - [Markdown](#markdown) - [OpenAPI](#openapi) @@ -602,6 +603,48 @@ import package.b.* --- +## LaTeX + +- [ChkTex](https://www.nongnu.org/chktex/) + +### ChkTex Config file + +- `.github/linters/chktexrc` +- You can pass multiple rules and overwrite default rules +- File should be located at: `.github/linters/.luacheckrc` +- See [ChkTex](https://ctan.kako-dev.de/systems/doc/chktex/ChkTeX.pdf) docs for additional + behaviors + +### ChkTex disable single line + +Disable warnings on each line: + +```latex +$[0,\infty)$ % chktex 8 chktex 9 +``` +### ChkTex disable code block + +Use the `ignore`-environment to ignore all warnings within it. +Make sure that "ignore" is contained in your chektexrc files "VerbEnvir" setting. + +```latex +\newenvironment{ignore}{}{} + +\begin{ignore} +$[0,\infty)$ +\end{ignore} +``` + +### ChkTex disable entire file + +Disable warning for the rest of the file: + +```latex +% chktex-file 18 +``` + +--- + ## Lua - [luarocks](https://github.com/luarocks/luacheck) diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index 760c0eec..53ea40b0 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -327,9 +327,6 @@ function BuildFileList() { # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 - ######################## - # Get the Golang files # - ######################## ############################ # Get the TypeScript files # ############################ @@ -355,6 +352,18 @@ function BuildFileList() { # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 + ####################### + # Get the LaTeX files # + ####################### + elif [ "${FILE_TYPE}" == "tex" ]; then + ################################ + # Append the file to the array # + ################################ + FILE_ARRAY_LATEX+=("${FILE}") + ########################################################## + # Set the READ_ONLY_CHANGE_FLAG since this could be exec # + ########################################################## + READ_ONLY_CHANGE_FLAG=1 #################### # Get the R files # #################### @@ -370,9 +379,6 @@ function BuildFileList() { ########################### # Get the Terraform files # ########################### - ########################### - # Get the Terraform files # - ########################### elif [ "${FILE_TYPE}" == "tf" ]; then ################################ # Append the file to the array # @@ -428,9 +434,9 @@ function BuildFileList() { # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 - ############################ + ################################## # Get the Protocol Buffers files # - ############################ + ################################## elif [ "${FILE_TYPE}" == "dart" ]; then ################################ # Append the file to the array # diff --git a/lib/linter.sh b/lib/linter.sh index 401a5627..6d342f7e 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -69,6 +69,9 @@ JAVASCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${JAVASCRIPT_FILE_NAME}" # Pa JAVASCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard # Default linter path LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory +# LaTeX Vars +LATEX_FILE_NAME='chktexrc' # Name of the file +LATEX_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${LATEX_FILE_NAME}" # Path to the Lua lint rules # Lua Vars LUA_FILE_NAME='.luacheckrc' # Name of the file LUA_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${LUA_FILE_NAME}" # Path to the Lua lint rules @@ -130,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' 'cfn-lint' 'checkstyle' 'clj-kondo' 'coffeelint' +LINTER_ARRAY=('ansible-lint' 'arm-ttk' 'asl-validator' 'cfn-lint' 'checkstyle' 'chktex' 'clj-kondo' 'coffeelint' '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' @@ -141,7 +144,7 @@ LINTER_ARRAY=('ansible-lint' 'arm-ttk' 'asl-validator' 'cfn-lint' 'checkstyle' ' ############################# LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'CLOUDFORMATION' 'CLOJURE' 'COFFEESCRIPT' 'CSS' 'DART' 'DOCKERFILE' 'DOCKERFILE_HADOLINT' 'EDITORCONFIG' 'ENV' 'GO' 'GROOVY' 'HTML' - 'JAVA' 'JAVASCRIPT_ES' 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'LUA' 'MARKDOWN' + 'JAVA' 'JAVASCRIPT_ES' 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'LATEX' 'LUA' 'MARKDOWN' 'OPENAPI' 'PERL' 'PHP_BUILTIN' 'PHP_PHPCS' 'PHP_PHPSTAN' 'PHP_PSALM' 'POWERSHELL' 'PROTOBUF' 'PYTHON_PYLINT' 'PYTHON_FLAKE8' 'R' 'RAKU' 'RUBY' 'STATES' 'SQL' 'TERRAFORM' 'TERRAFORM_TERRASCAN' 'TSX' 'TYPESCRIPT_ES' 'TYPESCRIPT_STANDARD' 'XML' 'YAML') @@ -189,11 +192,12 @@ VALIDATE_JAVASCRIPT_STANDARD="${VALIDATE_JAVASCRIPT_STANDARD}" # Boolean t VALIDATE_JSON="${VALIDATE_JSON}" # Boolean to validate language VALIDATE_JSX="${VALIDATE_JSX}" # Boolean to validate language VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language +VALIDATE_LATEX ="${VALIDATE_LATEX}" # Boolean to validate language VALIDATE_LUA="${VALIDATE_LUA}" # Boolean to validate language VALIDATE_MARKDOWN="${VALIDATE_MD:-}" # Boolean to validate language VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language VALIDATE_PERL="${VALIDATE_PERL}" # Boolean to validate language -VALIDATE_PHP_BUILTIN="${VALIDATE_PHP:-$VALIDATE_PHP_BUILTIN}" # Boolean to validate language +VALIDATE_PHP_BUILTIN="${VALIDATE_PHP:-$VALIDATE_PHP_BUILTIN}" # Boolean to validate language VALIDATE_PHP_PHPCS="${VALIDATE_PHP_PHPCS}" # Boolean to validate language VALIDATE_PHP_PHPSTAN="${VALIDATE_PHP_PHPSTAN}" # Boolean to validate language VALIDATE_PHP_PSALM="${VALIDATE_PHP_PSALM}" # Boolean to validate language @@ -287,6 +291,7 @@ FILE_ARRAY_JAVASCRIPT_STANDARD=() # Array of files to check FILE_ARRAY_JSON=() # Array of files to check FILE_ARRAY_JSX=() # Array of files to check FILE_ARRAY_KOTLIN=() # Array of files to check +FILE_ARRAY_LATEX=() # Array of files to check FILE_ARRAY_LUA=() # Array of files to check FILE_ARRAY_MARKDOWN=() # Array of files to check FILE_ARRAY_OPENAPI=() # Array of files to check @@ -356,6 +361,8 @@ ERRORS_FOUND_JSX=0 # Count of errors found export ERRORS_FOUND_JSX # Workaround SC2034 ERRORS_FOUND_KOTLIN=0 # Count of errors found export ERRORS_FOUND_KOTLIN # Workaround SC2034 +ERRORS_FOUND_LATEX=0 # Count of errors found +export ERRORS_FOUND_LATEX=0 # Workaround SC2034 ERRORS_FOUND_LUA=0 # Count of errors found export ERRORS_FOUND_LUA=0 # Workaround SC2034 ERRORS_FOUND_MARKDOWN=0 # Count of errors found @@ -1195,6 +1202,8 @@ GetLinterRules "HTML" GetLinterRules "JAVA" # Get JavaScript rules GetLinterRules "JAVASCRIPT" +# Get LATEX rules +GetLinterRules "LATEX" # Get LUA rules GetLinterRules "LUA" # Get Markdown rules @@ -1543,6 +1552,17 @@ if [ "${VALIDATE_KOTLIN}" == "true" ]; then LintCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "${FILE_ARRAY_KOTLIN[@]}" fi +################# +# LATEX LINTING # +################# +if [ "${VALIDATE_LATEX}" == "true" ]; then + ######################## + # Lint the LATEX files # + ######################## + # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" + LintCodebase "LATEX" "chktex" "chktex -l ${LATEX_LINTER_RULES}" ".*\.\(tex\)\$" "${FILE_ARRAY_LATEX[@]}" +fi + ############### # LUA LINTING # ############### diff --git a/lib/worker.sh b/lib/worker.sh index 52490f44..84ffac16 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -625,6 +625,7 @@ function RunTestCases() { TestCodebase "JAVASCRIPT_STANDARD" "standard" "standard ${JAVASCRIPT_STANDARD_LINTER_RULES}" ".*\.\(js\)\$" "javascript" TestCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "json" TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin" + TestCodebase "LATEX" "ChkTex" "chktex -l ${LATEX_LINTER_RULES}" ".*\.\(tex\)\$" "latex" TestCodebase "LUA" "lua" "luacheck" ".*\.\(lua\)\$" "lua" TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c ${MARKDOWN_LINTER_RULES}" ".*\.\(md\)\$" "markdown" TestCodebase "PERL" "perl" "perlcritic" ".*\.\(pl\|pm\|t\)\$" "perl" From e8db83e2ddb38db7fe1a109a90b0308e9496c79e Mon Sep 17 00:00:00 2001 From: assignUser Date: Wed, 19 Aug 2020 01:03:12 +0200 Subject: [PATCH 21/37] Update linter.sh --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index 6d342f7e..0c206b7a 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -192,7 +192,7 @@ VALIDATE_JAVASCRIPT_STANDARD="${VALIDATE_JAVASCRIPT_STANDARD}" # Boolean t VALIDATE_JSON="${VALIDATE_JSON}" # Boolean to validate language VALIDATE_JSX="${VALIDATE_JSX}" # Boolean to validate language VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language -VALIDATE_LATEX ="${VALIDATE_LATEX}" # Boolean to validate language +VALIDATE_LATEX="${VALIDATE_LATEX}" # Boolean to validate language VALIDATE_LUA="${VALIDATE_LUA}" # Boolean to validate language VALIDATE_MARKDOWN="${VALIDATE_MD:-}" # Boolean to validate language VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language From 5141bdaba494525451d95da9c073a04b69e19a0f Mon Sep 17 00:00:00 2001 From: assignUser Date: Wed, 19 Aug 2020 01:22:45 +0200 Subject: [PATCH 22/37] fix unzip --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4a072c0c..6ac6bd24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -253,7 +253,7 @@ RUN R -e "install.packages(list.dirs('/home/r-library',recursive = FALSE), repos # Install chktex # ################## RUN wget --tries=5 http://mirrors.ctan.org/support/chktex.zip -O chktex.zip -q \ - && unzip chktex.zip \ + && unzip -q chktex.zip -d chktex \ && cd chktex \ && ./configure && make \ && mv chktex /usr/bin \ From 61a2c4e12f5aee2b4428dec346a32e4ff12b7b77 Mon Sep 17 00:00:00 2001 From: assignUser Date: Wed, 19 Aug 2020 01:27:53 +0200 Subject: [PATCH 23/37] remove zip apk --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6ac6bd24..65cb29a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,8 +73,8 @@ RUN apk add --update --no-cache \ py3-setuptools \ R \ readline-dev \ - ruby ruby-dev ruby-bundler ruby-rdoc \ - zip + ruby ruby-dev ruby-bundler ruby-rdoc + ######################################## # Copy dependencies files to container # @@ -252,8 +252,7 @@ RUN R -e "install.packages(list.dirs('/home/r-library',recursive = FALSE), repos ################## # Install chktex # ################## -RUN wget --tries=5 http://mirrors.ctan.org/support/chktex.zip -O chktex.zip -q \ - && unzip -q chktex.zip -d chktex \ +RUN wget --tries=5 http://mirrors.ctan.org/support/chktex.zip -O - -q | unzip -q -\ && cd chktex \ && ./configure && make \ && mv chktex /usr/bin \ From c64adc056e57557339a942c654b8de62203c0efa Mon Sep 17 00:00:00 2001 From: assignUser Date: Wed, 19 Aug 2020 00:25:18 +0000 Subject: [PATCH 24/37] adjust zip command --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 65cb29a4..cabcb996 100644 --- a/Dockerfile +++ b/Dockerfile @@ -252,7 +252,8 @@ RUN R -e "install.packages(list.dirs('/home/r-library',recursive = FALSE), repos ################## # Install chktex # ################## -RUN wget --tries=5 http://mirrors.ctan.org/support/chktex.zip -O - -q | unzip -q -\ +RUN wget --tries=5 http://mirrors.ctan.org/support/chktex.zip -O chktex.zip -q \ + && unzip -q chktex.zip \ && cd chktex \ && ./configure && make \ && mv chktex /usr/bin \ From b42ba5c72af461cc38da8adb6a06830ac078a01d Mon Sep 17 00:00:00 2001 From: assignUser Date: Wed, 19 Aug 2020 00:57:05 +0000 Subject: [PATCH 25/37] quiet chktex --- lib/linter.sh | 2 +- lib/worker.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 0c206b7a..e172ee8a 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1560,7 +1560,7 @@ if [ "${VALIDATE_LATEX}" == "true" ]; then # Lint the LATEX files # ######################## # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "LATEX" "chktex" "chktex -l ${LATEX_LINTER_RULES}" ".*\.\(tex\)\$" "${FILE_ARRAY_LATEX[@]}" + LintCodebase "LATEX" "chktex" "chktex -g -q -l ${LATEX_LINTER_RULES}" ".*\.\(tex\)\$" "${FILE_ARRAY_LATEX[@]}" fi ############### diff --git a/lib/worker.sh b/lib/worker.sh index 84ffac16..5e3614cb 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -625,7 +625,7 @@ function RunTestCases() { TestCodebase "JAVASCRIPT_STANDARD" "standard" "standard ${JAVASCRIPT_STANDARD_LINTER_RULES}" ".*\.\(js\)\$" "javascript" TestCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "json" TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin" - TestCodebase "LATEX" "ChkTex" "chktex -l ${LATEX_LINTER_RULES}" ".*\.\(tex\)\$" "latex" + TestCodebase "LATEX" "chktex" "chktex -g -q -l ${LATEX_LINTER_RULES}" ".*\.\(tex\)\$" "latex" TestCodebase "LUA" "lua" "luacheck" ".*\.\(lua\)\$" "lua" TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c ${MARKDOWN_LINTER_RULES}" ".*\.\(md\)\$" "markdown" TestCodebase "PERL" "perl" "perlcritic" ".*\.\(pl\|pm\|t\)\$" "perl" From f84ff928f41480bd33385612fe2bee994b862d62 Mon Sep 17 00:00:00 2001 From: assignUser Date: Wed, 19 Aug 2020 06:47:16 +0000 Subject: [PATCH 26/37] fix typo --- .automation/test/latex/latex_good_1.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.automation/test/latex/latex_good_1.tex b/.automation/test/latex/latex_good_1.tex index 9f00e6ff..2c19a908 100644 --- a/.automation/test/latex/latex_good_1.tex +++ b/.automation/test/latex/latex_good_1.tex @@ -131,7 +131,7 @@ Do you understand? % Warning 27 -\input laetx_good_2.tex +\input latex_good_2.tex \input latex_good_2 % Warning 29 From 538c44e0c699ac20895f1e5e3e52469cee6ddf12 Mon Sep 17 00:00:00 2001 From: assignUser Date: Wed, 19 Aug 2020 07:04:40 +0000 Subject: [PATCH 27/37] adjust test cases --- .automation/test/latex/latex_bad_1.tex | 5 ----- .automation/test/latex/latex_bad_2.tex | 1 - .automation/test/latex/latex_good_1.tex | 5 ----- .automation/test/latex/latex_good_2.tex | 1 - 4 files changed, 12 deletions(-) delete mode 100644 .automation/test/latex/latex_bad_2.tex delete mode 100644 .automation/test/latex/latex_good_2.tex diff --git a/.automation/test/latex/latex_bad_1.tex b/.automation/test/latex/latex_bad_1.tex index 8ab2af6d..cc0ec528 100644 --- a/.automation/test/latex/latex_bad_1.tex +++ b/.automation/test/latex/latex_bad_1.tex @@ -129,11 +129,6 @@ $5\cdot10^{10}$ Do you understand ? Do you understand? -% Warning 27 - -\input latex_bad_2.tex -\input latex_bad_2 - % Warning 29 The program opens a screen sized 640x200 pixels The program opens a screen sized $640\times200$ pixels diff --git a/.automation/test/latex/latex_bad_2.tex b/.automation/test/latex/latex_bad_2.tex deleted file mode 100644 index 76bc301f..00000000 --- a/.automation/test/latex/latex_bad_2.tex +++ /dev/null @@ -1 +0,0 @@ -\this is a test of whether the file is actually inputted... diff --git a/.automation/test/latex/latex_good_1.tex b/.automation/test/latex/latex_good_1.tex index 2c19a908..a34c6f7a 100644 --- a/.automation/test/latex/latex_good_1.tex +++ b/.automation/test/latex/latex_good_1.tex @@ -129,11 +129,6 @@ $5\cdot10^{10}$ %Do you understand ? Do you understand? -% Warning 27 - -\input latex_good_2.tex -\input latex_good_2 - % Warning 29 %The program opens a screen sized 640x200 pixels The program opens a screen sized $640\times200$ pixels diff --git a/.automation/test/latex/latex_good_2.tex b/.automation/test/latex/latex_good_2.tex deleted file mode 100644 index b8e263a9..00000000 --- a/.automation/test/latex/latex_good_2.tex +++ /dev/null @@ -1 +0,0 @@ -\this\ is a test of whether the file is actually inputted\ldots From bad32e6f5366bbc5775f16dd360a0f84455f4de9 Mon Sep 17 00:00:00 2001 From: assignUser Date: Wed, 19 Aug 2020 14:16:59 +0000 Subject: [PATCH 28/37] adress review --- docs/disabling-linters.md | 2 +- lib/linter.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index f46f527e..12bc96b3 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -611,7 +611,7 @@ import package.b.* - `.github/linters/chktexrc` - You can pass multiple rules and overwrite default rules -- File should be located at: `.github/linters/.luacheckrc` +- File should be located at: `.github/linters/chktexrc` - See [ChkTex](https://ctan.kako-dev.de/systems/doc/chktex/ChkTeX.pdf) docs for additional behaviors diff --git a/lib/linter.sh b/lib/linter.sh index e172ee8a..77e1173a 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -71,7 +71,7 @@ JAVASCRIPT_STANDARD_LINTER_RULES='' # EN LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory # LaTeX Vars LATEX_FILE_NAME='chktexrc' # Name of the file -LATEX_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${LATEX_FILE_NAME}" # Path to the Lua lint rules +LATEX_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${LATEX_FILE_NAME}" # Path to the Latex lint rules # Lua Vars LUA_FILE_NAME='.luacheckrc' # Name of the file LUA_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${LUA_FILE_NAME}" # Path to the Lua lint rules From dcd81f09d0b50ab55c0c15a7a2e87861f32b6c87 Mon Sep 17 00:00:00 2001 From: assignUser Date: Wed, 19 Aug 2020 14:28:41 +0000 Subject: [PATCH 29/37] fix global config warning --- Dockerfile | 3 ++- lib/linter.sh | 2 +- lib/worker.sh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cabcb996..51fbc70e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -257,7 +257,8 @@ RUN wget --tries=5 http://mirrors.ctan.org/support/chktex.zip -O chktex.zip -q \ && cd chktex \ && ./configure && make \ && mv chktex /usr/bin \ - && cd .. && rm -rf chktex* + && cd .. && rm -rf chktex* \ + && touch /usr/local/share/.chktexrc ########################################### # Load GitHub Env Vars for GitHub Actions # diff --git a/lib/linter.sh b/lib/linter.sh index 77e1173a..608118c5 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1560,7 +1560,7 @@ if [ "${VALIDATE_LATEX}" == "true" ]; then # Lint the LATEX files # ######################## # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" - LintCodebase "LATEX" "chktex" "chktex -g -q -l ${LATEX_LINTER_RULES}" ".*\.\(tex\)\$" "${FILE_ARRAY_LATEX[@]}" + LintCodebase "LATEX" "chktex" "chktex -q -l ${LATEX_LINTER_RULES}" ".*\.\(tex\)\$" "${FILE_ARRAY_LATEX[@]}" fi ############### diff --git a/lib/worker.sh b/lib/worker.sh index 5e3614cb..b17070ef 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -625,7 +625,7 @@ function RunTestCases() { TestCodebase "JAVASCRIPT_STANDARD" "standard" "standard ${JAVASCRIPT_STANDARD_LINTER_RULES}" ".*\.\(js\)\$" "javascript" TestCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "json" TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin" - TestCodebase "LATEX" "chktex" "chktex -g -q -l ${LATEX_LINTER_RULES}" ".*\.\(tex\)\$" "latex" + TestCodebase "LATEX" "chktex" "chktex -q -l ${LATEX_LINTER_RULES}" ".*\.\(tex\)\$" "latex" TestCodebase "LUA" "lua" "luacheck" ".*\.\(lua\)\$" "lua" TestCodebase "MARKDOWN" "markdownlint" "markdownlint -c ${MARKDOWN_LINTER_RULES}" ".*\.\(md\)\$" "markdown" TestCodebase "PERL" "perl" "perlcritic" ".*\.\(pl\|pm\|t\)\$" "perl" From 8224e9e6e5d867dd2681bddc26f8de18b86dd1f9 Mon Sep 17 00:00:00 2001 From: assignUser Date: Wed, 19 Aug 2020 17:51:07 +0000 Subject: [PATCH 30/37] fix exit code --- .github/linters/{chktexrc => .chktexrc} | 0 Dockerfile | 11 +++-------- TEMPLATES/{chktexrc => .chktexrc} | 0 docs/disabling-linters.md | 4 ++-- lib/linter.sh | 4 ++-- 5 files changed, 7 insertions(+), 12 deletions(-) rename .github/linters/{chktexrc => .chktexrc} (100%) rename TEMPLATES/{chktexrc => .chktexrc} (100%) diff --git a/.github/linters/chktexrc b/.github/linters/.chktexrc similarity index 100% rename from .github/linters/chktexrc rename to .github/linters/.chktexrc diff --git a/Dockerfile b/Dockerfile index 51fbc70e..f987bff7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ FROM koalaman/shellcheck:v0.7.1 as shellcheck FROM wata727/tflint:0.18.0 as tflint FROM hadolint/hadolint:latest-alpine as dockerfile-lint FROM assignuser/lintr-lib:latest as lintr-lib - +FROM assignuser/chktex-alpine:latest as chktex ################## # Get base image # ################## @@ -252,13 +252,8 @@ RUN R -e "install.packages(list.dirs('/home/r-library',recursive = FALSE), repos ################## # Install chktex # ################## -RUN wget --tries=5 http://mirrors.ctan.org/support/chktex.zip -O chktex.zip -q \ - && unzip -q chktex.zip \ - && cd chktex \ - && ./configure && make \ - && mv chktex /usr/bin \ - && cd .. && rm -rf chktex* \ - && touch /usr/local/share/.chktexrc +COPY --from=chktex /usr/bin/chktex /usr/bin/ +RUN cd ~ && touch .chktexrc ########################################### # Load GitHub Env Vars for GitHub Actions # diff --git a/TEMPLATES/chktexrc b/TEMPLATES/.chktexrc similarity index 100% rename from TEMPLATES/chktexrc rename to TEMPLATES/.chktexrc diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index 12bc96b3..cedac356 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -609,9 +609,9 @@ import package.b.* ### ChkTex Config file -- `.github/linters/chktexrc` +- `.github/linters/.chktexrc` - You can pass multiple rules and overwrite default rules -- File should be located at: `.github/linters/chktexrc` +- File should be located at: `.github/linters/.chktexrc` - See [ChkTex](https://ctan.kako-dev.de/systems/doc/chktex/ChkTeX.pdf) docs for additional behaviors diff --git a/lib/linter.sh b/lib/linter.sh index 608118c5..d39cd95e 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -70,8 +70,8 @@ JAVASCRIPT_STANDARD_LINTER_RULES='' # EN # Default linter path LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory # LaTeX Vars -LATEX_FILE_NAME='chktexrc' # Name of the file -LATEX_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${LATEX_FILE_NAME}" # Path to the Latex lint rules +LATEX_FILE_NAME='.chktexrc' # Name of the file +LATEX_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${LATEX_FILE_NAME}" # Path to the Latex lint rules # env var to supress warning from chktex # Lua Vars LUA_FILE_NAME='.luacheckrc' # Name of the file LUA_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${LUA_FILE_NAME}" # Path to the Lua lint rules From 54abac63b343f91a09a81fe3fc53cb2dba31d57a Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Wed, 19 Aug 2020 14:14:41 -0500 Subject: [PATCH 31/37] fix logic hole --- lib/linter.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 49269349..20c788d1 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -456,11 +456,11 @@ GetLinterVersions() { elif [[ ${LINTER} == "protolint" ]] || [[ ${LINTER} == "editorconfig-checker" ]]; then # Need specific command for Protolint and editorconfig-checker mapfile -t GET_VERSION_CMD < <(echo "--version not supported") - elif [[ ${LINTER} == "lintr" ]]; then + elif [[ ${LINTER} == "lintr" ]]; then # Need specific command for lintr (--slave is deprecated in R 4.0 and replaced by --no-echo) mapfile -t GET_VERSION_CMD < <(R --slave -e "r_ver <- R.Version()\$version.string; \ lintr_ver <- packageVersion('lintr'); \ - glue::glue('lintr { lintr_ver } on { r_ver }')") + glue::glue('lintr { lintr_ver } on { r_ver }')") else # Standard version command mapfile -t GET_VERSION_CMD < <("${LINTER}" --version 2>&1) @@ -1004,7 +1004,7 @@ CallStatusAPI() { ########################################################## # Check to see if were enabled for multi Status mesaages # ########################################################## - if [ "${MULTI_STATUS}" == "true" ]; then + if [ "${MULTI_STATUS}" == "true" ] && [ -n ${GITHUB_TOKEN} ] && [ -n ${GITHUB_REPOSITORY} ]; then ############################################## # Call the status API to create status check # ############################################## @@ -1729,7 +1729,7 @@ if [ "${VALIDATE_R}" == "true" ]; then ########################## # Check for local config # ########################## - if [ ! -f "${GITHUB_WORKSPACE}/.lintr" ]; then + if [ ! -f "${GITHUB_WORKSPACE}/.lintr" ]; then info " " info "No .lintr configuration file found, using defaults." cp $R_LINTER_RULES "$GITHUB_WORKSPACE" From b13ac9a14f83aed4506d896c1c0cd83946841d16 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Wed, 19 Aug 2020 14:18:49 -0500 Subject: [PATCH 32/37] quotes --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index 20c788d1..1b57ffb2 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1004,7 +1004,7 @@ CallStatusAPI() { ########################################################## # Check to see if were enabled for multi Status mesaages # ########################################################## - if [ "${MULTI_STATUS}" == "true" ] && [ -n ${GITHUB_TOKEN} ] && [ -n ${GITHUB_REPOSITORY} ]; then + if [ "${MULTI_STATUS}" == "true" ] && [ -n "${GITHUB_TOKEN}" ] && [ -n "${GITHUB_REPOSITORY}" ]; then ############################################## # Call the status API to create status check # ############################################## From 8f653be432ce6c6180ddba4b62fda54c7fa1bb5f Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Wed, 19 Aug 2020 15:26:57 -0500 Subject: [PATCH 33/37] some simple cleanup --- README.md | 78 +++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index ae89666e..a115521e 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ This repository is for the **GitHub Action** to run a **Super-Linter**. It is a simple combination of various linters, written in `bash`, to help validate your source code. -The end goal of this tool: +**The end goal of this tool:** -- Prevent broken code from being uploaded to the default branch (Usually `master`) +- Prevent broken code from being uploaded to the default branch (_Usually_ `master`) - Help establish coding best practices across multiple languages - Build guidelines for code layout and format - Automate the process to help streamline code reviews @@ -41,43 +41,43 @@ The design of the **Super-Linter** is currently to allow linting to occur in **G Developers on **GitHub** can call the **GitHub Action** to lint their code base with the following list of linters: -| _Language_ | _Linter_ | -| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| **Ansible** | [ansible-lint](https://github.com/ansible/ansible-lint) | -| **Azure Resource Manager (ARM)** | [arm-ttk](https://github.com/azure/arm-ttk) | -| **AWS CloudFormation templates** | [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint/) | -| **CSS** | [stylelint](https://stylelint.io/) | -| **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) | -| **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) | -| **Dart** | [dartanalyzer](https://dart.dev/guides/language/analysis-options) | -| **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) [hadolint](https://github.com/hadolint/hadolint) | -| **EDITORCONFIG** | [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) | -| **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | -| **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) | -| **Groovy** | [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint) | -| **HTMLHint** | [HTMLHint](https://github.com/htmlhint/HTMLHint) | -| **Java** | [checkstyle](https://checkstyle.org) | -| **JavaScript** | [eslint](https://eslint.org/) [standard js](https://standardjs.com/) | -| **JSON** | [jsonlint](https://github.com/zaach/jsonlint) | -| **Kotlin** | [ktlint](https://github.com/pinterest/ktlint) | -| **LaTeX** | [ChkTex](https://www.nongnu.org/chktex/) | -| **Lua** | [luacheck](https://github.com/luarocks/luacheck) | -| **Markdown** | [markdownlint](https://github.com/igorshubovych/markdownlint-cli#readme) | -| **OpenAPI** | [spectral](https://github.com/stoplightio/spectral) | -| **Perl** | [perlcritic](https://metacpan.org/pod/Perl::Critic) | -| **PHP** | [PHP built-in linter](https://www.php.net/) [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) [PHPStan](https://phpstan.org/n) [Psalm](https://psalm.dev/) | -| **PowerShell** | [PSScriptAnalyzer](https://github.com/PowerShell/Psscriptanalyzer) | -| **Protocol Buffers** | [protolint](https://github.com/yoheimuta/protolint) | -| **Python3** | [pylint](https://www.pylint.org/) [flake8](https://flake8.pycqa.org/en/latest/) | -| **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) | -| **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/) | -| **XML** | [LibXML](http://xmlsoft.org/) | -| **YAML** | [YamlLint](https://github.com/adrienverge/yamllint) | +| _Language_ | _Linter_ | +| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **Ansible** | [ansible-lint](https://github.com/ansible/ansible-lint) | +| **Azure Resource Manager (ARM)** | [arm-ttk](https://github.com/azure/arm-ttk) | +| **AWS CloudFormation templates** | [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint/) | +| **CSS** | [stylelint](https://stylelint.io/) | +| **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) | +| **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) | +| **Dart** | [dartanalyzer](https://dart.dev/guides/language/analysis-options) | +| **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) / [hadolint](https://github.com/hadolint/hadolint) | +| **EDITORCONFIG** | [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) | +| **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | +| **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) | +| **Groovy** | [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint) | +| **HTMLt** | [HTMLHint](https://github.com/htmlhint/HTMLHint) | +| **Java** | [checkstyle](https://checkstyle.org) | +| **JavaScript** | [eslint](https://eslint.org/) / [standard js](https://standardjs.com/) | +| **JSON** | [jsonlint](https://github.com/zaach/jsonlint) | +| **Kotlin** | [ktlint](https://github.com/pinterest/ktlint) | +| **LaTeX** | [ChkTex](https://www.nongnu.org/chktex/) | +| **Lua** | [luacheck](https://github.com/luarocks/luacheck) | +| **Markdown** | [markdownlint](https://github.com/igorshubovych/markdownlint-cli#readme) | +| **OpenAPI** | [spectral](https://github.com/stoplightio/spectral) | +| **Perl** | [perlcritic](https://metacpan.org/pod/Perl::Critic) | +| **PHP** | [PHP built-in linter](https://www.php.net/) / [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) / [PHPStan](https://phpstan.org/n) / [Psalm](https://psalm.dev/) | +| **PowerShell** | [PSScriptAnalyzer](https://github.com/PowerShell/Psscriptanalyzer) | +| **Protocol Buffers** | [protolint](https://github.com/yoheimuta/protolint) | +| **Python3** | [pylint](https://www.pylint.org/) / [flake8](https://flake8.pycqa.org/en/latest/) | +| **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) | +| **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/) | +| **XML** | [LibXML](http://xmlsoft.org/) | +| **YAML** | [YamlLint](https://github.com/adrienverge/yamllint) | ## How to use From 52872bbafe410fac3f0c73a12bcb8aaf2ca9c668 Mon Sep 17 00:00:00 2001 From: Mark Bond <34947848+bondms@users.noreply.github.com> Date: Wed, 19 Aug 2020 22:58:14 +0100 Subject: [PATCH 34/37] Fix minor typo in HTML language name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a115521e..70eab815 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base | **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | | **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) | | **Groovy** | [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint) | -| **HTMLt** | [HTMLHint](https://github.com/htmlhint/HTMLHint) | +| **HTML** | [HTMLHint](https://github.com/htmlhint/HTMLHint) | | **Java** | [checkstyle](https://checkstyle.org) | | **JavaScript** | [eslint](https://eslint.org/) / [standard js](https://standardjs.com/) | | **JSON** | [jsonlint](https://github.com/zaach/jsonlint) | From 1f2c569c2108ebf91560314620b7a0dc936ea7e0 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 20 Aug 2020 09:44:11 -0500 Subject: [PATCH 35/37] adding black --- .automation/test/python/python_good_1.py | 105 +++++++++++++++-------- Dockerfile | 7 +- README.md | 3 +- dependencies/Pipfile | 12 ++- dependencies/Pipfile.lock | 100 +++++++++++++++++++-- docs/disabling-linters.md | 26 +++++- lib/linter.sh | 41 ++++++--- lib/worker.sh | 9 +- 8 files changed, 233 insertions(+), 70 deletions(-) diff --git a/.automation/test/python/python_good_1.py b/.automation/test/python/python_good_1.py index a2f7c3e6..0fdfa407 100644 --- a/.automation/test/python/python_good_1.py +++ b/.automation/test/python/python_good_1.py @@ -8,19 +8,21 @@ from dotenv import load_dotenv # pylint: disable=import-error import requests # pylint: disable=import-error env = load_dotenv() -api_url = getenv('API_URL', default='https://api.github.com/graphql') +api_url = getenv("API_URL", default="https://api.github.com/graphql") github_token = getenv("GITHUB_TOKEN", default=None) if github_token is None: - sys.exit("GitHub Token is not set." + - "Please set the GITHUB_TOKEN env variable in your system or " + - "the .env file of your project.") + sys.exit( + "GitHub Token is not set." + + "Please set the GITHUB_TOKEN env variable in your system or " + + "the .env file of your project." + ) -client_id = getenv('CLIENT_ID', default='copy_labels.py') +client_id = getenv("CLIENT_ID", default="copy_labels.py") headers = { - 'Authorization': 'bearer {github_token}'.format(github_token=github_token), - 'Accept': 'application/vnd.github.bane-preview+json', - 'Content-Type': 'application/json' + "Authorization": "bearer {github_token}".format(github_token=github_token), + "Accept": "application/vnd.github.bane-preview+json", + "Content-Type": "application/json", } @@ -40,20 +42,21 @@ def create_label(repo_id, label): "color": label["color"], "description": label["description"], "name": label["name"], - "repositoryId": repo_id + "repositoryId": repo_id, } } - with open(path.join(path.dirname(__file__), 'queries/create_label.gql'), 'r') as query_file: + with open( + path.join(path.dirname(__file__), "queries/create_label.gql"), "r" + ) as query_file: query = "".join(query_file.readlines()) payload = {"query": query, "variables": query_variables} response = requests.post(api_url, data=json.dumps(payload), headers=headers).json() - print('Created label {label}'.format(label=label["name"])) + print("Created label {label}".format(label=label["name"])) return response - def get_labels(owner, repo): """ Gets a list of labels from the supplied repo. @@ -64,9 +67,14 @@ def get_labels(owner, repo): :return: A tuple with the GitHub id for the repository and a list of labels defined in the repository """ - query_variables = {"owner": owner, "name": repo, } + query_variables = { + "owner": owner, + "name": repo, + } - with open(path.join(path.dirname(__file__), 'queries/get_repo_data.gql'), 'r') as query_file: + with open( + path.join(path.dirname(__file__), "queries/get_repo_data.gql"), "r" + ) as query_file: query = "".join(query_file.readlines()) payload = {"query": query, "variables": query_variables} @@ -82,9 +90,10 @@ def get_labels(owner, repo): return repo_id, labels else: raise Exception( - '[ERROR] getting issue labels. Status Code: {status_code} - Message: {result}'.format( - status_code=status_code, result=result["message"])) - + "[ERROR] getting issue labels. Status Code: {status_code} - Message: {result}".format( + status_code=status_code, result=result["message"] + ) + ) def delete_label(label_id): """ @@ -95,13 +104,12 @@ def delete_label(label_id): """ query_variables = { - "deleteLabelInput": { - "clientMutationId": client_id, - "id": label_id, - } + "deleteLabelInput": {"clientMutationId": client_id, "id": label_id} } - with open(path.join(path.dirname(__file__), 'queries/delete_label.gql'), 'r') as query_file: + with open( + path.join(path.dirname(__file__), "queries/delete_label.gql"), "r" + ) as query_file: query = "".join(query_file.readlines()) payload = {"query": query, "variables": query_variables} @@ -109,11 +117,10 @@ def delete_label(label_id): return result - @click.command() -@click.option('--dry', is_flag=True) -@click.argument('source_repo') -@click.argument('target_repo') +@click.option("--dry", is_flag=True) +@click.argument("source_repo") +@click.argument("target_repo") def copy_labels(source_repo, target_repo, dry): """ Copy labels from the source repository to the target repository. @@ -128,31 +135,55 @@ def copy_labels(source_repo, target_repo, dry): target_owner, target_repo_name = target_repo.split("/") try: - print('Fetching labels for {source_repo_name} repo.'.format(source_repo_name=source_repo_name)) + print( + "Fetching labels for {source_repo_name} repo.".format( + source_repo_name=source_repo_name + ) + ) _, source_repo_labels = get_labels(source_owner, source_repo_name) - print('Fetched labels for {source_repo_name}'.format(source_repo_name=source_repo_name)) + print( + "Fetched labels for {source_repo_name}".format( + source_repo_name=source_repo_name + ) + ) - print('Fetching labels for {target_repo_name} repo.'.format(target_repo_name=target_repo_name)) + print( + "Fetching labels for {target_repo_name} repo.".format( + target_repo_name=target_repo_name + ) + ) target_repo_id, target_repo_labels = get_labels(target_owner, target_repo_name) - print('Fetched labels for {target_repo_name}'.format(target_repo_name=target_repo_name)) + print( + "Fetched labels for {target_repo_name}".format( + target_repo_name=target_repo_name + ) + ) - filtered_labels = list(filter(lambda x: x not in target_repo_labels, source_repo_labels)) + filtered_labels = list( + filter(lambda x: x not in target_repo_labels, source_repo_labels) + ) if dry: - print('This is just a dry run. No labels will be copied/created.') - print('{label_count} labels would have been created.'.format(label_count=len(filtered_labels))) + print("This is just a dry run. No labels will be copied/created.") + print( + "{label_count} labels would have been created.".format( + label_count=len(filtered_labels) + ) + ) pprint(filtered_labels, indent=4) else: - print('Preparing to created {label_count} labels in {target_repo}'.format( - label_count=len(filtered_labels), target_repo=target_repo)) + print( + "Preparing to created {label_count} labels in {target_repo}".format( + label_count=len(filtered_labels), target_repo=target_repo + ) + ) for label in filtered_labels: create_label(target_repo_id, label) except Exception as error: sys.exit(error) - print('Done') - + print("Done") if __name__ == "__main__": # Pylint doesn't know that @click.command takes care of injecting the diff --git a/Dockerfile b/Dockerfile index 74990862..410202de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,8 +73,8 @@ RUN apk add --update --no-cache \ py3-setuptools \ R \ readline-dev \ - ruby ruby-dev ruby-bundler ruby-rdoc - + ruby ruby-dev ruby-bundler ruby-rdoc + ######################################## # Copy dependencies files to container # @@ -308,8 +308,9 @@ ENV ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ VALIDATE_POWERSHELL=${VALIDATE_POWERSHELL} \ VALIDATE_PROTOBUF=${VALIDATE_PROTOBUF} \ VALIDATE_PYTHON=${VALIDATE_PYTHON} \ - VALIDATE_PYTHON_PYLINT=${VALIDATE_PYTHON_PYLINT} \ + VALIDATE_PYTHON_BLACK=${VALIDATE_PYTHON_BLACK} \ VALIDATE_PYTHON_FLAKE8=${VALIDATE_PYTHON_FLAKE8} \ + VALIDATE_PYTHON_PYLINT=${VALIDATE_PYTHON_PYLINT} \ VALIDATE_R=${VALIDATE_R} \ VALIDATE_RAKU=${VALIDATE_RAKU} \ VALIDATE_RUBY=${VALIDATE_RUBY} \ diff --git a/README.md b/README.md index 70eab815..06e41da6 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base | **PHP** | [PHP built-in linter](https://www.php.net/) / [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) / [PHPStan](https://phpstan.org/n) / [Psalm](https://psalm.dev/) | | **PowerShell** | [PSScriptAnalyzer](https://github.com/PowerShell/Psscriptanalyzer) | | **Protocol Buffers** | [protolint](https://github.com/yoheimuta/protolint) | -| **Python3** | [pylint](https://www.pylint.org/) / [flake8](https://flake8.pycqa.org/en/latest/) | +| **Python3** | [pylint](https://www.pylint.org/) / [flake8](https://flake8.pycqa.org/en/latest/) / [black](https://github.com/psf/black) | | **R** | [lintr](https://github.com/jimhester/lintr) | | **Raku** | [Raku](https://raku.org) | | **Ruby** | [RuboCop](https://github.com/rubocop-hq/rubocop) | @@ -226,6 +226,7 @@ But if you wish to select or exclude specific linters, we give you full control | **VALIDATE_PYTHON** | `true` | Flag to enable or disable the linting process of the Python language. (Utilizing: pylint) (keep for backward compatibility) | | **VALIDATE_PYTHON_PYLINT** | `true` | Flag to enable or disable the linting process of the Python language. (Utilizing: pylint) | | **VALIDATE_PYTHON_FLAKE8** | `true` | Flag to enable or disable the linting process of the Python language. (Utilizing: flake8) | +| **VALIDATE_PYTHON_BLACK** | `true` | Flag to enable or disable the linting process of the Python language. (Utilizing: black) | | **VALIDATE_POWERSHELL** | `true` | Flag to enable or disable the linting process of the Powershell language. | | **VALIDATE_R** | `true` | Flag to enable or disable the linting process of the R language. | | **VALIDATE_RAKU** | `true` | Flag to enable or disable the linting process of the Raku language. | diff --git a/dependencies/Pipfile b/dependencies/Pipfile index 0fcce921..ffe213f6 100644 --- a/dependencies/Pipfile +++ b/dependencies/Pipfile @@ -6,12 +6,16 @@ verify_ssl = true [dev-packages] [packages] -yamllint = "*" -pylint = "*" -yq = "*" +black = "*" cfn-lint = "*" -terrascan = "*" flake8 = "*" +pylint = "*" +terrascan = "*" +yamllint = "*" +yq = "*" [requires] python_version = "3.8" + +[pipenv] +allow_prereleases = true diff --git a/dependencies/Pipfile.lock b/dependencies/Pipfile.lock index de2a9a11..2c430b50 100644 --- a/dependencies/Pipfile.lock +++ b/dependencies/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "f8ea3853c4bb4533103043533d08982436551678c827f59809c94bf0ee54a187" + "sha256": "1f13d59524584eca4db2ae57cf6d3acd02250a28bce7bee9414f21c45cae09af" }, "pipfile-spec": 6, "requires": { @@ -16,6 +16,13 @@ ] }, "default": { + "appdirs": { + "hashes": [ + "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41", + "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128" + ], + "version": "==1.4.4" + }, "argcomplete": { "hashes": [ "sha256:2fbe5ed09fd2c1d727d4199feca96569a5b50d44c71b16da9c742201f7cc295c", @@ -28,6 +35,7 @@ "sha256:2f4078c2a41bf377eea06d71c9d2ba4eb8f6b1af2135bec27bbbb7d8f12bb703", "sha256:bc58d83eb610252fd8de6363e39d4f1d0619c894b0ed24603b881c02e64c7386" ], + "markers": "python_version >= '3.5'", "version": "==2.4.2" }, "attrs": { @@ -35,6 +43,7 @@ "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c", "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72" ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==19.3.0" }, "aws-sam-translator": { @@ -45,19 +54,27 @@ ], "version": "==1.26.0" }, + "black": { + "hashes": [ + "sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b", + "sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539" + ], + "index": "pypi", + "version": "==19.10b0" + }, "boto3": { "hashes": [ - "sha256:640a8372ce0edfbb84a8f63584a0b64c78d61a751a27c2a47f92d2ebaf021ce4", - "sha256:a6c9a3d3abbad2ff2e5751af599492a9271633a7c9fef343482524464c53e451" + "sha256:1cfbadf41777dade69a3e5eaf1b71d15b4ae616fd94d16a894b692e14319f4a2", + "sha256:cc3636828f1677ff93e8b1130c90dfe800187964e33786711450e8653d3f245f" ], - "version": "==1.14.43" + "version": "==1.14.46" }, "botocore": { "hashes": [ - "sha256:3fb144d2b5d705127f394f7483737ece6fa79577ca7c493e4f42047ac8636200", - "sha256:f8801ce7f7603922ccab1c86c448e802f94183e31d99457e85fb9985a20d3abc" + "sha256:2f15a755b990db13a7a9e06a124c6ca5fa1c4470d76672363024d7f2a6c2566c", + "sha256:6b134681c938f00b28424abf4b46fa6034b516d8add3a3f524e2292db61aa070" ], - "version": "==1.17.43" + "version": "==1.17.46" }, "cfn-lint": { "hashes": [ @@ -67,6 +84,14 @@ "index": "pypi", "version": "==0.35.0" }, + "click": { + "hashes": [ + "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a", + "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==7.1.2" + }, "decorator": { "hashes": [ "sha256:41fa54c2a0cc4ba648be4fd43cff00aedf5b9465c9bf18d64325bc225f08f760", @@ -80,6 +105,7 @@ "sha256:9e4d7ecfc600058e07ba661411a2b7de2fd0fafa17d1a7f7361cd47b1175c827", "sha256:a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99" ], + "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2'", "version": "==0.15.2" }, "flake8": { @@ -95,6 +121,7 @@ "sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1", "sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd" ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==4.3.21" }, "jmespath": { @@ -102,6 +129,7 @@ "sha256:b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9", "sha256:cdf6525904cc597730141d61b36f2e4b8ecc257c420fa2f4549bac2c2d0cb72f" ], + "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2'", "version": "==0.10.0" }, "jsonpatch": { @@ -117,6 +145,7 @@ "sha256:c192ba86648e05fdae4f08a17ec25180a9aef5008d973407b581798a83975362", "sha256:ff379fa021d1b81ab539f5ec467c7745beb1a5671463f9dcc2b2d458bd361c1e" ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.0" }, "jsonschema": { @@ -156,6 +185,7 @@ "sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4", "sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0" ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.4.3" }, "mccabe": { @@ -185,6 +215,7 @@ "sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367", "sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e" ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.6.0" }, "pyflakes": { @@ -192,6 +223,7 @@ "sha256:0d94e0e05a19e57a99444b6ddcf9a6eb2e5c68d3ca1e98e90707af8152c90a92", "sha256:35b2d75ee967ea93b55750aa9edbbf72813e06a66ba54438df2cfac9e3c27fc8" ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.2.0" }, "pyhcl": { @@ -219,6 +251,7 @@ "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c", "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a" ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==2.8.1" }, "pyyaml": { @@ -238,6 +271,32 @@ "markers": "python_version != '3.4'", "version": "==5.3.1" }, + "regex": { + "hashes": [ + "sha256:0dc64ee3f33cd7899f79a8d788abfbec168410be356ed9bd30bbd3f0a23a7204", + "sha256:1269fef3167bb52631ad4fa7dd27bf635d5a0790b8e6222065d42e91bede4162", + "sha256:14a53646369157baa0499513f96091eb70382eb50b2c82393d17d7ec81b7b85f", + "sha256:3a3af27a8d23143c49a3420efe5b3f8cf1a48c6fc8bc6856b03f638abc1833bb", + "sha256:46bac5ca10fb748d6c55843a931855e2727a7a22584f302dd9bb1506e69f83f6", + "sha256:4c037fd14c5f4e308b8370b447b469ca10e69427966527edcab07f52d88388f7", + "sha256:51178c738d559a2d1071ce0b0f56e57eb315bcf8f7d4cf127674b533e3101f88", + "sha256:5ea81ea3dbd6767873c611687141ec7b06ed8bab43f68fad5b7be184a920dc99", + "sha256:6961548bba529cac7c07af2fd4d527c5b91bb8fe18995fed6044ac22b3d14644", + "sha256:75aaa27aa521a182824d89e5ab0a1d16ca207318a6b65042b046053cfc8ed07a", + "sha256:7a2dd66d2d4df34fa82c9dc85657c5e019b87932019947faece7983f2089a840", + "sha256:8a51f2c6d1f884e98846a0a9021ff6861bdb98457879f412fdc2b42d14494067", + "sha256:9c568495e35599625f7b999774e29e8d6b01a6fb684d77dee1f56d41b11b40cd", + "sha256:9eddaafb3c48e0900690c1727fba226c4804b8e6127ea409689c3bb492d06de4", + "sha256:bbb332d45b32df41200380fff14712cb6093b61bd142272a10b16778c418e98e", + "sha256:bc3d98f621898b4a9bc7fecc00513eec8f40b5b83913d74ccb445f037d58cd89", + "sha256:c11d6033115dc4887c456565303f540c44197f4fc1a2bfb192224a301534888e", + "sha256:c50a724d136ec10d920661f1442e4a8b010a4fe5aebd65e0c2241ea41dbe93dc", + "sha256:d0a5095d52b90ff38592bbdc2644f17c6d495762edf47d876049cfd2968fbccf", + "sha256:d6cff2276e502b86a25fd10c2a96973fdb45c7a977dca2138d661417f3728341", + "sha256:e46d13f38cfcbb79bfdb2964b0fe12561fe633caf964a77a5f8d4e45fe5d2ef7" + ], + "version": "==2020.7.14" + }, "s3transfer": { "hashes": [ "sha256:2482b4259524933a022d59da830f51bd746db62f047d6eb213f2f8855dcb8a13", @@ -250,6 +309,7 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==1.15.0" }, "terrascan": { @@ -267,6 +327,32 @@ ], "version": "==0.10.1" }, + "typed-ast": { + "hashes": [ + "sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355", + "sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919", + "sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa", + "sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652", + "sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75", + "sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01", + "sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d", + "sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1", + "sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907", + "sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c", + "sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3", + "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b", + "sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614", + "sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb", + "sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b", + "sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41", + "sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6", + "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34", + "sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe", + "sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4", + "sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7" + ], + "version": "==1.4.1" + }, "urllib3": { "hashes": [ "sha256:91056c15fa70756691db97756772bb1eb9678fa585d9184f24534b100dc60f4a", diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index cedac356..a5432d0c 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -41,8 +41,9 @@ For some linters it is also possible to override rules on a case by case level w - [Perl](#perl) - [PHP](#php) - [Protocol Buffers](#protocol-buffers) - - [Python3 pylint](#python3-pylint) + - [Python3 black](#python3-black) - [Python3 flake8](#python3-flake8) + - [Python3 pylint](#python3-pylint) - [R](#r) - [Raku](#raku) - [Ruby](#ruby) @@ -940,6 +941,29 @@ var = "terrible code down here..." ``` --- + +## Python3 black + +- `https://black.readthedocs.io/en/stable/installation_and_usage.html#` + +### Black Config file + +- There is no top level _configuration file_ available at this time + +### Black disable single line + +- There is currently **No** way to disable rules inline of the file(s) + +### Black disable code block + +- There is currently **No** way to disable rules inline of the file(s) + +### Black disable entire file + +- There is currently **No** way to disable rules inline of the file(s) + +--- + ## R - [lintr](https://github.com/jimhester/lintr) diff --git a/lib/linter.sh b/lib/linter.sh index 1b57ffb2..fab24b88 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -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' 'cfn-lint' 'checkstyle' 'chktex' 'clj-kondo' 'coffeelint' +LINTER_ARRAY=('ansible-lint' 'arm-ttk' 'asl-validator' 'black' 'cfn-lint' 'checkstyle' 'chktex' 'clj-kondo' 'coffeelint' 'dart' 'dockerfilelint' 'dotenv-linter' 'editorconfig-checker' 'eslint' 'flake8' 'golangci-lint' 'hadolint' 'htmlhint' 'jsonlint' 'ktlint' 'lintr' 'lua' 'markdownlint' 'npm-groovy-lint' 'perl' 'protolint' 'pwsh' 'pylint' 'raku' 'rubocop' 'shellcheck' 'spectral' 'standard' 'stylelint' 'sql-lint' @@ -146,7 +146,7 @@ LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'CLOUDFORMATION' 'CLOJURE' 'COFFEESCRIPT' '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' - 'PROTOBUF' 'PYTHON_PYLINT' 'PYTHON_FLAKE8' 'R' 'RAKU' 'RUBY' 'STATES' 'SQL' 'TERRAFORM' + 'PROTOBUF' 'PYTHON_BLACK' 'PYTHON_PYLINT' 'PYTHON_FLAKE8' 'R' 'RAKU' 'RUBY' 'STATES' 'SQL' 'TERRAFORM' 'TERRAFORM_TERRASCAN' 'TSX' 'TYPESCRIPT_ES' 'TYPESCRIPT_STANDARD' 'XML' 'YAML') ############################################ @@ -202,8 +202,9 @@ VALIDATE_PHP_PHPCS="${VALIDATE_PHP_PHPCS}" # Boolean t VALIDATE_PHP_PHPSTAN="${VALIDATE_PHP_PHPSTAN}" # Boolean to validate language VALIDATE_PHP_PSALM="${VALIDATE_PHP_PSALM}" # Boolean to validate language VALIDATE_POWERSHELL="${VALIDATE_POWERSHELL}" # Boolean to validate language -VALIDATE_PYTHON_PYLINT="${VALIDATE_PYTHON:-$VALIDATE_PYTHON_PYLINT}" # Boolean to validate language VALIDATE_PYTHON_FLAKE8="${VALIDATE_PYTHON_FLAKE8}" # Boolean to validate language +VALIDATE_PYTHON_BLACK="${VALIDATE_PYTHON_BLACK}" # Boolean to validate language +VALIDATE_PYTHON_PYLINT="${VALIDATE_PYTHON:-$VALIDATE_PYTHON_PYLINT}" # Boolean to validate language VALIDATE_R="${VALIDATE_R}" # Boolean to validate language VALIDATE_RAKU="${VALIDATE_RAKU}" # Boolean to validate language VALIDATE_RUBY="${VALIDATE_RUBY}" # Boolean to validate language @@ -302,6 +303,7 @@ FILE_ARRAY_PHP_PHPSTAN=() # Array of files to check FILE_ARRAY_PHP_PSALM=() # Array of files to check FILE_ARRAY_POWERSHELL=() # Array of files to check FILE_ARRAY_PROTOBUF=() # Array of files to check +FILE_ARRAY_PYTHON_BLACK=() # Array of files to check FILE_ARRAY_PYTHON_PYLINT=() # Array of files to check FILE_ARRAY_PYTHON_FLAKE8=() # Array of files to check FILE_ARRAY_R=() # Array of files to check @@ -349,8 +351,8 @@ ERRORS_FOUND_GROOVY=0 # Count of errors found export ERRORS_FOUND_GROOVY # Workaround SC2034 ERRORS_FOUND_HTML=0 # Count of errors found export ERRORS_FOUND_HTML # Workaround SC2034 -ERRORS_FOUND_JAVA=0 -export ERRORS_FOUND_JAVA +ERRORS_FOUND_JAVA=0 # Count of errors found +export ERRORS_FOUND_JAVA # Workaround SC2034 ERRORS_FOUND_JAVASCRIPT_STANDARD=0 # Count of errors found export ERRORS_FOUND_JAVASCRIPT_STANDARD # Workaround SC2034 ERRORS_FOUND_JAVASCRIPT_ES=0 # Count of errors found @@ -383,6 +385,8 @@ ERRORS_FOUND_POWERSHELL=0 # Count of errors found export ERRORS_FOUND_POWERSHELL # Workaround SC2034 ERRORS_FOUND_PROTOBUF=0 # Count of errors found export ERRORS_FOUND_PROTOBUF # Workaround SC2034 +ERRORS_FOUND_PYTHON_BLACK=0 # Count of errors found +export ERRORS_FOUND_PYTHON_BLACK # Workaround SC2034 ERRORS_FOUND_PYTHON_PYLINT=0 # Count of errors found export ERRORS_FOUND_PYTHON_PYLINT # Workaround SC2034 ERRORS_FOUND_PYTHON_FLAKE8=0 # Count of errors found @@ -1700,9 +1704,20 @@ if [ "${VALIDATE_PROTOBUF}" == "true" ]; then LintCodebase "PROTOBUF" "protolint" "protolint lint --config_path ${PROTOBUF_LINTER_RULES}" ".*\.\(proto\)\$" "${FILE_ARRAY_PROTOBUF[@]}" fi -################## -# PYTHON LINTING # -################## +######################## +# PYTHON BLACK LINTING # +######################## +if [ "${VALIDATE_PYTHON_BLACK}" == "true" ]; then + ######################### + # Lint the python files # + ######################### + # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" + LintCodebase "PYTHON_BLACK" "black" "black --diff --check" ".*\.\(py\)\$" "${FILE_ARRAY_PYTHON_BLACK[@]}" +fi + +######################### +# PYTHON PYLINT LINTING # +######################### if [ "${VALIDATE_PYTHON_PYLINT}" == "true" ]; then ######################### # Lint the python files # @@ -1711,9 +1726,9 @@ if [ "${VALIDATE_PYTHON_PYLINT}" == "true" ]; then LintCodebase "PYTHON_PYLINT" "pylint" "pylint --rcfile ${PYTHON_PYLINT_LINTER_RULES}" ".*\.\(py\)\$" "${FILE_ARRAY_PYTHON_PYLINT[@]}" fi -################## -# PYTHON LINTING # -################## +######################### +# PYTHON FLAKE8 LINTING # +######################### if [ "${VALIDATE_PYTHON_FLAKE8}" == "true" ]; then ######################### # Lint the python files # @@ -1722,9 +1737,9 @@ if [ "${VALIDATE_PYTHON_FLAKE8}" == "true" ]; then LintCodebase "PYTHON_FLAKE8" "flake8" "flake8 --config=${PYTHON_FLAKE8_LINTER_RULES}" ".*\.\(py\)\$" "${FILE_ARRAY_PYTHON_FLAKE8[@]}" fi -################ +############# # R LINTING # -################ +############# if [ "${VALIDATE_R}" == "true" ]; then ########################## # Check for local config # diff --git a/lib/worker.sh b/lib/worker.sh index b17070ef..e2afbee3 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -220,7 +220,7 @@ function LintCodebase() { fi LINT_CMD=$( cd "$r_dir" || exit - R --slave -e "errors <- lintr::lint('$FILE');print(errors);quit(save = 'no', status = if (length(errors) > 0) 1 else 0)" 2>&1 + R --slave -e "errors <- lintr::lint('$FILE');print(errors);quit(save = 'no', status = if (length(errors) > 0) 1 else 0)" 2>&1 ) #LINTER_COMMAND="lintr::lint('${FILE}')" else @@ -452,8 +452,8 @@ function TestCodebase() { ####################################### LINT_CMD=$( cd "${GITHUB_WORKSPACE}" || exit - R --slave -e "errors <- lintr::lint('$FILE');print(errors);quit(save = 'no', status = if (length(errors) > 0) 1 else 0)" 2>&1 - ) + R --slave -e "errors <- lintr::lint('$FILE');print(errors);quit(save = 'no', status = if (length(errors) > 0) 1 else 0)" 2>&1 + ) else ################################ # Lint the file with the rules # @@ -636,8 +636,9 @@ function RunTestCases() { TestCodebase "OPENAPI" "spectral" "spectral lint -r ${OPENAPI_LINTER_RULES}" ".*\.\(ymlopenapi\|jsonopenapi\)\$" "openapi" TestCodebase "POWERSHELL" "pwsh" "Invoke-ScriptAnalyzer -EnableExit -Settings ${POWERSHELL_LINTER_RULES} -Path" ".*\.\(ps1\|psm1\|psd1\|ps1xml\|pssc\|psrc\|cdxml\)\$" "powershell" TestCodebase "PROTOBUF" "protolint" "protolint lint --config_path ${PROTOBUF_LINTER_RULES}" ".*\.\(proto\)\$" "protobuf" - TestCodebase "PYTHON_PYLINT" "pylint" "pylint --rcfile ${PYTHON_PYLINT_LINTER_RULES}" ".*\.\(py\)\$" "python" + TestCodebase "PYTHON_BLACK" "black" "black --diff --check" ".*\.\(py\)\$" "python" TestCodebase "PYTHON_FLAKE8" "flake8" "flake8 --config ${PYTHON_FLAKE8_LINTER_RULES}" ".*\.\(py\)\$" "python" + TestCodebase "PYTHON_PYLINT" "pylint" "pylint --rcfile ${PYTHON_PYLINT_LINTER_RULES}" ".*\.\(py\)\$" "python" TestCodebase "R" "lintr" "lintr::lint()" ".*\.\(r\|rmd\)\$" "r" TestCodebase "RAKU" "raku" "raku -c" ".*\.\(raku\|rakumod\|rakutest\|pm6\|pl6\|p6\)\$" "raku" TestCodebase "RUBY" "rubocop" "rubocop -c ${RUBY_LINTER_RULES}" ".*\.\(rb\)\$" "ruby" From ae133312e9f74bf80a65eebfa02bc1e4a29154a9 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 20 Aug 2020 09:47:01 -0500 Subject: [PATCH 36/37] fix spacing --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 410202de..710d665e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ FROM wata727/tflint:0.19.0 as tflint FROM hadolint/hadolint:latest-alpine as dockerfile-lint FROM assignuser/lintr-lib:latest as lintr-lib FROM assignuser/chktex-alpine:latest as chktex + ################## # Get base image # ################## @@ -75,7 +76,6 @@ RUN apk add --update --no-cache \ readline-dev \ ruby ruby-dev ruby-bundler ruby-rdoc - ######################################## # Copy dependencies files to container # ######################################## From 4f2041dfdf1ed97e9bdd929476a99357e3d27495 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 20 Aug 2020 10:04:36 -0500 Subject: [PATCH 37/37] more spaces --- .automation/test/python/python_good_1.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.automation/test/python/python_good_1.py b/.automation/test/python/python_good_1.py index 0fdfa407..8106d8d8 100644 --- a/.automation/test/python/python_good_1.py +++ b/.automation/test/python/python_good_1.py @@ -57,6 +57,7 @@ def create_label(repo_id, label): return response + def get_labels(owner, repo): """ Gets a list of labels from the supplied repo. @@ -95,6 +96,7 @@ def get_labels(owner, repo): ) ) + def delete_label(label_id): """ Delete the specified label @@ -117,6 +119,7 @@ def delete_label(label_id): return result + @click.command() @click.option("--dry", is_flag=True) @click.argument("source_repo") @@ -185,6 +188,7 @@ def copy_labels(source_repo, target_repo, dry): print("Done") + if __name__ == "__main__": # Pylint doesn't know that @click.command takes care of injecting the # function parameters. Disabling Pylint error.