From 7472562deea27fc694a1f7ca6f808ea2ade56a92 Mon Sep 17 00:00:00 2001 From: Heston Hoffman Date: Thu, 13 Aug 2026 20:33:25 -0700 Subject: [PATCH 1/2] Add BlockIgnore for prodname shortcode in Vale config Related to DOCS-15413. --- .vale.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index cdaf205ae26..adb4122994f 100644 --- a/.vale.ini +++ b/.vale.ini @@ -12,7 +12,8 @@ BlockIgnores = (?s) *({{< ?code-block [^>]* >}}.*?{{< ?/ ?code-block >}}), \ (?s) *({{< ?(w|/w)hatsnext [^>]*>}}), \ (?s) *({{< ?(n|/n)extlink [^>]*>}}), \ (?s) *({%\s*if\s+[^%]*%}), \ -(?s) *({%\s*partial\s+[^%]*\/%}) +(?s) *({%\s*partial\s+[^%]*\/%}), \ +(?s) *({{< ?prodname ?>}}.*?{{< ?/ ?prodname ?>}}) TokenIgnores = ({{< ?site-region [^>]* >}}) [*.html] From 5500417d3e32c2a77dc2643ff5940f3b348c3176 Mon Sep 17 00:00:00 2001 From: Heston Hoffman Date: Tue, 18 Aug 2026 11:59:21 -0700 Subject: [PATCH 2/2] Suppress Datadog.Prodname frontmatter noise in CI PR annotations Vale's Datadog.Prodname rule correctly flags product names in YAML frontmatter, but Hugo shortcodes don't render inside raw YAML string values, so wrapping them there isn't actionable. This drops those specific findings from the GitHub annotation output without touching .vale.ini, so the rule still runs everywhere else (including for other tools that consume Vale directly, e.g. the VSCode extension). --- hugo/local/bin/py/vale/vale_annotations.py | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/hugo/local/bin/py/vale/vale_annotations.py b/hugo/local/bin/py/vale/vale_annotations.py index e9e55b2d4e0..c019ff7873b 100644 --- a/hugo/local/bin/py/vale/vale_annotations.py +++ b/hugo/local/bin/py/vale/vale_annotations.py @@ -4,6 +4,32 @@ import argparse import sys +# Rule-specific suppressions: (Check, predicate) pairs. A finding is dropped +# if its Check matches and predicate(filename, line) is True. Used for +# findings that are correctly detected but can never be acted on, so surfacing +# them in PR annotations is just noise -- e.g. Datadog.Prodname flags product +# names in YAML frontmatter, but Hugo shortcodes don't render inside raw YAML +# string values, so wrapping them there wouldn't work. +def is_in_frontmatter(filename, line): + try: + with open(filename, encoding='utf-8') as f: + lines = f.readlines() + except OSError: + return False + start = 0 + while start < len(lines) and lines[start].strip() == '': + start += 1 + if start >= len(lines) or lines[start].strip() != '---': + return False + for i in range(start + 1, len(lines)): + if lines[i].strip() == '---': + return start + 1 <= line <= i + 1 + return False + +SUPPRESSED_CHECKS = { + 'Datadog.Prodname': is_in_frontmatter, +} + # Assigns the Vale log data to a dictionary def munge_logs(file_contents): log_array = [] @@ -55,6 +81,9 @@ def compare_log(filename_log, log_data): for entry in vale_data: vale_filename = entry['Filename'] line = entry['Line'] + suppress_predicate = SUPPRESSED_CHECKS.get(entry['Check']) + if suppress_predicate and suppress_predicate(vale_filename, line): + continue for git_filename, git_line_data in git_data.items(): if vale_filename == git_filename and line in git_line_data: try: