Skip to content

Testing some Vale stuff #5480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 45 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: |
python ./ci/blueberry.py

vale:
vale-errors:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -60,14 +60,57 @@ jobs:
env:
added_modified: ${{ steps.get_changed_files.outputs.added_modified }}
- name: Vale
uses: errata-ai/vale-action@v1.3.0
uses: errata-ai/vale-action@reviewdog
# Only run the Vale step if the list of added and modified
# files inside the docs directory is not empty. If we don't
# add this conditional, the Vale step hangs and never
# completes when it is passed the empty array.
if: ${{ '[]' != steps.select_docs_dir_files.outputs.added_modified }}
with:
files: '${{ steps.select_docs_dir_files.outputs.added_modified }}'
vale_flags: "--config=.vale-gha-errors.ini"
fail_on_error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

vale-warnings:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Get Changed Files
id: get_changed_files
uses: jitterbit/get-changed-files@v1
# The continue-on-error parameter is set to true as a
# workaround for the `head commit is not ahead of base
# commit` error that can appear when the PR branch is
# out of date.
continue-on-error: true
with:
format: 'json'
- name: Install more-utils
run: sudo apt-get install moreutils
- name: Select Files in Docs Dir
# This action filters the list of added and modified
# files to only the files that are in the docs/ directory
id: select_docs_dir_files
run: |
docs_dir_files=$(echo $added_modified | jq -c '[.[] | select(.|test("^docs/"))]')
echo "::set-output name=added_modified::$docs_dir_files"
echo "Added or modified files located within docs/ directory:"
echo $docs_dir_files | jq '.'
env:
added_modified: ${{ steps.get_changed_files.outputs.added_modified }}
- name: Vale
uses: errata-ai/vale-action@reviewdog
# Only run the Vale step if the list of added and modified
# files inside the docs directory is not empty. If we don't
# add this conditional, the Vale step hangs and never
# completes when it is passed the empty array.
if: ${{ '[]' != steps.select_docs_dir_files.outputs.added_modified }}
with:
files: '${{ steps.select_docs_dir_files.outputs.added_modified }}'
vale_flags: "--config=.vale-gha-warnings.ini"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Expand Down
37 changes: 37 additions & 0 deletions .vale-gha-errors.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This configuration only refers to Vale styles that report errors
# The vale-errors GHA uses this config file

StylesPath = ci/vale/styles

# The minimum alert level to display (suggestion, warning, or error).
#
# CI builds will only fail on error-level alerts.
MinAlertLevel = error

# HTML tags to be ignored by Vale. `code` and `tt` are the default, but Linode
# seems to use `strong` in a similar ways -- e.g., `**docker build -t ubuntu**`,
# which could trigger two style issues ("docker" and "ubuntu") but is actually
# a command.
IgnoredScopes = code, strong, tt

# Specifies what Vale considers to be a boundary between words.
WordTemplate = \s(?:%s)\s

[*.md]
# A Linode-specific style (see ci/vale/styles/Linode) that implements spelling
# and capitalization rules.
#
# To add another style, just add it to the `StylesPath` and update the setting
# below (e.g., `BasedOnStyles = Linode, AnotherStyle`).
BasedOnStyles = LinodeErrors

# Exclude `{{< file >}}`, `{{< file-excerpt >}}`, `{{< output >}}`,
# and `{{< highlight ... >}}`.
#
# For a description (and unit tests) for these patterns see:
# https://regex101.com/r/m9klBv/3/tests
IgnorePatterns = (?s) *({{< output >}}.*?{{< ?/ ?output >}}), \
(?s) *({{< ?file [^>]* ?>}}.*?{{< ?/ ?file ?>}}), \
(?s) *({{< highlight [^>]* ?>}}.*?{{< ?/ ?highlight >}}), \
(?s) *({{< image .*? >}}), \
(?s) *({{< content .*? >}})
37 changes: 37 additions & 0 deletions .vale-gha-warnings.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This configuration only refers to Vale styles that report warnings
# The vale-warnings GHA uses this config file

StylesPath = ci/vale/styles

# The minimum alert level to display (suggestion, warning, or error).
#
# CI builds will only fail on error-level alerts.
MinAlertLevel = warning

# HTML tags to be ignored by Vale. `code` and `tt` are the default, but Linode
# seems to use `strong` in a similar ways -- e.g., `**docker build -t ubuntu**`,
# which could trigger two style issues ("docker" and "ubuntu") but is actually
# a command.
IgnoredScopes = code, strong, tt

# Specifies what Vale considers to be a boundary between words.
WordTemplate = \s(?:%s)\s

[*.md]
# A Linode-specific style (see ci/vale/styles/Linode) that implements spelling
# and capitalization rules.
#
# To add another style, just add it to the `StylesPath` and update the setting
# below (e.g., `BasedOnStyles = Linode, AnotherStyle`).
BasedOnStyles = LinodeWarnings

# Exclude `{{< file >}}`, `{{< file-excerpt >}}`, `{{< output >}}`,
# and `{{< highlight ... >}}`.
#
# For a description (and unit tests) for these patterns see:
# https://regex101.com/r/m9klBv/3/tests
IgnorePatterns = (?s) *({{< output >}}.*?{{< ?/ ?output >}}), \
(?s) *({{< ?file [^>]* ?>}}.*?{{< ?/ ?file ?>}}), \
(?s) *({{< highlight [^>]* ?>}}.*?{{< ?/ ?highlight >}}), \
(?s) *({{< image .*? >}}), \
(?s) *({{< content .*? >}})
5 changes: 4 additions & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This configuration is used by default when Vale is invoked locally
# e.g. with the Vale plugin for VS Code or via the command line

StylesPath = ci/vale/styles

# The minimum alert level to display (suggestion, warning, or error).
Expand All @@ -20,7 +23,7 @@ WordTemplate = \s(?:%s)\s
#
# To add another style, just add it to the `StylesPath` and update the setting
# below (e.g., `BasedOnStyles = Linode, AnotherStyle`).
BasedOnStyles = Linode
BasedOnStyles = LinodeErrors, LinodeWarnings

# Exclude `{{< file >}}`, `{{< file-excerpt >}}`, `{{< output >}}`,
# and `{{< highlight ... >}}`.
Expand Down
1 change: 1 addition & 0 deletions ci/vale/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ Gemba
gemfile
genmask
gentoolkit
geo
geoip
geolocating
geolocation
Expand Down
32 changes: 32 additions & 0 deletions ci/vale/styles/LinodeErrors/British.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
extends: consistency
message: "Inconsistent spelling of '%s'"
level: error
ignorecase: true
either:
advisor: adviser
apologise: apologize
armour: armor
behaviour: behavior
centre: center
cheque: check
colour: color
customise: customize
decentralise: decentralize
defence: defense
emphasise: emphasize
finalise: finalize
flavour: flavor
focussed: focused
labour: labor
labelled: labeled
learnt: learned
localise: localize
licence: license
litre: liter
offence: offense
organise: organize
organised: organized
organising: organizing
recognise: recognize
theatre: theater
unauthorised: unauthorized
4 changes: 4 additions & 0 deletions ci/vale/styles/LinodeErrors/Spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends: spelling
message: "Did you really mean '%s'?"
level: error
ignore: ../dictionary.txt
50 changes: 50 additions & 0 deletions ci/vale/styles/LinodeErrors/Terms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
extends: substitution
message: Use '%s' instead of '%s'.
level: error
ignorecase: true
swap:
"(?:LetsEncrypt|Let's Encrypt)": Let's Encrypt
"(?:ReHat|RedHat)": RedHat
"Mac ?OS ?X": Mac OS X
"mongoDB": MongoDB
"node[.]?js": Node.js
"Post?gr?e(?:SQL)": PostgreSQL
"java[ -]?scripts?": JavaScript
automattic: Automattic
centOS: CentOS
cloudflare: Cloudflare
debian: Debian
fedora: Fedora
gentoo: Gentoo
homebrew: Homebrew
Kubeadm: kubeadm
Kubectl: kubectl
Kubelet: kubelet
kubernetes: Kubernetes
Kube Controller Manager: kube-controller-Manager
Kube Proxy: kube-proxy
Kube Scheduler: kube-scheduler
linode cli: Linode CLI
linode manager: Linode Manager
linode: Linode
longview: Longview
macOS: macOS
metabase: Metabase
miniconda: Miniconda
nodebalancer: NodeBalancer
nodebalancers: NodeBalancers
pod: Pod
slackware: Slackware
ubuntu: Ubuntu
wordpress: WordPress
yaml: YAML
urls: URLs
uris: URIs
Cuda: CUDA
gpu: GPU
stackscript: StackScript
typescript: TypeScript
pulumi: Pulumi
markdown: Markdown
vuejs: VueJS
vue: Vue
17 changes: 17 additions & 0 deletions ci/vale/styles/LinodeWarnings/FutureTense.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# Suggestion: FutureTense
#
# Checks for use of future tense in sentences. Present tense is preferred as
# much as possible.
#
# Based on Vale rule from GitLab: https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/.vale/gitlab
extends: existence
message: 'Avoid using future tense: "%s"'
ignorecase: true
level: warning
link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#language-to-avoid
raw:
- "(going to( |\n|[[:punct:]])[a-zA-Z]*|"
- "will( |\n|[[:punct:]])[a-zA-Z]*|"
- "won't( |\n|[[:punct:]])[a-zA-Z]*|"
- "[a-zA-Z]*'ll( |\n|[[:punct:]])[a-zA-Z]*)"
13 changes: 13 additions & 0 deletions ci/vale/styles/LinodeWarnings/OxfordComma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# Warning: OxfordComma
#
# Checks for the lack of an Oxford comma. In some cases, will catch overly
# complex sentence structures with lots of commas.
#
# Based on Vale rule from GitLab: https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/.vale/gitlab
extends: existence
message: 'Use a comma before the last "and" or "or" in a list of four or more items.'
link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#punctuation
level: warning
raw:
- '(?:[\w-_` ]+,){2,}(?:[\w-_` ]+) (and |or )'
13 changes: 13 additions & 0 deletions ci/vale/styles/LinodeWarnings/SentenceLength.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# Warning: SentenceLength
#
# Counts words in a sentence and alerts if a sentence exceeds 25 words.
#
# Based on Vale rule from GitLab: https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/.vale/gitlab
extends: occurrence
message: 'Shorter sentences improve readability (max 25 words).'
scope: sentence
link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#language
level: warning
max: 25
token: \b(\w+)\b
17 changes: 17 additions & 0 deletions ci/vale/styles/LinodeWarnings/SentenceSpacing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# Warning: SentenceSpacing
#
# Checks for the following in common content scenarios:
#
# - No spaces.
# - More than one space.
#
# Based on Vale rule from GitLab: https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/.vale/gitlab
extends: existence
message: '"%s" must contain one and only one space.'
link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#punctuation
level: warning
nonword: true
tokens:
- '[a-z][.?!,][A-Z]'
- '[\w.?!,\(\)\-":] {2,}[\w.?!,\(\)\-":]'
23 changes: 23 additions & 0 deletions ci/vale/styles/LinodeWarnings/SubstitutionWarning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# Warning: SubstitutionWarning
#
# Warns against using common shorthand for terms.
# For substitutions flagged as errors, see Substitutions.yml
#
# Based on Vale rule from GitLab: https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/.vale/gitlab
extends: substitution
message: 'If possible, use "%s" instead of "%s".'
link: https://about.gitlab.com/handbook/communication/#top-misused-terms
level: warning
ignorecase: true
swap:
admin: administrator
blacklist(?:ed|ing)?: denylist
code base: codebase
config: configuration
distro: distribution
file name: filename
filesystem: file system
info: information
repo: repository
whitelist(?:ed|ing)?: allowlist
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Some use cases where Storm is a good solution:
- Analysis of server logs
- Internet of Things (IoT) sensor data processing

This guide explains how to create Storm clusters on the Linode cloud using a set of shell scripts that use Linode's Application Programming Interface (APIs) to programmatically create and configure large clusters. The scripts are all provided by the author of this guide via [GitHub repository](https://github.com/pathbreak/storm-linode). This application stack could also benefit from large amounts of disk space, so consider using our [Block Storage](/docs/platform/how-to-use-block-storage-with-your-linode/) service with this setup.
This guide explains how to create Storm clusters on the Linode cloud using a set of shell scripts that use Linode's Application Programming Interface (APIs) to programmatically create and configure large clusters. The scripts are all provided by the author of this guide via [GitHub repository](https://github.com/pathbreak/storm-linode). This application stack could also benefit from large amounts of disk space, so consider using our [Block Storage](/docs/guides/how-to-use-block-storage-with-your-linode/) service with this setup.

{{< caution >}}
External resources are outside of our control, and can be changed and/or modified without our knowledge. Always review code from third party sites yourself before executing.
Expand Down Expand Up @@ -70,7 +70,7 @@ This guide will explain how to configure a working Storm cluster and its Zookeep
- A Zookeeper or Storm cluster can have either Ubuntu 14.04 LTS or Debian 8 installed on its nodes. Its distribution does not need to be the same one as the one installed on the cluster manager Linode.

{{< note >}}
The steps in this guide and in the bash scripts referenced require root privileges. Be sure to run the steps below as `root`. For more information on privileges, see our [Users and Groups](/docs/tools-reference/linux-users-and-groups/) guide.
The steps in this guide and in the bash scripts referenced require root privileges. Be sure to run the steps below as `root`. For more information on privileges, see our [Users and Groups](/docs/guides/linux-users-and-groups/) guide.
{{< /note >}}

### Naming Conventions
Expand All @@ -86,7 +86,7 @@ These are the names we'll use, but you are welcome to choose your own when creat

### Get a Linode API Key

Follow the steps in [Generating an API Key](/docs/platform/api/api-key/) and save your key securely. It will be entered into configuration files in upcoming steps.
Follow the steps in [Generating an API Key](/docs/guides/api-key/) and save your key securely. It will be entered into configuration files in upcoming steps.

If the key expires or is removed, remember to create a new one and update the `api_env_linode.conf` API environment configuration file on the cluster manager Linode. This will be explained further in the next section.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ published: 2017-08-14
title: 'How to Install and Configure a Redis Cluster on Ubuntu 16.04'
external_resources:
- '[Redis Official Website](https://redis.io/)'
- '[Install and Configure Redis on CentOS 7](/docs/databases/redis/install-and-configure-redis-on-centos-7/)'
- '[Install and Configure Redis on CentOS 7](/docs/guides/install-and-configure-redis-on-centos-7/)'
---

![How to Install and Configure a Redis Cluster on Ubuntu 16.04](Redis_Cluster.jpg)
Expand All @@ -27,9 +27,9 @@ Redis as an in-memory store allows for extremely fast operations such as countin

Prior to starting, we recommend familiarizing yourself with the following:

* [Firewall settings using iptables or ufw](/docs/security/firewalls/configure-firewall-with-ufw/)
* [Firewall settings using iptables or ufw](/docs/guides/configure-firewall-with-ufw/)
* [Getting Started with VLANs](/docs/guides/getting-started-with-vlans/)
* [Master-Replicas Replication](/docs/databases/redis/how-to-install-a-redis-server-on-ubuntu-or-debian8/)
* [Master-Replicas Replication](/docs/guides/how-to-install-a-redis-server-on-ubuntu-or-debian8/)

### Redis Sentinel or Redis Cluster?

Expand Down
Loading