Skip to content

Commit 1233208

Browse files
authored
fix(lint): resolve TOML blocking errors; add elide-marker normalizer rule (#7166)
Validator improvement: scripts/lib/codeblock-normalizer.mjs — add a third normalization rule that comments out standalone elide markers (..., ...., [...]) before parsing. These markers are pervasive in Telegraf and InfluxDB TOML examples and YAML config snippets to indicate omitted content, but neither parses as valid TOML/YAML. The new rule rewrites them as language-appropriate comments (# ... for TOML/YAML/bash/python, // ... for JS) so blocks with otherwise valid syntax pass without forcing authors to manually comment every ellipsis. JSON has no comment syntax, so JSON fences with ellipses must still be fixed at the source. For YAML, the substitution skips column-0 ... (the YAML stream document-end marker) — only indented occurrences are treated as ellipsis. This alone clears 22 of the 49 originally-flagged TOML errors. Content fixes (toml fence preserved): - cloud-dedicated / cloud-serverless / clustered v1 API guides: Replace curly close-quote (U+201D) in `content_encoding = "gzip”` with the straight ASCII `"` so the string terminates correctly. - kapacitor reference/event_handlers/post.md (5 errors): Strings containing literal `{{index . "time"}}` template expressions had inconsistent quoting — outer "..." with unescaped inner ". Switched to TOML literal strings (single- quoted) for url and row-template values; inner double quotes are now safe and verbatim. - kapacitor administration/subscription-management.md (2 errors): `db_name = <list of retention policies>` had literal angle brackets, invalid TOML. Changed to a commented pattern. - kapacitor reference/event_handlers/zenoss.md: Bare inline table `{ ... }` lacked a key. Added `severity-map = `. - kapacitor reference/nodes/alert_node.md: Bare `timeout = 10s` is not valid TOML (TOML has no duration primitive). Quoted as "10s" — matches the convention used by 39 other duration values across Kapacitor docs. Kapacitor's config parser still decodes the string into its Duration type. - kapacitor administration/configuration.md: Two alternative configs (v1 / v2-or-Cloud) shared the same [[influxdb]] section, producing duplicate `enabled` and `default` keys. Split into two separate ```toml fences with intervening prose. Each block now parses on its own. - kapacitor administration/auth/kapacitor-auth.md: `auth-enabled: true` used YAML colon syntax inside a TOML block. Changed to `auth-enabled = true`. - kapacitor guides/event-handler-setup.md: `parse-mode = Markdown` had a bare value; quoted as "Markdown". - influxdb v1 administration/https_setup.md: Lone `>` and bracketed `[...]` markers inside a TOML block were blockquote/elide leakage from rendering. Replaced with descriptive TOML comments. - enterprise_influxdb v1 administration/configure/config-data-nodes.md: Mangled prose-mixed-with-TOML around the [[collectd]] section (`Default is `false.`, stray backticks). Cleaned up to a standard commented-defaults block. - enterprise_influxdb v1 administration/configure/security/ldap.md: A 12-line comment block was duplicated verbatim, each followed by the same client-tls-certificate / client-tls-private-key assignments — producing duplicate-key errors. Removed the second (byte-identical) block; the original block above documents the keys. - enterprise_influxdb v1 tools/influxd-ctl/ldap/sample-config.md: Shell prompt `meta1:/# influxd-ctl ldap sample-config -h` was embedded mid-TOML. Moved to a TOML comment showing the producing command. - telegraf v1 configuration.md: Block demonstrates Telegraf's preprocessor `${VAR}` substitution, which uses bare unquoted form for non-string values (`skip_database_creation = ${VAR}`). That syntax is a Telegraf extension to TOML and not parseable by strict TOML validators. Relabeled the fence as `text` with an HTML comment explaining why. - telegraf v1 data_formats/input/json_v2.md: Inline parenthetical `false (or true, just not both)` was not a valid TOML comment. Changed to a proper trailing `#` comment. Deferred to upstream telegraf README sync (6 errors): - input-plugins/jti_openconfig_telemetry, opcua_listener, postgresql_extensible, win_eventlog - output-plugins/dynatrace - processor-plugins/converter These docs are generated from influxdata/telegraf README files per content/telegraf/CLAUDE.md. Any fix here would be reverted on the next sync; they need to be filed and fixed upstream first. Test coverage: 59/59 lint-codeblocks tests still pass.
1 parent d69aca7 commit 1233208

17 files changed

Lines changed: 93 additions & 48 deletions

File tree

content/enterprise_influxdb/v1/administration/configure/config-data-nodes.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,9 +1499,7 @@ For more information, see [CollectD protocol support in InfluxDB](/enterprise_in
14991499
### [[collectd]]
15001500

15011501
```toml
1502-
# enabled`
1503-
1504-
Default is `false.
1502+
# enabled = false # default
15051503
# bind-address = ":25826"
15061504
# database = "collectd"
15071505
# retention-policy = ""

content/enterprise_influxdb/v1/administration/configure/security/ldap.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -187,21 +187,6 @@ enabled = true
187187
client-tls-certificate = "/var/run/secrets/ldapClient.pem"
188188
client-tls-private-key = "/var/run/secrets/ldapClient.key"
189189
190-
# Client certificates to present to the LDAP server are supported with
191-
# "client-tls-certificate" and "client-tls-private-key" configurations.
192-
# These are paths to the X.509 client certificate and corresponding private
193-
# key, respectively. If "client-tls-certificate" is set but
194-
# "client-tls-private-key" is not, then "client-tls-certificate" is assumed
195-
# to bundle both the certificate and private key.
196-
# The LDAP server may request and require valid client certificates
197-
# even when InfluxDB is configured with an insecure TLS mode that ignores
198-
# LDAP server certificate errors.
199-
# Not all LDAP servers will request a client certificate. It is not
200-
# necessary to set "client-tls-certificate" and "client-tls-private-key"
201-
# if the LDAP server does not require client certificates.
202-
client-tls-certificate = "/var/run/secrets/ldapClient.pem"
203-
client-tls-private-key = "/var/run/secrets/ldapClient.key"
204-
205190
# Credentials to use when searching for a user or group.
206191
bind-dn = "cn=read-only-admin,dc=example,dc=com"
207192
bind-password = "read-only-admin's password"

content/enterprise_influxdb/v1/tools/influxd-ctl/ldap/sample-config.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ enabled = true
8080
[[servers.group-mappings]]
8181
group = "web-support"
8282
role = "web-traffic-ro"
83-
meta1:/# influxd-ctl ldap sample-config -h
83+
84+
# Output from: meta1:/# influxd-ctl ldap sample-config -h
8485
# Sample TOML for ldap config.
8586
# First, save this file and edit it for your LDAP server.
8687
# Then test the config with: influxd-ctl ldap verify -ldap-config /path/to/ldap.toml

content/influxdb/v1/administration/https_setup.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,19 @@ setting and set it to `true`.
225225
###############################################################################
226226
# OUTPUT PLUGINS #
227227
###############################################################################
228-
>
228+
229229
# Configuration for InfluxDB server to send metrics to
230230
[[outputs.influxdb]]
231231
## The full HTTP or UDP endpoint URL for your InfluxDB instance.
232232
## Multiple urls can be specified as part of the same cluster,
233233
## this means that only ONE of the urls will be written to each interval.
234234
# urls = ["udp://localhost:8089"] # UDP endpoint example
235235
urls = ["https://<domain_name>.com:8086"]
236-
>
237-
[...]
238-
>
236+
237+
# ... other output options elided ...
238+
239239
## Optional SSL Config
240-
[...]
240+
# ... other SSL options elided ...
241241
insecure_skip_verify = true # <-- Update only if you're using a self-signed certificate
242242
```
243243

content/influxdb3/cloud-dedicated/guides/api-compatibility/v1/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ To configure the v1.x output plugin for writing to {{% product-name %}}, add the
329329
retention_policy = ""
330330
username = "ignored"
331331
password = "DATABASE_TOKEN"
332-
content_encoding = "gzip
332+
content_encoding = "gzip"
333333
```
334334
{{% /code-placeholders %}}
335335

content/influxdb3/cloud-serverless/write-data/api/v1-http.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ To configure the v1.x output plugin for writing to {{% product-name %}}, add the
148148
retention_policy = "RETENTION_POLICY"
149149
username = "ignored"
150150
password = "API_TOKEN"
151-
content_encoding = "gzip
151+
content_encoding = "gzip"
152152
```
153153
{{% /code-placeholders %}}
154154

content/influxdb3/clustered/guides/api-compatibility/v1/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ To configure the v1.x output plugin for writing to {{% product-name %}}, add the
315315
retention_policy = ""
316316
username = "ignored"
317317
password = "DATABASE_TOKEN"
318-
content_encoding = "gzip
318+
content_encoding = "gzip"
319319
```
320320
{{% /code-placeholders %}}
321321

content/kapacitor/v1/administration/auth/kapacitor-auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ authenticate requests to the Kapacitor HTTP API.
7878
```toml
7979
[http]
8080
#...
81-
auth-enabled: true
81+
auth-enabled = true
8282
#...
8383
```
8484

content/kapacitor/v1/administration/configuration.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@ To use Kapacitor with an InfluxDB instance that requires authentication,
432432
the InfluxDB user must have [admin privileges](/influxdb/v1/administration/authentication_and_authorization/#admin-users).
433433
{{% /note %}}
434434
435+
To connect to InfluxDB OSS 1.x or InfluxDB Enterprise, use the following configuration:
436+
435437
{{< keep-url >}}
436438
```toml
437439
# ...
@@ -440,27 +442,28 @@ the InfluxDB user must have [admin privileges](/influxdb/v1/administration/authe
440442
# Connect to InfluxDB
441443
# Kapacitor can subscribe, query, and write to this cluster.
442444
# Using InfluxDB is not required and can be disabled.
443-
# To connect to InfluxDB OSS 1.x or InfluxDB Enterprise,
444-
# use the following configuration:
445-
445+
446446
enabled = true
447447
default = true
448448
name = "localhost"
449449
urls = ["http://localhost:8086"]
450450
username = ""
451451
password = ""
452452
timeout = 0
453+
```
453454
454-
# To connect to InfluxDB OSS 2.x or InfluxDB Cloud,
455-
# use the following configuration:
456-
455+
To connect to InfluxDB OSS 2.x or InfluxDB Cloud, use the following configuration instead:
456+
457+
{{< keep-url >}}
458+
```toml
459+
[[influxdb]]
457460
enabled = true
458461
default = true
459462
name = "localhost"
460463
urls = ["http://localhost:8086"]
461464
token = ""
462-
timeout = 0
463-
465+
timeout = 0
466+
464467
# By default, all data sent to InfluxDB is compressed in gzip format.
465468
# To turn off gzip compression, add the following config setting:
466469
compression = "none"

content/kapacitor/v1/administration/subscription-management.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ If empty, Kapacitor will subscribe to all databases and retention policies excep
107107
```toml
108108
[influxdb.subscriptions]
109109
# Pattern:
110-
db_name = <list of retention policies>
110+
# db_name = [<list of retention policies>]
111111

112112
# Example:
113113
my_database = [ "default", "longterm" ]
@@ -119,7 +119,7 @@ Defines a set of databases and retention policies to exclude from subscriptions.
119119
```toml
120120
[influxdb.excluded-subscriptions]
121121
# Pattern:
122-
db_name = <list of retention policies>
122+
# db_name = [<list of retention policies>]
123123

124124
# Example:
125125
my_database = [ "default", "longterm" ]

0 commit comments

Comments
 (0)