From cbe2176c33d1fd0171e51720b28925f1092f2d3a Mon Sep 17 00:00:00 2001 From: Aman Sharma <56108587+aman556@users.noreply.github.com> Date: Fri, 3 Sep 2021 18:12:54 +0530 Subject: [PATCH] Add Misspell linter github workflow (#1266) - Install misspelllinter using binaries. - Refer hack/.misspellignore to see all the files that get ignored from misspell linter. - All the files in repo other then .misspellignore are corrected. - Add .github/workflows/check-misspell.yaml github workflow Signed-off-by: Aman Sharma <amansh@vmware.com> Signed-off-by: Rajas Kakodkar <rkakodkar@vmware.com> Co-authored-by: Aman Sharma <amansh@vmware.com> Co-authored-by: Rajas Kakodkar <rkakodkar@vmware.com> Co-authored-by: Rajas Kakodkar <rkakodkar@vmware.com> --- .github/workflows/check-misspell.yaml | 27 +++++++++++++++++++ CONTRIBUTING.md | 6 ++--- Makefile | 6 +++-- addons/packages/external-dns/0.8.0/README.md | 4 +-- .../overlay-grafana-dashboard-apiserver.yaml | 2 +- .../pinniped/0.4.3/bundle/config/values.yaml | 4 +-- .../0.4.3/bundle/examples/mc-ldap.yaml | 2 +- .../0.4.3/bundle/examples/mc-oidc.yaml | 2 +- .../pinniped/0.4.3/bundle/examples/wlc.yaml | 4 +-- .../pinniped/0.4.4/bundle/config/values.yaml | 4 +-- .../0.4.4/bundle/examples/mc-ldap.yaml | 2 +- .../0.4.4/bundle/examples/mc-oidc.yaml | 2 +- .../pinniped/0.4.4/bundle/examples/wlc.yaml | 4 +-- addons/packages/prometheus/2.27.0/README.md | 2 +- hack/.misspellignore | 1 + hack/check-misspell.sh | 25 +++++++++++++++++ test/add-tce-package-repo.sh | 2 +- 17 files changed, 77 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/check-misspell.yaml create mode 100644 hack/.misspellignore create mode 100755 hack/check-misspell.sh diff --git a/.github/workflows/check-misspell.yaml b/.github/workflows/check-misspell.yaml new file mode 100644 index 00000000..a6ede135 --- /dev/null +++ b/.github/workflows/check-misspell.yaml @@ -0,0 +1,27 @@ +name: Check misspell + +on: + pull_request: + types: + - assigned + - opened + - synchronize + - reopened + +jobs: + checkmisspell: + name: Check misspell + runs-on: ubuntu-latest + steps: + - name: Config credentials + env: + GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} + run: | + git config --global url."https://git:$GITHUB_TOKEN@github.com".insteadOf "https://github.com" + + - name: Check out code + uses: actions/checkout@v1 + + - name: Run misspell + run: | + make misspell diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b1894974..b1820cce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -184,7 +184,7 @@ By making a contribution to this project, I certify that: ### Multiple Go Modules -The TCE project is made up of many different, seperate Go modules. +The TCE project is made up of many different, separate Go modules. Each module has its own `go.mod` and `go.sum` file located in the "root" of that individual, digestible piece of software. This allows TCE to not have a single dependency graph, but rather, multiple, independent dependency graphs. Experimental plugins or packages can pull in different versions of the same library without creating conflicts and collisions. @@ -214,9 +214,9 @@ it _is_ expected that each Makefile provide the following targets: - `make e2e-test`: invokes an E2E testing suite - `make lint`: invokes linting protocols for the individual module. For example, in a Go project, it should call Golangci-lint. - `make get-deps`: gets the necessary dependencies for running, testing, and building. Typically is `go mod download` in Go modules -- `make build`: builds the individual peice of software +- `make build`: builds the individual piece of software -Some of these targets may be irrelivent to you and your project. +Some of these targets may be irrelevant to you and your project. The top level TCE Makefile still expects these targets to be present, but it's ok to simply print a message stating the target is being skipped or is not applicable. diff --git a/Makefile b/Makefile index f9ebace2..8e3ac31d 100644 --- a/Makefile +++ b/Makefile @@ -96,8 +96,8 @@ OCI_REGISTRY := projects.registry.vmware.com/tce ##### IMAGE ##### ##### LINTING TARGETS ##### -.PHONY: lint mdlint shellcheck check yamllint -check: ensure-deps lint mdlint shellcheck yamllint +.PHONY: lint mdlint shellcheck check yamllint misspell +check: ensure-deps lint mdlint shellcheck yamllint misspell .PHONY: ensure-deps ensure-deps: @@ -125,6 +125,8 @@ shellcheck: yamllint: hack/check-yaml.sh +misspell: + hack/check-misspell.sh ##### LINTING TARGETS ##### diff --git a/addons/packages/external-dns/0.8.0/README.md b/addons/packages/external-dns/0.8.0/README.md index 43583332..6b23c04a 100644 --- a/addons/packages/external-dns/0.8.0/README.md +++ b/addons/packages/external-dns/0.8.0/README.md @@ -136,7 +136,7 @@ The final step in creating the user is to copy the access keys. These credential ### 3. Hosted Zone -You can follow the instructions in the official [documentation](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#set-up-a-hosted-zone), or here. The official documentation creates a subdomain on the hosted zone. You can do this, or just use the hosted zone itself. There is a special step if you choose the subdomain route that is not reflected in the official documentation. This example will follow the offical documentation and call out the additional step. +You can follow the instructions in the official [documentation](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#set-up-a-hosted-zone), or here. The official documentation creates a subdomain on the hosted zone. You can do this, or just use the hosted zone itself. There is a special step if you choose the subdomain route that is not reflected in the official documentation. This example will follow the official documentation and call out the additional step. For this example, we will be using the domain `k8squid.com`, and a subdomain of `external-dns-test`. Create the new hosted zone. @@ -253,6 +253,6 @@ NAMESPACE NAME DESCRIPTION SINCE-DEPLOY AGE my-packages external-dns Reconcile succeeded 26s 26s ``` -ExternalDNS should now be installed and running on your cluster. To verify that it works, you can follow the example in the [offical documentation using a service](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#verify-externaldns-works-service-example). Be sure to substitute your domain name and hosted zone id in service manifest and relevant AWS CLI commands. +ExternalDNS should now be installed and running on your cluster. To verify that it works, you can follow the example in the [official documentation using a service](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#verify-externaldns-works-service-example). Be sure to substitute your domain name and hosted zone id in service manifest and relevant AWS CLI commands. >鈿狅笍 Note: For more advanced use cases and documentation, see the official ExternalDNS [documentation](https://github.com/kubernetes-sigs/external-dns). diff --git a/addons/packages/grafana/7.5.7/bundle/config/overlays/overlay-grafana-dashboard-apiserver.yaml b/addons/packages/grafana/7.5.7/bundle/config/overlays/overlay-grafana-dashboard-apiserver.yaml index af1a6063..5125460b 100644 --- a/addons/packages/grafana/7.5.7/bundle/config/overlays/overlay-grafana-dashboard-apiserver.yaml +++ b/addons/packages/grafana/7.5.7/bundle/config/overlays/overlay-grafana-dashboard-apiserver.yaml @@ -114,7 +114,7 @@ "dashes": false, "datasource": "$datasource", "decimals": 3, - "description": "How much error budget is left looking at our 0.990% availability gurantees?", + "description": "How much error budget is left looking at our 0.990% availability guarantees?", "fieldConfig": { "defaults": { "custom": {} diff --git a/addons/packages/pinniped/0.4.3/bundle/config/values.yaml b/addons/packages/pinniped/0.4.3/bundle/config/values.yaml index 1e86bb1a..5930c7c9 100644 --- a/addons/packages/pinniped/0.4.3/bundle/config/values.yaml +++ b/addons/packages/pinniped/0.4.3/bundle/config/values.yaml @@ -17,7 +17,7 @@ imageInfo: infrastructure_provider: null tkg_cluster_role: null custom_cluster_issuer: "" #! provide if user wants to use a custom ClusterIssuer for both Pinniped and Dex certificates -custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the smae name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces. +custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the same name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces. http_proxy: "" https_proxy: "" no_proxy: "" @@ -74,7 +74,7 @@ dex: #! value could also be picked up by ytt if no data value overrides it. connector: null staticClients: [] #! This is normally provided by the addon Secret - issuerPort: "30167" #! requred only for MGMT_CLUSTER_VIP if provider is vsphere. Default is "30167" + issuerPort: "30167" #! required only for MGMT_CLUSTER_VIP if provider is vsphere. Default is "30167" oidc: CLIENT_ID: null #! required if oidc enabled CLIENT_SECRET: null #! required if oidc enabled diff --git a/addons/packages/pinniped/0.4.3/bundle/examples/mc-ldap.yaml b/addons/packages/pinniped/0.4.3/bundle/examples/mc-ldap.yaml index e41a7a28..80091e17 100644 --- a/addons/packages/pinniped/0.4.3/bundle/examples/mc-ldap.yaml +++ b/addons/packages/pinniped/0.4.3/bundle/examples/mc-ldap.yaml @@ -17,7 +17,7 @@ imageInfo: infrastructure_provider: vsphere #! required, valid values are [vsphere, aws, azure] tkg_cluster_role: management #! required custom_cluster_issuer: "" #! provide if user wants to use a custom ClusterIssuer for both Pinniped and Dex certificates -custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the smae name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces +custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the same name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces http_proxy: "" https_proxy: "" no_proxy: "" diff --git a/addons/packages/pinniped/0.4.3/bundle/examples/mc-oidc.yaml b/addons/packages/pinniped/0.4.3/bundle/examples/mc-oidc.yaml index c54a0223..e005325c 100644 --- a/addons/packages/pinniped/0.4.3/bundle/examples/mc-oidc.yaml +++ b/addons/packages/pinniped/0.4.3/bundle/examples/mc-oidc.yaml @@ -14,7 +14,7 @@ imageInfo: infrastructure_provider: vsphere #! required, valid values are [vsphere, aws, azure] tkg_cluster_role: management #! required custom_cluster_issuer: "" #! provide if user wants to use a custom ClusterIssuer for both Pinniped and Dex certificates -custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the smae name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces. +custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the same name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces. http_proxy: "" https_proxy: "" no_proxy: "" diff --git a/addons/packages/pinniped/0.4.3/bundle/examples/wlc.yaml b/addons/packages/pinniped/0.4.3/bundle/examples/wlc.yaml index 9a31aaa0..d7bf6acd 100644 --- a/addons/packages/pinniped/0.4.3/bundle/examples/wlc.yaml +++ b/addons/packages/pinniped/0.4.3/bundle/examples/wlc.yaml @@ -15,5 +15,5 @@ infrastructure_provider: vsphere #! required, valid values are [vsphere, aws, az tkg_cluster_role: workload #! required, valid values are [management, workload] identity_management_type: oidc #! required, valid values are [oidc, ldap] pinniped: - supervisor_svc_endpoint: "https://<pinniped-supervisor-svc-host>:<port>" #! requried for workload cluster - supervisor_ca_bundle_data: "LS0tLS1CRxxxxxxxVSVElGSUNBVEUtLS0tLQo=" #! requried for workload cluster. Should be a valid base64 encoded string + supervisor_svc_endpoint: "https://<pinniped-supervisor-svc-host>:<port>" #! required for workload cluster + supervisor_ca_bundle_data: "LS0tLS1CRxxxxxxxVSVElGSUNBVEUtLS0tLQo=" #! required for workload cluster. Should be a valid base64 encoded string diff --git a/addons/packages/pinniped/0.4.4/bundle/config/values.yaml b/addons/packages/pinniped/0.4.4/bundle/config/values.yaml index 1e86bb1a..5930c7c9 100644 --- a/addons/packages/pinniped/0.4.4/bundle/config/values.yaml +++ b/addons/packages/pinniped/0.4.4/bundle/config/values.yaml @@ -17,7 +17,7 @@ imageInfo: infrastructure_provider: null tkg_cluster_role: null custom_cluster_issuer: "" #! provide if user wants to use a custom ClusterIssuer for both Pinniped and Dex certificates -custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the smae name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces. +custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the same name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces. http_proxy: "" https_proxy: "" no_proxy: "" @@ -74,7 +74,7 @@ dex: #! value could also be picked up by ytt if no data value overrides it. connector: null staticClients: [] #! This is normally provided by the addon Secret - issuerPort: "30167" #! requred only for MGMT_CLUSTER_VIP if provider is vsphere. Default is "30167" + issuerPort: "30167" #! required only for MGMT_CLUSTER_VIP if provider is vsphere. Default is "30167" oidc: CLIENT_ID: null #! required if oidc enabled CLIENT_SECRET: null #! required if oidc enabled diff --git a/addons/packages/pinniped/0.4.4/bundle/examples/mc-ldap.yaml b/addons/packages/pinniped/0.4.4/bundle/examples/mc-ldap.yaml index e41a7a28..80091e17 100644 --- a/addons/packages/pinniped/0.4.4/bundle/examples/mc-ldap.yaml +++ b/addons/packages/pinniped/0.4.4/bundle/examples/mc-ldap.yaml @@ -17,7 +17,7 @@ imageInfo: infrastructure_provider: vsphere #! required, valid values are [vsphere, aws, azure] tkg_cluster_role: management #! required custom_cluster_issuer: "" #! provide if user wants to use a custom ClusterIssuer for both Pinniped and Dex certificates -custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the smae name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces +custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the same name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces http_proxy: "" https_proxy: "" no_proxy: "" diff --git a/addons/packages/pinniped/0.4.4/bundle/examples/mc-oidc.yaml b/addons/packages/pinniped/0.4.4/bundle/examples/mc-oidc.yaml index c54a0223..e005325c 100644 --- a/addons/packages/pinniped/0.4.4/bundle/examples/mc-oidc.yaml +++ b/addons/packages/pinniped/0.4.4/bundle/examples/mc-oidc.yaml @@ -14,7 +14,7 @@ imageInfo: infrastructure_provider: vsphere #! required, valid values are [vsphere, aws, azure] tkg_cluster_role: management #! required custom_cluster_issuer: "" #! provide if user wants to use a custom ClusterIssuer for both Pinniped and Dex certificates -custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the smae name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces. +custom_tls_secret: "" #! provide if user wants to use a custom TLS secret for both Pinniped and Dex, will override the ClusterIssuer above if specified, user should create secret with the same name in both "tanzu-system-auth" and "pinniped-supervisor" namespaces. http_proxy: "" https_proxy: "" no_proxy: "" diff --git a/addons/packages/pinniped/0.4.4/bundle/examples/wlc.yaml b/addons/packages/pinniped/0.4.4/bundle/examples/wlc.yaml index 9a31aaa0..d7bf6acd 100644 --- a/addons/packages/pinniped/0.4.4/bundle/examples/wlc.yaml +++ b/addons/packages/pinniped/0.4.4/bundle/examples/wlc.yaml @@ -15,5 +15,5 @@ infrastructure_provider: vsphere #! required, valid values are [vsphere, aws, az tkg_cluster_role: workload #! required, valid values are [management, workload] identity_management_type: oidc #! required, valid values are [oidc, ldap] pinniped: - supervisor_svc_endpoint: "https://<pinniped-supervisor-svc-host>:<port>" #! requried for workload cluster - supervisor_ca_bundle_data: "LS0tLS1CRxxxxxxxVSVElGSUNBVEUtLS0tLQo=" #! requried for workload cluster. Should be a valid base64 encoded string + supervisor_svc_endpoint: "https://<pinniped-supervisor-svc-host>:<port>" #! required for workload cluster + supervisor_ca_bundle_data: "LS0tLS1CRxxxxxxxVSVElGSUNBVEUtLS0tLQo=" #! required for workload cluster. Should be a valid base64 encoded string diff --git a/addons/packages/prometheus/2.27.0/README.md b/addons/packages/prometheus/2.27.0/README.md index 9226d786..9096ffed 100644 --- a/addons/packages/prometheus/2.27.0/README.md +++ b/addons/packages/prometheus/2.27.0/README.md @@ -87,7 +87,7 @@ The following configuration values can be set to customize the prometheus / aler | cadvisor.daemonset.podAnnotations | The cadvisor deployments pod annotations | map | {} | | cadvisor.daemonset.podLabels | The cadvisor deployments pod labels | map | {} | | ingress.enabled | Enable/disable ingress for prometheus and alertmanager | boolean | false | -| ingress.virtual_host_fqdn | Hostname for accessing promethues and alertmanager | string | prometheus.system.tanzu | +| ingress.virtual_host_fqdn | Hostname for accessing prometheus and alertmanager | string | prometheus.system.tanzu | | ingress.prometheus_prefix | Path prefix for prometheus | string | / | | ingress.alertmanager_prefix | Path prefix for alertmanager | string | /alertmanager/ | | ingress.prometheusServicePort | Prometheus service port to proxy traffic to | integer | 80 | diff --git a/hack/.misspellignore b/hack/.misspellignore new file mode 100644 index 00000000..0012cf82 --- /dev/null +++ b/hack/.misspellignore @@ -0,0 +1 @@ +docs/site/ diff --git a/hack/check-misspell.sh b/hack/check-misspell.sh new file mode 100755 index 00000000..3c8fe016 --- /dev/null +++ b/hack/check-misspell.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Copyright 2021 VMware Tanzu Community Edition contributors. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + + +set -o errexit +set -o nounset +set -o pipefail + + +MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +# Install tools we need if it is not present +if [[ ! -f "${MY_DIR}/tools/bin/misspell" ]]; then + curl -L https://git.io/misspell | bash + mkdir -p "${MY_DIR}/tools/bin" + mv ./bin/misspell "${MY_DIR}/tools/bin/misspell" +fi + +# Spell checking +# misspell check Project - https://github.com/client9/misspell +misspellignore_files="${MY_DIR}/.misspellignore" +ignore_files=$(cat "${misspellignore_files}") +git ls-files | grep -v "${ignore_files}" | xargs "${MY_DIR}/tools/bin/misspell" | grep "misspelling" && echo "Please fix the errors mentioned and try running make misspell" && exit 1 || echo "Misspell check Pass" diff --git a/test/add-tce-package-repo.sh b/test/add-tce-package-repo.sh index 4ebc5a44..53a68ed8 100755 --- a/test/add-tce-package-repo.sh +++ b/test/add-tce-package-repo.sh @@ -19,7 +19,7 @@ REPO_NAMESPACE="default" # TODO: Use stable version of the tce/main repo once https://github.com/vmware-tanzu/community-edition/issues/1250 is fixed tanzu package repository add ${REPO_NAME} --namespace ${REPO_NAMESPACE} --url ${REPO_URL} -# Wait for reconcilation to happen within ~ 80 x 5 = 400 seconds . 80 iterations, 5 seconds sleep time. +# Wait for reconciliation to happen within ~ 80 x 5 = 400 seconds . 80 iterations, 5 seconds sleep time. # Check status every ~5 seconds interval for (( i = 1 ; i <= 80 ; i++)) do -- GitLab