Skip to content
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

chore: vale fixes #272

Merged
merged 1 commit into from
Sep 4, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions canary-checker/docs/concepts/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kubectl get canaries -o wide

## Scaling

Canaries can be scaled up or down just like other kubernetes resources. However, scaling to more than one replica is identical to having just one replica. In other words, scaling a canary can be thought of as a mechanism to turn on/off the canary.
Canaries can be scaled up or down like other Kubernetes resources. However, scaling to more than one replica is identical to having one replica. In other words, scaling a canary can be thought of as a mechanism to turn on/off the canary.

<Step step={1} name="Scaling up (enabling)">

Expand All @@ -40,7 +40,7 @@ kubectl get canaries folder-pass -o wide
</Step>

<Step step={2} name="Scale down (disabling)">
This effectively stops the canary from running.
This stops the canary from running.


```bash
Expand Down
4 changes: 2 additions & 2 deletions canary-checker/docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
# ...
```

The helm chart will create a postgres server statefulset, with a random password and default port, along with a new database.
The helm chart creates a postgres server statefulset, with a random password and default port, along with a new database.

To specify a username and password for the chart-managed Postgres server, create a secret in the namespace that the chart will install to, named `postgres-connection`, which contains `POSTGRES_USER` and `POSTGRES_PASSWORD` keys.

Check warning on line 48 in canary-checker/docs/database.md

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/database.md#L48

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/database.md", "range": {"start": {"line": 48, "column": 123}}}, "severity": "WARNING"}

## Connecting to an existing database

In order to connect to an existing Postgres server, a database must be created on the server, along with a user that has administrator permissions for the database.
To connect to an existing Postgres server, a database must be created on the server, along with a user that has administrator permissions for the database.

```yaml title="values.yaml"
db:
Expand Down
10 changes: 5 additions & 5 deletions canary-checker/docs/reference/1-http.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# <Icon name="http"/> HTTP

This check performs queries on HTTP endpoints, and HTTP Namespaces to monitor their activity.
This check performs queries on HTTP endpoints, and HTTP namespaces to monitor their activity.

```yaml title=http-check.yaml
apiVersion: canaries.flanksource.com/v1
Expand All @@ -27,8 +27,8 @@
{field: "method", description: "HTTP Request method", default: "GET", scheme: "string"},
{field: "headers", description: "Header fields", scheme: "map[string]string"},
{field: "body", description: "Request Body Contents", scheme: "string"},
{field: "tlsConfig", description: "TLS Config", scheme: "[TLSConfig](#tls-config)"},
{field: "templateBody", description: "If true body will be templated", default: false, scheme: "bool"},
{field: "tlsConfig", description: "TLS config", scheme: "[TLSConfig](#tls-config)"},
{field: "templateBody", description: "If true body is templated", default: false, scheme: "bool"},
{field: "responseCodes", description: "Expected response codes", scheme: "[]int"},
{field: "responseContent", description: "Expected response content", scheme: "string"},
{field: "thresholdMillis", description: "Request timeout", default: 5000, scheme: "int"},
Expand All @@ -42,7 +42,7 @@
{field: "ca", description: "PEM encoded certificate of the CA to verify the server certificate", scheme: "EnvVar"},
{field: "cert", description: "PEM encoded client certificate", scheme: "EnvVar"},
{field: "key", description: "PEM encoded client private key", scheme: "EnvVar"},
{field: "handshakeTimeout", description: "Timeout for SSL Handshake (defaults to 10 seconds)", scheme: "int"},
{field: "handshakeTimeout", description: "Timeout for SSL handshake (defaults to 10 seconds)", scheme: "int"},
{field: "insecureSkipVerify", description: "Controls whether a client verifies the server's certificate chain and host name", scheme: "bool"}
]}/>

Expand Down Expand Up @@ -114,11 +114,11 @@
| Name | Scheme |
| ----------------------------- | ------------------- |
| `metadata.name` | string |
| `metadata.metadata.namespace` | _string_ |
| `metadata.namespace` | _string_ |
| `metadata.labels` | _map[string]string_ |
| `{fields from []env}` | any |

Variables defined in `env` will be available to template with the name that's configured on the spec.

Check warning on line 121 in canary-checker/docs/reference/1-http.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/reference/1-http.mdx#L121

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/reference/1-http.mdx", "range": {"start": {"line": 121, "column": 28}}}, "severity": "WARNING"}
Eg: In the following spec, the vars `my_secret_path` and `my_secret_var`, defined in `env`, are available during templating.

<details summary="Templating request body from env variables">
Expand Down
8 changes: 4 additions & 4 deletions canary-checker/docs/reference/1-kubernetes-resource.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ check would be to see if a service is accessible via the ingress as shown in the
{
field: 'clearResources',
scheme: 'bool',
description: `When set to true, resources from previous checks will be deleted before every run.
Even though the resources are deleted at the end of a check, setting this to \`true\` will guarantee that
there are no remains from a previous failed run.`
description: `When set to true, resources from previous checks are deleted before every run.
Even though the resources are deleted at the end of a check, setting this to \`true\` guarantees that
there are no leftover resources from a previous failed run.`
},
{
field: 'waitFor',
Expand Down Expand Up @@ -147,7 +147,7 @@ Templating the **Group**, **Version**, **Kind** & **Namespace** however isn't al

:::warning
Since static resources are deleted when the canary is deleted, extra care must be taken when providing their manifests.
When this canary is deleted, the **test** namespace will be deleted and consequently all the other resources within it, even those not created by this check.
When this canary is deleted, the **test** namespace is deleted and consequently all the other resources within it, even those not created by this check.
:::

</div>
Expand Down
15 changes: 6 additions & 9 deletions canary-checker/docs/reference/1-pod.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ tags:

# <Icon name="k8s-pod" /> Pod



The Pod check creates a new pod and verifies its reachability.

The Pod check creates a new pod and verifies that it can be reached via an Ingress

```yaml title="tcp.yaml" file=../../../modules/canary-checker/fixtures/k8s/pod_pass.yaml
```

<HealthCheck name="pod" rows={[
{field: "namespace", description: "Namespace where pod will be created", scheme: 'string'},
{field: "namespace", description: "Namespace where the pod is created", scheme: 'string'},
{field: "spec", description: "Pod spec to create", scheme: '[Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#podspec-v1-core) ', required: true},
{field: "port", description: "Port on which the created pod will serve traffic", scheme: 'int'},
{field: "path", description: " Path on which the created pod will respond to requests", scheme: 'string'},
{field: "port", description: "Port on which the created pod serves traffic", scheme: 'int'},
{field: "path", description: " Path on which the created pod responds to requests", scheme: 'string'},
{field: "expectedContent", description: "Expected content in HTTP response", scheme: 'string'},
{field: "expectedHttpStatuses", description: "Expected HTTP response statuses", scheme: '[]int'},
{field: "scheduleTimeout", description: "Timeout for pod creation", scheme: 'Duration'},
Expand All @@ -29,8 +26,8 @@ The Pod check creates a new pod and verifies its reachability.
{field: "ingressTimeout", description: "Timeout waiting for ingress creation", scheme: 'Duration'},
{field: "deadline", description: "Overall deadline for pod check", scheme: 'Duration'},
{field: "httpRetryInterval", description: "Interval between HTTP retries", scheme: 'Duration'},
{field:"ingressName", description: "Name to use for the ingress object that will expose the created pod", scheme: 'string'},
{field: "ingressHost", description: " URL to be used by the ingress to expose the created pod ", scheme: 'string'},
{field:"ingressName", description: "Name to use for the ingress object that exposes the created pod", scheme: 'string'},
{field: "ingressHost", description: " URL used by the ingress to expose the created pod ", scheme: 'string'},
{field: "priorityClass", description: " Priority class to assign to the created pod", scheme: 'string'}


Expand Down
52 changes: 23 additions & 29 deletions canary-checker/docs/scripting/cel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
`expr` expressions use the [Common Expression Language (CEL)](https://cel.dev/)

:::tip
The [CEL playground](https://playcel.undistro.io/) lets you quickly test CEL expressions

Check warning on line 8 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L8

[Flanksource.Adverbs] Consider removing 'quickly'.
Raw output
{"message": "[Flanksource.Adverbs] Consider removing 'quickly'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 8, "column": 61}}}, "severity": "WARNING"}
:::


Expand Down Expand Up @@ -43,7 +43,7 @@

## Handling null types and missing keys

When dealing with CEL objects, we might get errors where a key does not exist or if you're chaining keys, then one of the keys in the middle will be missing

Check warning on line 46 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L46

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 46, "column": 142}}}, "severity": "WARNING"}

```javascript
// Assume we have an obj with value: {'a': {'b': 'c'}}
Expand Down Expand Up @@ -116,7 +116,7 @@

### .keys

The `keys` method on a map returns a list of keys..
The `keys` method on a map returns a list of keys.

Syntax:

Expand All @@ -135,7 +135,7 @@

### .merge

The `merge` method on a map takes in a second map to merge with.
The `merge` method on a map takes a second map to merge.

Syntax:

Expand All @@ -155,7 +155,7 @@

### .omit

The `omit` method on a map takes a list of keys to omit from the map.
The `omit` method on a map takes a list of keys to remove.

Syntax:

Expand All @@ -175,7 +175,7 @@

### .sort

The `sort` method on a list returns the reversed list.
The `sort` method on a list returns a sorted list.

Syntax:

Expand All @@ -195,7 +195,7 @@

### .uniq

The `uniq` method on a list returns a list of the unique elements.
The `uniq` method on a list returns a list of unique items.

Syntax:

Expand All @@ -215,7 +215,7 @@

### .values

The `values` method on a map returns a list of values.
The `values` method on a map returns a list of items.

Syntax:

Expand Down Expand Up @@ -262,7 +262,7 @@

### exists

The `exists` macro checks if there exists at least one element in a list that satisfies a given condition. It returns a boolean value based on the evaluation.
The `exists` macro checks if there is at least one element in a list that satisfies a given condition. It returns a boolean value based on the evaluation.

Syntax:

Expand All @@ -284,7 +284,7 @@

### exists_one

The `exists_one` macro checks if there exists exactly one element in a list that satisfies a given condition. It returns a boolean value based on the evaluation.
The `exists_one` macro checks if there is exactly one element in a list that satisfies a given condition. It returns a boolean value based on the evaluation.

Syntax:

Expand Down Expand Up @@ -319,7 +319,7 @@

Where:

- `e` is the list you're filtering.
- `e` is the list you are filtering.
- `x` represents each element of the list.
- `p` is the predicate expression applied to each entry.

Expand All @@ -332,7 +332,7 @@

### fold

The `fold` macro is used to combine all elements of a collection, such as a list or a map, using a binary function. It's a powerful tool for aggregating or reducing data.
The `fold` macro combines all elements of a collection, such as a list or a map, using a binary function. It's a powerful tool for aggregating or reducing data.

Syntax:

Expand Down Expand Up @@ -413,7 +413,7 @@
e.map(x, t)

// Where:
// `e` is the list you're transforming.
// `e` is the list you are transforming.
// `x` represents each element of the list.
// `t` is the transformation function applied to each entry.
```
Expand Down Expand Up @@ -441,7 +441,7 @@

### or

If the value on the left-hand side is none-type, the optional value on the right hand side is returned. If the value on the left-hand set is valued, then it is returned. This operation is short-circuiting and will only evaluate as many links in the `or` chain as are needed to return a non-empty optional value.
If the value on the left-hand side is none-type, the optional value on the right hand side is returned. If the value on the left-hand set is valued, then it is returned. This operation is short-circuiting and evaluates as many links in the `or` chain as are needed to return a non-empty optional value.

```javascript
obj.?field.or(m[?key]) // if obj.field is none, m.key is returned
Expand All @@ -452,24 +452,24 @@

### orValue

When creating map or list, if a field may be optionally set based on its presence, then placing a `?` before the field name or key will ensure the type on the right-hand side must be optional(T) where T is the type of the field or key-value.
When creating map or list, if a field may be optionally set based on its presence, then placing a `?` before the field name or key ensures the type on the right-hand side must be optional(T) where T is the type of the field or key-value.

```javascript
// The following returns a map with the key expression set only if the subfield is present, otherwise a default value is returned

{'a': 'x', 'b': 'y', 'c': 'z'}.?c.orValue('empty') // Returns z since `c` exists

{'a': 'x', 'b': 'y'}.?c.orValue('empty') // Returns 'empty' since `c` does not exist
{'a': 'x', 'b': 'y'}.?c.orValue('empty') // Returns 'empty' since `c` doesn't exist

// We can use the same for list types
[1, 2, 3][?2].orValue(5) // Return 3 since 2nd index has a value

[1, 2][?2].orValue(5) // Return 5 since 2nd index does not exist
[1, 2][?2].orValue(5) // Return 5 since 2nd index doesn't exist
```

### size

`size` function determines the number of elements in a collection or the number of Unicode characters in a string.
`size` determines the number of elements in a collection or the number of Unicode characters in a string.

Syntax

Expand All @@ -489,7 +489,7 @@

### slice

Returns a new sub-list using the indexes provided.
Returns a new sub-list using the indices provided.

```javascript
[1, 2, 3, 4].slice(1, 3) // return [2, 3]
Expand All @@ -508,7 +508,7 @@
Returns whether the first list argument contains all elements in the second
list argument. The list may contain elements of any type and standard CEL
equality is used to determine whether a value exists in both lists. If the
second list is empty, the result will always return true.

Check warning on line 511 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L511

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 511, "column": 34}}}, "severity": "WARNING"}

```javascript
sets.contains(list(T), list(T)) -> bool
Expand All @@ -534,11 +534,7 @@

### sets.equivalent

Returns whether the first and second list are set equivalent. Lists are set
equivalent if for every item in the first list, there is an element in the
second which is equal. The lists may not be of the same size as they do not
guarantee the elements within them are unique, so size does not factor into
the computation.
Returns whether the first and second list are set equivalent. Lists are set equivalent if for every item in the first list, there is an element in the second which is equal. The lists may not be of the same size as they do not guarantee the elements within them are unique, so size doesn't factor into the computation.

sets.equivalent(list(T), list(T)) -> bool

Expand All @@ -562,9 +558,7 @@

### sets.intersects

Returns whether the first list has at least one element whose value is equal
to an element in the second list. If either list is empty, the result will
be false.
Returns whether the first list has at least one element whose value is equal to an element in the second list. If either list is empty, the result is false.

```javascript
sets.intersects([1], []) // false
Expand Down Expand Up @@ -722,7 +716,7 @@
| Function | Description | Example |
| -------------------------- | ---------------------------------------------------------------------------------------------- | ------- |
| `{date>.getDayOfMonth()` | A integer value representing the day of the month, with the first day being 1. | 1 - 31 |
| `<date>.getDayOfWeek()` | eturns an integer value representing the day of the week, where Sunday is 0 and Saturday is 6. | 0 - 6 |

Check failure on line 719 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L719

[Flanksource.Spelling] Is 'eturns' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'eturns' spelled correctly? Is it missing code formatting?", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 719, "column": 32}}}, "severity": "ERROR"}
| `<date>.getDayOfYear()` | an integer value representing the day of the year, with January 1st being day 1. | 1 - 366 |
| `<date>.getDayOfMonth()` | the full year (4 digits for 4-digit years) of the specified timestamp. | |
| `<date>.getHours()` | the full year (4 digits for 4-digit years) of the specified timestamp. | 0- 23 |
Expand Down Expand Up @@ -1011,8 +1005,8 @@
are ignored. The result is Cleaned. However, if the argument
list is empty or all its elements are empty, Join returns
an empty string.
On Windows, the result will only be a UNC path if the first
non-empty element is a UNC path addict.
On Windows, the result is only a UNC path if the first
non-empty element is a UNC path.

```javascript
filepath.Join(["/home/flanksource", "projects", "gencel"]; // /home/flanksource/projects/gencel
Expand All @@ -1035,7 +1029,7 @@
`filepath.Rel` returns a relative path that is lexically equivalent to targpath when
joined to basepath with an intervening separator. That is,
Join(basepath, Rel(basepath, targpath)) is equivalent to targpath itself.
On success, the returned path will always be relative to basepath,

Check warning on line 1032 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1032

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1032, "column": 31}}}, "severity": "WARNING"}
even if basepath and targpath share no elements.
An error is returned if targpath can't be made relative to basepath or if
knowing the current working directory would be necessary to compute it.
Expand Down Expand Up @@ -1521,7 +1515,7 @@

### regexp.Find

`regexp.Find` find the first occurrence of a pattern within a string. It returns the matched substring or an error if the pattern is invalid.

Check warning on line 1518 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1518

[Flanksource.Ablist] When referring to a person, consider using 'turned off', 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'invalid'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'turned off', 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'invalid'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1518, "column": 134}}}, "severity": "WARNING"}

```javascript
// Finding a pattern within a string:
Expand All @@ -1542,7 +1536,7 @@

### regexp.FindAll

`regexp.FindAll` retrieves all occurrences of a pattern within a string, up to a specified count. It returns a list of matched substrings or an error if the pattern is invalid.

Check warning on line 1539 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1539

[Flanksource.Ablist] When referring to a person, consider using 'turned off', 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'invalid'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'turned off', 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'invalid'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1539, "column": 169}}}, "severity": "WARNING"}

```javascript
regexp.FindAll(pattern, count, input)
Expand Down Expand Up @@ -1646,7 +1640,7 @@

### regexp.ReplaceLiteral

`regexp.ReplaceLiteral` replaces occurrences of a pattern within a string with a specified replacement string, without interpreting the pattern as a regular expression. It returns the modified string or an error if the pattern is invalid.

Check warning on line 1643 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1643

[Flanksource.Ablist] When referring to a person, consider using 'turned off', 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'invalid'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'turned off', 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'invalid'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1643, "column": 231}}}, "severity": "WARNING"}

Syntax:

Expand Down Expand Up @@ -1679,7 +1673,7 @@

### regexp.Split

`regexp.Split` splits a string into a slice of substrings separated by a pattern. It returns the slice of strings or an error if the pattern is invalid.

Check warning on line 1676 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1676

[Flanksource.Ablist] When referring to a person, consider using 'turned off', 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'invalid'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'turned off', 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'invalid'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1676, "column": 145}}}, "severity": "WARNING"}

```javascript
regexp.Split(pattern, count, input)
Expand Down Expand Up @@ -1709,11 +1703,11 @@

### .abbrev

`abbrev` on a string abbreviates the string using ellipses. This will turn the string "Now is the time for all good men" into "...s the time for..."

