Skip to content

fix(lint): resolve TOML blocking errors (43 of 49); add elide-marker normalizer rule#7166

Merged
jstirnaman merged 2 commits intomasterfrom
fix/lint-toml-blocking-errors
May 1, 2026
Merged

fix(lint): resolve TOML blocking errors (43 of 49); add elide-marker normalizer rule#7166
jstirnaman merged 2 commits intomasterfrom
fix/lint-toml-blocking-errors

Conversation

@jstirnaman
Copy link
Copy Markdown
Contributor

Summary

Fixes 43 of the 49 TOML blocking errors flagged by yarn lint-codeblocks on content/. Keeps the toml fence label everywhere it makes sense.

Validator improvement

scripts/lib/codeblock-normalizer.mjs — adds an "elide marker" normalization rule that comments out standalone ..., ...., and [...] lines before parsing. These ellipsis markers are common in Telegraf and InfluxDB config examples to indicate omitted content but neither form 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, column-0 ... (the stream document-end marker) is preserved — only indented occurrences become comments.

This rule alone clears 22 of the 49 originally-flagged TOML errors.

Content fixes (toml fence preserved)

File Fix
cloud-dedicated, cloud-serverless, clustered v1 API guides (3) Replace curly close-quote (U+201D) in "gzip” with straight ASCII "
kapacitor/v1/reference/event_handlers/post.md (5) Switch to TOML literal strings (single-quoted) for url / row-template values containing nested "..." template tokens
kapacitor/v1/administration/subscription-management.md (2) Replace db_name = <list> literal angle brackets with a commented pattern
kapacitor/v1/reference/event_handlers/zenoss.md Add severity-map = prefix to bare inline table { ... }
kapacitor/v1/reference/nodes/alert_node.md Quote bare duration timeout = 10s"10s" (matches 39 other duration values across Kapacitor docs)
kapacitor/v1/administration/configuration.md Split two alternative configs sharing one [[influxdb]] section into separate fences (no more duplicate keys)
kapacitor/v1/administration/auth/kapacitor-auth.md YAML : syntax → TOML = for auth-enabled
kapacitor/v1/guides/event-handler-setup.md Quote bare parse-mode = Markdown
influxdb/v1/administration/https_setup.md Replace stray > blockquote and bare [...] ellipses with TOML comments
enterprise_influxdb/v1/administration/configure/config-data-nodes.md Repair mangled prose-mixed-with-TOML around [[collectd]]
enterprise_influxdb/v1/administration/configure/security/ldap.md Remove a verbatim duplicate of a 12-line comment block plus duplicate client-tls-* key assignments
enterprise_influxdb/v1/tools/influxd-ctl/ldap/sample-config.md Convert embedded shell prompt to a TOML comment
telegraf/v1/configuration.md Block uses Telegraf's ${VAR} preprocessor (TOML-extension); relabel fence as text with explanatory HTML comment
telegraf/v1/data_formats/input/json_v2.md Convert inline parenthetical (or true, just not both) to a proper # comment

Deferred to upstream influxdata/telegraf (6 errors)

These docs are generated from influxdata/telegraf plugin READMEs (per content/telegraf/CLAUDE.md). Any fix in docs-v2 would be reverted on the next sync; they need to be filed and fixed upstream first:

  • content/telegraf/v1/input-plugins/jti_openconfig_telemetry/_index.md
  • content/telegraf/v1/input-plugins/opcua_listener/_index.md
  • content/telegraf/v1/input-plugins/postgresql_extensible/_index.md
  • content/telegraf/v1/input-plugins/win_eventlog/_index.md
  • content/telegraf/v1/output-plugins/dynatrace/_index.md
  • content/telegraf/v1/processor-plugins/converter/_index.md

Will file an upstream issue/PR after this lands.

Verification

  • yarn test:lint-codeblocks: 59/59 pass
  • Re-running yarn lint-codeblocks on the affected files: 0 TOML errors remain in editable files, 6 remain in generated telegraf-plugin docs (listed above)
  • All other \``toml` blocks across the repo continue to parse (no regressions from the normalizer change)

Test plan

  • CI passes
  • Spot-check rendered output on the changed files (TOML syntax highlighting preserved everywhere except the text-relabeled telegraf configuration block)

…rule

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.
@jstirnaman jstirnaman requested a review from a team as a code owner April 29, 2026 14:49
@jstirnaman jstirnaman requested review from sanderson and removed request for a team April 29, 2026 14:49
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Vale Style Check Results

Metric Count
Errors 1
Warnings 7
Suggestions 12

Errors (blocking)

File Line Rule Message
content/influxdb/v1/administration/https_setup.md 244 Google.Exclamation Don't use exclamation points in text.
Warnings (7)
File Line Rule Message
content/influxdb3/cloud-serverless/write-data/api/v1-http.md 89 InfluxDataDocs.Capitalization 'Timestamp precision' should be in sentence case
content/influxdb3/clustered/guides/api-compatibility/v1/_index.md 57 InfluxDataDocs.Capitalization 'Timestamp precision' should be in sentence case
content/influxdb3/cloud-dedicated/guides/api-compatibility/v1/_index.md 58 InfluxDataDocs.Capitalization 'Timestamp precision' should be in sentence case
content/enterprise_influxdb/v1/tools/influxd-ctl/ldap/sample-config.md 2 InfluxDataDocs.Spelling Did you really mean 'ldap'?
content/kapacitor/v1/reference/event_handlers/zenoss.md 2 InfluxDataDocs.Spelling Did you really mean 'Zenoss'?
content/kapacitor/v1/reference/nodes/alert_node.md 5 InfluxDataDocs.Spelling Did you really mean 'tickdoc'?
content/kapacitor/v1/reference/nodes/alert_node.md 1209 InfluxDataDocs.Spelling Did you really mean 'num'?

Check failed — fix 1 error(s) before merging.

@github-actions github-actions Bot added product:kapacitor Kapacitor documentation product:telegraf Telegraf documentation product:v1 InfluxDB v1 OSS product:v1-enterprise InfluxDB Enterprise v1 product:v3-distributed InfluxDB 3 Cloud Serverless, Cloud Dedicated, Clustered labels Apr 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

PR Preview Action v1.4.8
🚀 Deployed preview to https://influxdata.github.io/docs-v2/pr-preview/pr-7166/
on branch gh-pages at 2026-05-01 17:34 UTC

@jstirnaman jstirnaman merged commit 1233208 into master May 1, 2026
21 of 23 checks passed
@jstirnaman jstirnaman deleted the fix/lint-toml-blocking-errors branch May 1, 2026 17:42
github-actions Bot added a commit that referenced this pull request May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:kapacitor Kapacitor documentation product:telegraf Telegraf documentation product:v1-enterprise InfluxDB Enterprise v1 product:v1 InfluxDB v1 OSS product:v3-distributed InfluxDB 3 Cloud Serverless, Cloud Dedicated, Clustered

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant