summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-05-14 00:44:19 +0300
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2026-05-14 05:08:53 +0000
commite31d383cc3c213a8e367d5cb3eabc0a1d222f192 (patch)
tree4c451a0702463d24479dfecafb46cd9d054f11eb
parent7001ac6f5e46d1fb1cc6d9cdb5899a20c7d9a752 (diff)
downloadvyos-documentation-e31d383cc3c213a8e367d5cb3eabc0a1d222f192.tar.gz
vyos-documentation-e31d383cc3c213a8e367d5cb3eabc0a1d222f192.zip
ci(doc-linter): drop \s prefix from compressed-IPv6 regex branch
The leading-compression group in `IPV6GROUPS` was r'(?:\s' + IPV6SEG + r':){1,7}:' The `\s` required whitespace before each hextet in the repeated group. In practice this meant compressed forms with leading hextets — `2001:db8::`, `64:ff9b::`, `fe80::1` — only matched when preceded by whitespace inside the line. The linter calls `lint_ipv6(line.strip())`, so at start-of-stripped-line there's no whitespace, and the address fell through to no match. Real-world impact: a documentation page mentioning `2001:4860:4860::8888` (Google DNS) or `64:ff9b::1` (NAT64 well-known prefix) at the start of a line silently passed the IPv6 documentation-address check. None of the other groups in `IPV6GROUPS` use a `\s` prefix. This one was inconsistent. Drop the `\s` so the branch matches compressed forms directly, like its peers. Verified with 6 hand-coded cases (RFC 3849 doc range, Google DNS, NAT64 prefix, mid-line and start-of-line positions). All pass. Tracked as item 3 of the rolling-side cleanup backlog from PR #2014 / #2019 / #2020 reviews. 🤖 Generated by [robots](https://vyos.io) (cherry picked from commit cc1b4d7c28272786e39a11b37a3ca22b80b12eec)
-rw-r--r--scripts/doc-linter.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/doc-linter.py b/scripts/doc-linter.py
index 3903e2cf..f4628c0b 100644
--- a/scripts/doc-linter.py
+++ b/scripts/doc-linter.py
@@ -9,7 +9,7 @@ IPV4ADDR = r'\b(?:(?:' + IPV4SEG + r'\.){3,3}' + IPV4SEG + r')\b'
IPV6SEG = r'(?:(?:[0-9a-fA-F]){1,4})'
IPV6GROUPS = (
r'(?:' + IPV6SEG + r':){7,7}' + IPV6SEG, # 1:2:3:4:5:6:7:8
- r'(?:\s' + IPV6SEG + r':){1,7}:', # 1:: 1:2:3:4:5:6:7::
+ r'(?:' + IPV6SEG + r':){1,7}:', # 1:: 1:2:3:4:5:6:7::
r'(?:' + IPV6SEG + r':){1,6}:' + IPV6SEG, # 1::8 1:2:3:4:5:6::8 1:2:3:4:5:6::8
r'(?:' + IPV6SEG + r':){1,5}(?::' + IPV6SEG + r'){1,2}', # 1::7:8 1:2:3:4:5::7:8 1:2:3:4:5::8
r'(?:' + IPV6SEG + r':){1,4}(?::' + IPV6SEG + r'){1,3}', # 1::6:7:8 1:2:3:4::6:7:8 1:2:3:4::8