Check warning on line 1706 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1706

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1706, "column": 66}}}, "severity": "WARNING"}
This function works like `Abbreviate(string, int)`, but allows you to specify a "left edge" offset. Note that this left edge is not
This function works like `Abbreviate(string, int)`, but allows you to specify a "left edge" offset. The left edge is not
necessarily going to be the leftmost character in the result, or the first character following the ellipses, but it will appear

Check warning on line 1708 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1708

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1708, "column": 117}}}, "severity": "WARNING"}
somewhere in the result.
In no case will it return a string of length greater than maxWidth.

Check warning on line 1710 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1710

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1710, "column": 12}}}, "severity": "WARNING"}

```javascript
"string".abbrev(offset, maxWidth)
Expand Down Expand Up @@ -1759,7 +1753,7 @@
### .charAt

Returns the character at the given position. If the position is negative, or
greater than the length of the string, the function will produce an error:

Check warning on line 1756 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1756

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1756, "column": 53}}}, "severity": "WARNING"}

```javascript
"hello".charAt(4) // return 'o'
Expand Down Expand Up @@ -1796,12 +1790,12 @@

- `%s` substitutes a string. This can also be used on `bools`, `lists`, `maps`, `bytes`,
`Duration`, `Timestamp`,`int`, `double`
<br/>Note that the dot/period decimal separator will always be used when printing a list or map that contains a double, and that null can be passed (which results in the string "null") in addition to types.
<br/>the dot/period decimal separator will always be used when printing a list or map that contains a double, and that null can be passed (which results in the string "null") in addition to types.

Check warning on line 1793 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1793

[Flanksource.ProfanityUnlikely] Be careful with 'period', it's profane in some cases.
Raw output
{"message": "[Flanksource.ProfanityUnlikely] Be careful with 'period', it's profane in some cases.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1793, "column": 16}}}, "severity": "WARNING"}

Check warning on line 1793 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1793

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1793, "column": 41}}}, "severity": "WARNING"}
- `%d` substitutes an integer.
- `%f` substitutes a double with fixed-point precision. The default precision is 6, but this can be adjusted. The strings `Infinity`, `-Infinity`, and `NaN` are also valid input for this clause.
- `%e` substitutes a double in scientific notation. The default precision is 6, but this can be adjusted.
- `%b` substitutes an integer with its equivalent binary string. Can also be used on bools.
- `%x` substitutes an integer with its equivalent in hexadecimal, or if given a string or bytes, will output each character's equivalent in hexadecimal.

Check warning on line 1798 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1798

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1798, "column": 98}}}, "severity": "WARNING"}
- `%X` same as above, but with A-F capitalized.
- `%o` substitutes an integer with its equivalent in octal.

Expand Down Expand Up @@ -1959,7 +1953,7 @@
### .quote

Takes the given string and makes it safe to print (without any formatting due to escape sequences).
If any invalid UTF-8 characters are encountered, they are replaced with \uFFFD.

Check warning on line 1956 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L1956

[Flanksource.Ablist] When referring to a person, consider using 'turned off', 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'invalid'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'turned off', 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'invalid'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 1956, "column": 8}}}, "severity": "WARNING"}

```javascript
strings.quote('single-quote with "double quote"') // returns '"single-quote with \"double quote\""'
Expand Down Expand Up @@ -2021,7 +2015,7 @@

Returns a new string whose characters are the same as the target string, only formatted in
reverse order.
This function relies on converting strings to rune arrays in order to reverse.

Check warning on line 2018 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L2018

[Flanksource.Wordiness] Consider using 'to' instead of 'in order to'.
Raw output
{"message": "[Flanksource.Wordiness] Consider using 'to' instead of 'in order to'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 2018, "column": 59}}}, "severity": "WARNING"}

```javascript
"gums".reverse() // returns 'smug'
Expand All @@ -2045,7 +2039,7 @@

### .shellQuote

`shellQuote` quotes a string such that it can be safely used as a token in a shell command.

Check warning on line 2042 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L2042

[Flanksource.Adverbs] Consider removing 'safely'.
Raw output
{"message": "[Flanksource.Adverbs] Consider removing 'safely'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 2042, "column": 50}}}, "severity": "WARNING"}

```javascript
"Hello World".shellQuote() // "'Hello World'"
Expand Down Expand Up @@ -2395,7 +2389,7 @@

### YAML

`YAML` converts a YAML formatted string into a map. It provides an easy way to handle YAML data.

Check failure on line 2392 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L2392

[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'easy'.
Raw output
{"message": "[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'easy'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 2392, "column": 68}}}, "severity": "ERROR"}

Check failure on line 2392 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L2392

[Flanksource.Condescending] Using 'easy' may come across as condescending.
Raw output
{"message": "[Flanksource.Condescending] Using 'easy' may come across as condescending.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 2392, "column": 68}}}, "severity": "ERROR"}

Check failure on line 2392 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L2392

[alex.Condescending] Using 'easy' may come across as condescending.
Raw output
{"message": "[alex.Condescending] Using 'easy' may come across as condescending.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 2392, "column": 68}}}, "severity": "ERROR"}

```javascript
// Converting a simple YAML string to a map:
Expand Down Expand Up @@ -2446,7 +2440,7 @@

### TOML

`TOML` converts a TOML formatted string into a map, making it easy to work with TOML data.

Check failure on line 2443 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L2443

[Flanksource.Condescending] Using 'easy' may come across as condescending.
Raw output
{"message": "[Flanksource.Condescending] Using 'easy' may come across as condescending.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 2443, "column": 63}}}, "severity": "ERROR"}

Check failure on line 2443 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L2443

[alex.Condescending] Using 'easy' may come across as condescending.
Raw output
{"message": "[alex.Condescending] Using 'easy' may come across as condescending.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 2443, "column": 63}}}, "severity": "ERROR"}

Check failure on line 2443 in canary-checker/docs/scripting/cel.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/cel.mdx#L2443

[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'easy'.
Raw output
{"message": "[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'easy'.", "location": {"path": "canary-checker/docs/scripting/cel.mdx", "range": {"start": {"line": 2443, "column": 63}}}, "severity": "ERROR"}

```javascript
// Converting a TOML string to a map:
Expand Down
2 changes: 1 addition & 1 deletion canary-checker/docs/scripting/gotemplate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
```

:::note
For the functions that return an array, a Go `[]interface{}` is returned, regardless of whether or not the input was a different type.
For the functions that return an array, a Go `[]interface{}` is returned, regardless of whether the input was a different type.
:::

## Collection
Expand Down Expand Up @@ -124,7 +124,7 @@

Filters an input object or list using the [jq](https://stedolan.github.io/jq/) language, as implemented by [gojq](https://github.com/itchyny/gojq).

Any JSON datatype may be used as input (NOTE: strings are not JSON-parsed but passed in as is). If the expression results in multiple items (no matter if streamed or as an array) they are wrapped in an array. Otherwise a single item is returned (even if resulting in an array with a single contained element).

Check failure on line 127 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L127

[Flanksource.SpellingSuggestions] Use 'data type(s)' instead of 'datatype'.
Raw output
{"message": "[Flanksource.SpellingSuggestions] Use 'data type(s)' instead of 'datatype'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 127, "column": 10}}}, "severity": "ERROR"}

JQ filter expressions can be tested at [jqplay](https://jqplay.org/)

Expand All @@ -146,7 +146,7 @@

Return a list of keys in one or more maps.

The keys will be ordered first by map position (if multiple maps are given), then alphabetically.

Check warning on line 149 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L149

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 149, "column": 10}}}, "severity": "WARNING"}

See also [`coll.Values`](#values).

Expand All @@ -159,7 +159,7 @@

Return a list of values in one or more maps.

The values will be ordered first by map position (if multiple maps are given), then alphabetically by key.

Check warning on line 162 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L162

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 162, "column": 12}}}, "severity": "WARNING"}

See also [`coll.Keys`](#keys).

Expand Down Expand Up @@ -221,7 +221,7 @@

### Sort

Sort a given list. Uses the natural sort order if possible. For inputs that are not sortable (either because the elements are of different types, or of an un-sortable type), the input will simply be returned, unmodified.

Check warning on line 224 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L224

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 224, "column": 185}}}, "severity": "WARNING"}

Check failure on line 224 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L224

[Flanksource.Condescending] Using 'simply' may come across as condescending.
Raw output
{"message": "[Flanksource.Condescending] Using 'simply' may come across as condescending.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 224, "column": 190}}}, "severity": "ERROR"}

Check failure on line 224 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L224

[alex.Condescending] Using 'simply' may come across as condescending.
Raw output
{"message": "[alex.Condescending] Using 'simply' may come across as condescending.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 224, "column": 190}}}, "severity": "ERROR"}

Check failure on line 224 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L224

[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'simply'.
Raw output
{"message": "[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'simply'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 224, "column": 190}}}, "severity": "ERROR"}

Maps and structs can be sorted by a named key.

Expand Down Expand Up @@ -307,7 +307,7 @@

Provides a default value given an empty input. Empty inputs are `0` for numeric types, `""` for strings, `false` for booleans, empty arrays/maps, and `nil`.

this will not provide a default for the case where the input is undefined (i.e. referencing things like `.foo` where there is no `foo` field of `.`), but [`conv.Has`](#has) can be used for that.

Check warning on line 310 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L310

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 310, "column": 6}}}, "severity": "WARNING"}

Check failure on line 310 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L310

[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.
Raw output
{"message": "[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 310, "column": 76}}}, "severity": "ERROR"}

```go
{{ "" | default "foo" }} // foo
Expand Down Expand Up @@ -517,7 +517,7 @@

Converts the input (of any type) to a `string`.

The input will always be represented in _some_ way.

Check warning on line 520 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L520

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 520, "column": 11}}}, "severity": "WARNING"}

```go
{{ conv.ToString 0xFF }} // 255
Expand Down Expand Up @@ -552,7 +552,7 @@

### json

Converts a JSON string into an object. Works for JSON Objects, but will also parse JSON Arrays. Will not parse other valid JSON types.

Check warning on line 555 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L555

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 555, "column": 68}}}, "severity": "WARNING"}

Check warning on line 555 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L555

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'Will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'Will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 555, "column": 97}}}, "severity": "WARNING"}

For more explicit JSON Array support, see [`data.JSONArray`](#jsonarray).

Expand All @@ -570,7 +570,7 @@

### yaml

Converts a YAML string into an object. Works for YAML Objects but will also parse YAML Arrays. This can be used to access properties of YAML objects.

Check warning on line 573 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L573

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 573, "column": 67}}}, "severity": "WARNING"}

For more explicit YAML Array support, see [`data.JSONArray`](#yamlarray).

Expand Down Expand Up @@ -625,7 +625,7 @@

By default, the [RFC 4180](https://tools.ietf.org/html/rfc4180) format is supported, but any single-character delimiter can be specified.

Also by default, the first line of the string will be assumed to be the header, but this can be overridden by providing an explicit header, or auto-indexing can be used.

Check warning on line 628 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L628

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 628, "column": 47}}}, "severity": "WARNING"}

```
{{ $c := `lang,keywords
Expand Down Expand Up @@ -692,7 +692,7 @@

Converts an object to a YAML document. Input objects may be the result of `data.JSON`, `data.YAML`, `data.JSONArray`, or `data.YAMLArray` functions.

_This is obviously contrived - `data.JSON` is used to create an object._

Check failure on line 695 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L695

[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'obviously'.
Raw output
{"message": "[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'obviously'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 695, "column": 10}}}, "severity": "ERROR"}

Check failure on line 695 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L695

[Flanksource.Condescending] Using 'obviously' may come across as condescending.
Raw output
{"message": "[Flanksource.Condescending] Using 'obviously' may come across as condescending.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 695, "column": 10}}}, "severity": "ERROR"}

Check failure on line 695 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L695

[alex.Condescending] Using 'obviously' may come across as condescending.
Raw output
{"message": "[alex.Condescending] Using 'obviously' may come across as condescending.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 695, "column": 10}}}, "severity": "ERROR"}

```go
{{ (`{"foo":{"hello":"world"}}` | data.JSON).foo | data.ToYAML }} // hello: world
Expand Down Expand Up @@ -821,7 +821,7 @@

Splits path immediately following the final path separator, separating it into a directory and file name component.

The function returns an array with two values, the first being the diretory, and the second the file.

Check failure on line 824 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L824

[Flanksource.Spelling] Is 'diretory' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'diretory' spelled correctly? Is it missing code formatting?", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 824, "column": 68}}}, "severity": "ERROR"}

A wrapper for Go's [`filepath.Split`](https://golang.org/pkg/path/filepath/#Split) function.

Expand Down Expand Up @@ -852,7 +852,7 @@

## math

Returns the absolute value of a given number. When the input is an integer, the result is `int64`, otherwise it will be a `float64`.

Check warning on line 855 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L855

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 855, "column": 113}}}, "severity": "WARNING"}

```go
{{ math.Abs -3.5 }} {{ math.Abs 3.5 }} {{ math.Abs -42 }} // 3.5 3.5 42
Expand All @@ -860,7 +860,7 @@

### Add

Adds all given operators. When one of the inputs is a floating-point number, the result will be a `float64`, otherwise it is `int64`.

Check warning on line 863 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L863

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 863, "column": 89}}}, "severity": "WARNING"}

