diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-14 00:44:19 +0300 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2026-05-14 05:08:37 +0000 |
| commit | 9f7c9c56f3dd1cbbc18ccb7c3f5f039a9d7a2dd2 (patch) | |
| tree | 7e79bf1e03000baae816fbc4ab97f036184e3ff4 /scripts | |
| parent | f2be9537a95e93f0a371c2ed2e7fb66ad59306e3 (diff) | |
| download | vyos-documentation-9f7c9c56f3dd1cbbc18ccb7c3f5f039a9d7a2dd2.tar.gz vyos-documentation-9f7c9c56f3dd1cbbc18ccb7c3f5f039a9d7a2dd2.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)
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/doc-linter.py | 2 |
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 |
