From 17dff4043fa1e4f0f3f895974fa560836c120b61 Mon Sep 17 00:00:00 2001 From: Karl Cardenas <29551334+karl-cardenas-coding@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:56:54 -0700 Subject: [PATCH] ci: migrate to Vale (#3233) --- .github/workflows/pull_request.yaml | 18 +- .gitignore | 6 + vale.ini | 8 +- .../config/vocabularies/Internal/accept.txt | 196 ------------------ .../config/vocabularies/Internal/reject.txt | 20 -- vale/styles/spectrocloud/acronym.yml | 54 ----- vale/styles/spectrocloud/admonitions.yml | 8 - vale/styles/spectrocloud/colon.yml | 13 -- vale/styles/spectrocloud/condescending.yml | 17 -- vale/styles/spectrocloud/inclusive.yml | 11 - vale/styles/spectrocloud/longform.yml | 25 --- vale/styles/spectrocloud/oxford-comma.yml | 8 - .../spectrocloud/plural-parantheses.yaml | 12 -- vale/styles/spectrocloud/product-ui.yml | 12 -- vale/styles/spectrocloud/spectrocloud.yml | 18 -- 15 files changed, 11 insertions(+), 415 deletions(-) delete mode 100644 vale/styles/config/vocabularies/Internal/accept.txt delete mode 100644 vale/styles/config/vocabularies/Internal/reject.txt delete mode 100644 vale/styles/spectrocloud/acronym.yml delete mode 100644 vale/styles/spectrocloud/admonitions.yml delete mode 100644 vale/styles/spectrocloud/colon.yml delete mode 100644 vale/styles/spectrocloud/condescending.yml delete mode 100644 vale/styles/spectrocloud/inclusive.yml delete mode 100644 vale/styles/spectrocloud/longform.yml delete mode 100644 vale/styles/spectrocloud/oxford-comma.yml delete mode 100644 vale/styles/spectrocloud/plural-parantheses.yaml delete mode 100644 vale/styles/spectrocloud/product-ui.yml delete mode 100644 vale/styles/spectrocloud/spectrocloud.yml diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 473b0d1823..4004d53b20 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -15,7 +15,6 @@ env: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_KEY }} AWS_DEFAULT_REGION: us-east-1 APPZI_TOKEN: ${{ secrets.APPZI_TOKEN }} - MENDABLE_API_KEY: ${{ secrets.MENDABLE_API_KEY }} FULLSTORY_ORGID: ${{ secrets.FULLSTORY_ORGID }} ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }} ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} @@ -39,22 +38,7 @@ jobs: vale: name: Writing Checks needs: [run-ci] - runs-on: ubuntu-latest - if: ${{ !github.event.pull_request.draft }} - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - - name: Vale Check - uses: errata-ai/vale-action@reviewdog - with: - filter_mode: added - reporter: github-pr-review - vale_flags: --glob=*.{md} --minAlertLevel=error - fail_on_error: false - version: 3.5.0 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + uses: spectrocloud/spectro-vale-pkg/.github/workflows/vale.yml@main prettier: name: Check Code Formatting diff --git a/.gitignore b/.gitignore index dc9ca95f9e..f76d0c2117 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,9 @@ artifact.zip # Ignore _partials/index.ts _partials/index.ts + + +.vale-config/ +vale/styles/spectrocloud/ +vale/styles/spectrocloud-docs-internal/ +vale/styles/config/vocabularies/spectrocloud-vocab \ No newline at end of file diff --git a/vale.ini b/vale.ini index 0385358852..3f85be8868 100644 --- a/vale.ini +++ b/vale.ini @@ -1,14 +1,14 @@ StylesPath = vale/styles -Vocab = Internal +Vocab = spectrocloud-vocab MinAlertLevel = suggestion -Packages = Google, write-good, alex +Packages = Google, write-good, alex, https://github.com/spectrocloud/spectro-vale-pkg/releases/latest/download/spectrocloud-docs-internal.zip [*.md] -BasedOnStyles = Vale, Google, write-good, alex -IgnoredScopes = code, tt, +BasedOnStyles = Vale, Google, write-good, alex, spectrocloud-docs-internal +IgnoredScopes = code, tt, img, url, a, ; BlockIgnores = ; The following line ignores all import statements in markdown files diff --git a/vale/styles/config/vocabularies/Internal/accept.txt b/vale/styles/config/vocabularies/Internal/accept.txt deleted file mode 100644 index fa0e427ffd..0000000000 --- a/vale/styles/config/vocabularies/Internal/accept.txt +++ /dev/null @@ -1,196 +0,0 @@ -Xeon -Spectro -Spectro Cloud -SOC 2 -IPs -VMware -kCh -data center -CVEs -hotfixes -kubectl -is -Cloud -cloud -simple -execute -CLI -reject -disable -modify -VNet -Kubelet -We -vSphere -kubeadm -upsize -Alertmanager -alertmanager -application -Application -grafana -Grafana -etcd -SRE -SREs -EKS -AKS -GKE -admin -Autoscaler -autoscaler -Fargate -VPC -VPCs -subnets -subnet -AZs -VMs -IaaS -autoscaling -Tencent -serverless -vCenter -Palette Dev Engine -Dev -dev -Postgres -hostname -Hostname -enablement -Enablement -Namespace -namespace -Lua -Konvoy -Kairos -virtualized -Ceph -Traefik -serverless -Serverless -k3s -bootable -balenaEtcher -ovftool -cdrtools -readme -Netlify -http -https -Vercel -preboot -operationalize -passthrough -htpasswd -config -kubeconfig -addon -Thanos -HTTPS -HTTP -ClusterRole -ClusterRoleBindings -RoleBindings -RoleBinding -kubeconfig -Nginx -Repo -datastore -uxp -wodim -Letsencrypt -Bitnami -GCP -Ansible -Nvidia -Portworx -Topolvm -Palette Upgrader -imageSwap -subcommand -subcommands -MAAS -nameserver -uncomment -OAuth -unsecure -vMotion -repavement -Repavement -repave -Repave -K3s -boolean -Velero -MinIO -vCluster -Fluentbit -Dex -Falco -Kibana -Fluentd -Libvirt -kubenet -Metadata Syncer -Kubernetes NFS Subdir External Provisioner -Splunk -Kubevious -Citrix -Disable -Hotfixes -Hotfix -Layer 2 -L2 -HashiCorp -airgap -Airgap -jq -Caddy -jumpbox -Oras -oras -Netplan -Astra Trident -Astra -FSx -liveness -Autosupport -Okta -Keycloak -autoscale -initContainer -ethernet -hostname -Entra -README -Tailscale -Tailnet -Sanitization -sanitization -Filepath -untrusted -goroutines -renegotiation -renegotiations -wpa_supplicant -Podman -filepath -Datagram -PCGs -vCPU -vCPUs -ORAS -preload -preloaded -eXtented -Palette eXtented Kubernetes -Palette eXtented Kubernetes - Edge -timeframe -Luet -rhel -Ubuntu -RHEL -repave -airgap -Crossplane \ No newline at end of file diff --git a/vale/styles/config/vocabularies/Internal/reject.txt b/vale/styles/config/vocabularies/Internal/reject.txt deleted file mode 100644 index 7dfe9f40a7..0000000000 --- a/vale/styles/config/vocabularies/Internal/reject.txt +++ /dev/null @@ -1,20 +0,0 @@ -spectro cloud -datacenter -spectrocloud -cli -ribbon menu -left ribbon menu -blue ribbon menu -slide menu -Palette console -Palette Management console -Palette management console -Pre-requisite -pre-requisite -Hence -hence -VSphere -VMWare -on-premises -readme -Readme \ No newline at end of file diff --git a/vale/styles/spectrocloud/acronym.yml b/vale/styles/spectrocloud/acronym.yml deleted file mode 100644 index 75e0b77f30..0000000000 --- a/vale/styles/spectrocloud/acronym.yml +++ /dev/null @@ -1,54 +0,0 @@ -extends: conditional -message: "Use title case to define the acronym '%s'." -link: 'https://spectrocloud.atlassian.net/wiki/spaces/DE/pages/1765933057/Spectro+Cloud+Internal+Style+Guide#Acronyms' -level: error -ignorecase: false -scope: text -# Match two to five capital letters surrounded by brackets -# to detect an acronym definition. -first: '[(][A-Z]{2,5}[)]' -# Match two to five capitalised words separated by any number of dashes -# or whitespaces before the acronym definition. -second: '(\b(([A-Z][a-z]+)[\-\s ]{1,}){2,5})([(][A-Z]{2,5}[)])' -exceptions: - - (API) - - (AWS) - - (BYOOS) - - (CAPI) - - (CLI) - - (CPU) - - (CSS) - - (CSV) - - (FAQ) - - (GCP) - - (GET) - - (GPU) - - (HTML) - - (HTTP) - - (HTTPS) - - (IDE) - - (IP) - - (ISO) - - (JPEG) - - (JPG) - - (JSON) - - (OS) - - (OSS) - - (PDF) - - (PNG) - - (POST) - - (RAM) - - (SDK) - - (SQL) - - (SSH) - - (SSL) - - (SVG) - - (TCP) - - (URI) - - (URL) - - (USB) - - (VIP) - - (YAML) - - (YML) - - (XML) - - (ZIP) diff --git a/vale/styles/spectrocloud/admonitions.yml b/vale/styles/spectrocloud/admonitions.yml deleted file mode 100644 index 7022fc26e0..0000000000 --- a/vale/styles/spectrocloud/admonitions.yml +++ /dev/null @@ -1,8 +0,0 @@ -extends: substitution -message: "The ':::note' admonition is not approved under the Spectro Cloud style guide. Consider using ':::info' or another approved admonition." -link: https://spectrocloud.atlassian.net/wiki/spaces/DE/pages/1765933057/Spectro+Cloud+Internal+Style+Guide#Admonitions/Callouts -level: error -nonword: true -ignorecase: true -swap: - ":::note": ":::info" \ No newline at end of file diff --git a/vale/styles/spectrocloud/colon.yml b/vale/styles/spectrocloud/colon.yml deleted file mode 100644 index 7facf72223..0000000000 --- a/vale/styles/spectrocloud/colon.yml +++ /dev/null @@ -1,13 +0,0 @@ -extends: existence -message: "Use colons only to introduce lists, unless in code blocks or inline code." -link: https://spectrocloud.atlassian.net/wiki/spaces/DE/pages/1765933057/Spectro+Cloud+Internal+Style+Guide#Colon-Usage -nonword: true -level: error -scope: raw -tokens: - - '(? Menu" - "nested nav bar": " Menu" - "three dots": "three-dot Menu" - "dropdown menu": "drop-down Menu" diff --git a/vale/styles/spectrocloud/spectrocloud.yml b/vale/styles/spectrocloud/spectrocloud.yml deleted file mode 100644 index 67e26f8164..0000000000 --- a/vale/styles/spectrocloud/spectrocloud.yml +++ /dev/null @@ -1,18 +0,0 @@ -extends: existence -message: "Avoid using 'spectrocloud' outside of a URL format. Use 'Spectro Cloud' instead." -level: error -ignorecase: false -nonword: true -tokens: - - 'spectro cloud' - - 'SpectroCloud' - - 'SpectroCloud' - - 'Spectrocloud' - - 'Spectro cloud' - - 'spectro Cloud' -scope: sentence -exceptions: - - '\[mailto:[^@]*@spectrocloud\.com\]' - - '\w*\.spectrocloud\.\w*' - - '@spectrocloud\.com' - - '\[support@spectrocloud\.com\]' \ No newline at end of file