```go
{{ math.Add 1 2 3 4 }} {{ math.Add 1.5 2 3 }} // 10 6.5
Expand All @@ -870,7 +870,7 @@

Returns the least integer value greater than or equal to a given floating-point number. This wraps Go's [`math.Ceil`](https://golang.org/pkg/math/#Ceil).

**Note:** the return value of this function is a `float64` so that the special-cases `NaN` and `Inf` can be returned appropriately.

Check warning on line 873 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L873

[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 873, "column": 72}}}, "severity": "WARNING"}

```go
{{ range (slice 5.1 42 "3.14" "0xFF" "NaN" "Inf" "-0") }}ceil {{ printf "%#v" . }} = {{ math.Ceil . }}{{"\n"}}{{ end }}
Expand All @@ -886,7 +886,7 @@

### Div

Divide the first number by the second. Division by zero is disallowed. The result will be a `float64`.

Check warning on line 889 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L889

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 889, "column": 83}}}, "severity": "WARNING"}

```go
{{ math.Div 8 2 }} {{ math.Div 3 2 }} // 4 1.5
Expand All @@ -896,7 +896,7 @@

Returns the greatest integer value less than or equal to a given floating-point number. This wraps Go's [`math.Floor`](https://golang.org/pkg/math/#Floor).

**Note:** the return value of this function is a `float64` so that the special-cases `NaN` and `Inf` can be returned appropriately.

Check warning on line 899 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L899

[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 899, "column": 72}}}, "severity": "WARNING"}

```go
{{ range (slice 5.1 42 "3.14" "0xFF" "NaN" "Inf" "-0") }}floor {{ printf "%#v" . }} = {{ math.Floor . }}{{"\n"}}{{ end }}
Expand All @@ -912,9 +912,9 @@

### IsFloat

Returns whether or not the given number can be interpreted as a floating-point literal, as defined by the [Go language reference](https://golang.org/ref/spec#Floating-point_literals).

Check warning on line 915 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L915

[Flanksource.Wordiness] Consider using 'whether' instead of 'whether or not'.
Raw output
{"message": "[Flanksource.Wordiness] Consider using 'whether' instead of 'whether or not'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 915, "column": 9}}}, "severity": "WARNING"}

**Note:** If a decimal point is part of the input number, it will be considered a floating-point number, even if the decimal is `0`.

Check warning on line 917 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L917

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 917, "column": 62}}}, "severity": "WARNING"}

```go
{{ range (slice 1.0 "-1.0" 5.1 42 "3.14" "foo" "0xFF" "NaN" "Inf" "-0") }}{{ if (math.IsFloat .) }}{{.}} is a float{{"\n"}}{{ end }}{{end}}
Expand All @@ -929,7 +929,7 @@

### IsInt

Returns whether or not the given number is an integer.

Check warning on line 932 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L932

[Flanksource.Wordiness] Consider using 'whether' instead of 'whether or not'.
Raw output
{"message": "[Flanksource.Wordiness] Consider using 'whether' instead of 'whether or not'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 932, "column": 9}}}, "severity": "WARNING"}

```go
{{ range (slice 1.0 "-1.0" 5.1 42 "3.14" "foo" "0xFF" "NaN" "Inf" "-0") }}{{ if (math.IsInt .) }}{{.}} is an integer{{"\n"}}{{ end }}{{end}}
Expand All @@ -950,7 +950,7 @@

### Max

Returns the largest number provided. If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. The same special-cases as Go's [`math.Max`](https://golang.org/pkg/math/#Max) are followed.

Check warning on line 953 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L953

[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 953, "column": 148}}}, "severity": "WARNING"}

```go
{{ math.Max 0 8.0 4.5 "-1.5e-11" }} // 8
Expand All @@ -958,7 +958,7 @@

### Min

Returns the smallest number provided. If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. The same special-cases as Go's [`math.Min`](https://golang.org/pkg/math/#Min) are followed.

Check warning on line 961 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L961

[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 961, "column": 149}}}, "severity": "WARNING"}

```go
{{ math.Min 0 8 4.5 "-1.5e-11" }} // -1.5e-11
Expand Down Expand Up @@ -995,7 +995,7 @@

Returns the nearest integer, rounding half away from zero.

**Note:** the return value of this function is a `float64` so that the special-cases `NaN` and `Inf` can be returned appropriately.

Check warning on line 998 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L998

[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 998, "column": 72}}}, "severity": "WARNING"}

```go
{{ range (slice -6.5 5.1 42.9 "3.5" 6.5) }}round {{ printf "%#v" . }} = {{ math.Round . }}{{"\n"}}{{ end }}
Expand Down Expand Up @@ -1142,7 +1142,7 @@

A different set of characters can be specified with a regular expression, or by giving a range of possible characters by specifying the lower and upper bounds. Lower/upper bounds can be specified as characters (e.g. `"q"`, or escape sequences such as `"\U0001f0AF"`), or numeric Unicode code-points (e.g. `48` or `0x30` for the character `0`).

When given a range of Unicode code-points, `random.String` will discard non-printable characters from the selection. This may result in a much smaller set of possible characters than intended, so check the [Unicode character code charts](http://www.unicode.org/charts/) to verify the correct code-points.

Check warning on line 1145 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1145

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1145, "column": 60}}}, "severity": "WARNING"}

```go
{{ random.String 8 }} // FODZ01u_
Expand All @@ -1164,7 +1164,7 @@

Pick a random integer. By default, a number between `0` and `100` (inclusive) is chosen, but this range can be overridden.

the difference between `min` and `max` can not be larger than a 63-bit integer (i.e. the unsigned portion of a 64-bit signed integer). The result is given as an `int64`.

Check failure on line 1167 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1167

[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.
Raw output
{"message": "[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1167, "column": 81}}}, "severity": "ERROR"}

```go
{{ random.Number }} // 55
Expand All @@ -1174,7 +1174,7 @@

### Float

Pick a random decimal floating-point number. By default, a number between `0.0` and `1.0` (_exclusive_, i.e. `[0.0,1.0)`) is chosen, but this range can be overridden.

Check failure on line 1177 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1177

[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.
Raw output
{"message": "[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1177, "column": 105}}}, "severity": "ERROR"}

The result is given as a `float64`.

Expand Down Expand Up @@ -1203,7 +1203,7 @@

Returns a list of all successive matches of the regular expression.

This can be called with 2 or 3 arguments. When called with 2 arguments, the `n` argument (number of matches) will be set to `-1`, causing all matches to be returned.

Check warning on line 1206 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1206

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1206, "column": 110}}}, "severity": "WARNING"}

This function provides the same behavior as Go's
[`regexp.FindAllString`](https://golang.org/pkg/regexp/#Regexp.FindAllString) function.
Expand Down Expand Up @@ -1267,7 +1267,7 @@

Splits `input` into sub-strings, separated by the expression.

This can be called with 2 or 3 arguments. When called with 2 arguments, the `n` argument (number of matches) will be set to `-1`, causing all sub-strings to be returned.

Check warning on line 1270 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1270

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1270, "column": 110}}}, "severity": "WARNING"}

This is equivalent to [`strings.SplitN`](#splitn), except that regular expressions are supported.

Expand Down Expand Up @@ -1321,7 +1321,7 @@

### Indent

Indents a string. If the input string has multiple lines, each line will be indented.

Check warning on line 1324 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1324

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1324, "column": 69}}}, "severity": "WARNING"}

This function can be especially useful when adding YAML snippets into other YAML documents, where indentation is important:

Expand All @@ -1347,7 +1347,7 @@

**Deprecation Notice:** Use [`coll.Sort`](#sort) instead

Returns an alphanumerically-sorted copy of a given string list.

Check warning on line 1350 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1350

[Flanksource.Hyphens] ' alphanumerically-' doesn't need a hyphen.
Raw output
{"message": "[Flanksource.Hyphens] ' alphanumerically-' doesn't need a hyphen.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1350, "column": 11}}}, "severity": "WARNING"}

```go
{{ (slice "foo" "bar" "baz") | strings.Sort }} // [bar baz foo]
Expand Down Expand Up @@ -1420,7 +1420,7 @@

### Slug

Creates a a "slug" from a given string - supports Unicode correctly. This wraps the [github.com/gosimple/slug](https://github.com/gosimple/slug) package. See [the github.com/gosimple/slug docs](https://godoc.org/github.com/gosimple/slug) for more information.

Check failure on line 1423 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1423

[Vale.Repetition] 'a' is repeated!
Raw output
{"message": "[Vale.Repetition] 'a' is repeated!", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1423, "column": 9}}}, "severity": "ERROR"}

```go
{{ "Hello, world!" | strings.Slug }} // hello-world
Expand All @@ -1428,8 +1428,8 @@

### ShellQuote

Given a string, emits a version of that string that will evaluate to its literal data when expanded by any POSIX-compliant shell.

Check warning on line 1431 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1431

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1431, "column": 53}}}, "severity": "WARNING"}
Given an array or slice, emit a single string which will evaluate to a series of shell words, one per item in that array or slice.

Check warning on line 1432 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1432

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1432, "column": 53}}}, "severity": "WARNING"}

```go
{{ slice "one word" "foo='bar baz'" | shellQuote }}
Expand Down Expand Up @@ -1525,9 +1525,9 @@

### CamelCase

Converts a sentence to CamelCase, i.e. `The quick brown fox` becomes `TheQuickBrownFox`.

Check failure on line 1528 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1528

[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.
Raw output
{"message": "[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1528, "column": 35}}}, "severity": "ERROR"}

All non-alphanumeric characters are stripped, and the beginnings of words are upper-cased. If the input begins with a lower-case letter, the result will also begin with a lower-case letter.

Check warning on line 1530 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1530

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1530, "column": 149}}}, "severity": "WARNING"}

See [CamelCase on Wikipedia](https://en.wikipedia.org/wiki/Camel_case) for more details.

Expand All @@ -1539,9 +1539,9 @@

### SnakeCase

Converts a sentence to snake_case, i.e. `The quick brown fox` becomes `The_quick_brown_fox`.

Check failure on line 1542 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1542

[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.
Raw output
{"message": "[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1542, "column": 36}}}, "severity": "ERROR"}

All non-alphanumeric characters are stripped, and spaces are replaced with an underscore (`_`). If the input begins with a lower-case letter, the result will also begin with a lower-case letter.

Check warning on line 1544 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1544

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1544, "column": 154}}}, "severity": "WARNING"}

See [Snake Case on Wikipedia](https://en.wikipedia.org/wiki/Snake_case) for more details.

Expand All @@ -1552,7 +1552,7 @@

### KebabCase

Converts a sentence to kebab-case, i.e. `The quick brown fox` becomes `The-quick-brown-fox`. All non-alphanumeric characters are stripped, and spaces are replaced with a hyphen (`-`). If the input begins with a lower-case letter, the result will also begin with a lower-case letter.

Check warning on line 1555 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1555

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1555, "column": 242}}}, "severity": "WARNING"}
See [Kebab Case on Wikipedia](https://en.wikipedia.org/wiki/Kebab_case) for more details.

```go
Expand All @@ -1562,9 +1562,9 @@

### WordWrap

Inserts new line breaks into the input string so it ends up with lines that are at most `width` characters wide. The line-breaking algorithm is _naïve_ and _greedy_: lines are only broken between words (i.e. on space characters), and no effort is made to "smooth" the line endings. When words that are longer than the desired width are encountered (e.g. long URLs), they are not broken up. Correctness is valued above line length.

Check failure on line 1565 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1565

[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.
Raw output
{"message": "[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1565, "column": 204}}}, "severity": "ERROR"}

The line-break sequence defaults to `\n` (i.e. the LF/Line Feed character), regardless of OS.

Check failure on line 1567 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1567

[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.
Raw output
{"message": "[Flanksource.Foreign] Use 'that is' instead of 'i.e.'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1567, "column": 43}}}, "severity": "ERROR"}

```go
{{ "Hello, World!" | strings.WordWrap 7 }} // Hello,
Expand All @@ -1583,7 +1583,7 @@

Return the number of _runes_ (Unicode code-points) contained within the input. This is similar to the built-in `len` function, but `len` counts the length in _bytes_. The length of an input containing multi-byte code-points should therefore be measured with `strings.RuneCount`.

Inputs will first be converted to strings, and multiple inputs are concatenated.

Check warning on line 1586 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1586

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1586, "column": 8}}}, "severity": "WARNING"}

This wraps Go's [`utf8.RuneCountInString`](https://golang.org/pkg/unicode/utf8/#RuneCountInString) function.

Expand Down Expand Up @@ -1691,9 +1691,9 @@
- `float64`
- `slice`
- `map`
- `invalid` (a catch-all, usually just `nil` values)

Check failure on line 1694 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1694

[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'just'.
Raw output
{"message": "[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'just'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1694, "column": 35}}}, "severity": "ERROR"}

In addition, the special kind `number` is accepted by this function, to represent _any_ numeric kind (whether `float32`, `uint8`, or whatever). This is useful when the specific numeric type is unknown.

Check warning on line 1696 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1696

[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.
Raw output
{"message": "[Flanksource.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1696, "column": 18}}}, "severity": "WARNING"}

See also [`test.Kind`](#kind).

Expand Down Expand Up @@ -1722,7 +1722,7 @@

### Kind

Report the _kind_ of the given argument. This differs from the _type_ of the argument in specificity; for example, while a slice of strings may have a type of `[]string`, the _kind_ of that slice will simply be `slice`.

Check warning on line 1725 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1725

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1725, "column": 197}}}, "severity": "WARNING"}

Check failure on line 1725 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1725

[alex.Condescending] Using 'simply' may come across as condescending.
Raw output
{"message": "[alex.Condescending] Using 'simply' may come across as condescending.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1725, "column": 202}}}, "severity": "ERROR"}

Check failure on line 1725 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1725

[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'simply'.
Raw output
{"message": "[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'simply'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1725, "column": 202}}}, "severity": "ERROR"}

Check failure on line 1725 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1725

[Flanksource.Condescending] Using 'simply' may come across as condescending.
Raw output
{"message": "[Flanksource.Condescending] Using 'simply' may come across as condescending.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1725, "column": 202}}}, "severity": "ERROR"}
If you need to know the precise type of a value, use `printf "%T" $value`.

See also [`test.IsKind`](#iskind)
Expand All @@ -1742,7 +1742,7 @@
{{ if conv.ToBool $condition }}{{ $truevalue }}{{ else }}{{ $falsevalue }}{{ end }}
```

Keep in mind that using an explicit `if`/`else` block is often easier to understand than ternary expressions!

Check failure on line 1745 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1745

[Flanksource.Exclamation] Don't use exclamation points in text.
Raw output
{"message": "[Flanksource.Exclamation] Don't use exclamation points in text.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1745, "column": 98}}}, "severity": "ERROR"}

```go
{{ ternary "FOO" "BAR" false }} // BAR
Expand Down Expand Up @@ -1791,7 +1791,7 @@
A number of pre-defined layouts are provided as constants, defined
[here](https://golang.org/pkg/time/#pkg-constants).

Just like [`time.Now`](#now), this is usually used in conjunction with other functions.

Check failure on line 1794 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1794

[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'Just'.
Raw output
{"message": "[Flanksource.DictateFeelings] Don't tell people how they feel with words like 'Just'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1794, "column": 1}}}, "severity": "ERROR"}

_Note: In the absence of a time zone indicator, `time.Parse` returns a time in UTC._

Expand All @@ -1816,7 +1816,7 @@

### ParseLocal

Same as [`time.Parse`](#parse), except that in the absence of a time zone indicator, the timestamp wil be parsed in the local timezone.

Check failure on line 1819 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1819

[Flanksource.Spelling] Is 'wil' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'wil' spelled correctly? Is it missing code formatting?", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1819, "column": 100}}}, "severity": "ERROR"}

Usage with [`Format`](https://golang.org/pkg/time/#Time.Format):

Expand Down Expand Up @@ -1900,7 +1900,7 @@

Create a version 1 UUID (based on the current MAC address and the current date/time).

Use [`uuid.V4`](#v4) instead in most cases.

Check warning on line 1903 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1903

[Flanksource.Wordiness] Consider using 'usually' instead of 'in most cases'.
Raw output
{"message": "[Flanksource.Wordiness] Consider using 'usually' instead of 'in most cases'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1903, "column": 30}}}, "severity": "WARNING"}

```go
{{ uuid.V1 }} // 4d757e54-446d-11e9-a8fa-72000877c7b0
Expand All @@ -1908,7 +1908,7 @@

### V4

Create a version 4 UUID (randomly generated).

Check warning on line 1911 in canary-checker/docs/scripting/gotemplate.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] canary-checker/docs/scripting/gotemplate.mdx#L1911

[Flanksource.Adverbs] Consider removing 'randomly'.
Raw output
{"message": "[Flanksource.Adverbs] Consider removing 'randomly'.", "location": {"path": "canary-checker/docs/scripting/gotemplate.mdx", "range": {"start": {"line": 1911, "column": 26}}}, "severity": "WARNING"}

This function consumes entropy.

Expand Down
5 changes: 5 additions & 0 deletions fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash


vale --output=JSON $1 > vale.json
aider --no-git $1 vale.json -m "As a technical editor for developer tool documentation, Fix any issues detected in $1 by using the scan results in vale.json, do not make changes to anything quoted using \` or \`\`\`. do not remove '//' if found at the start of a line or in the middle of a line. Do not modify any whitespace. Only modify the content based on suggestions in vale.json. DO not modify lines that start with '{{' or lines that look like code. Only modify english sentances. Stop after 20 fixes"
21 changes: 21 additions & 0 deletions styles/ignore/words-with-suggestions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,24 @@ Youtube
yq
CRD's
Zulip
HTTPConnection
scheduleTimeout
expectedContent
expectedHttpStatuses
readyTimeout
scheduleTimeout
httpTimeout
deleteTimeout
ingressTimeout
deadline
httpRetryInterval
ingressName
ingressHost
priorityClass
handshakeTimeout
tlsConfig
templateBody
responseCodes
responseContent
thresholdMillis
maxSSLExpiry
Loading