summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-05-13 23:30:02 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-05-13 23:30:02 +0300
commitbad55da626f59fd84e85e8f6d9a826ae1f0b8860 (patch)
tree4d382129fe7caa9cb0470ed25600d83a79e5fa5e
parentab497bf93ecc769f621b59220d9df1c13d3d2fa1 (diff)
downloadvyos-documentation-bad55da626f59fd84e85e8f6d9a826ae1f0b8860.tar.gz
vyos-documentation-bad55da626f59fd84e85e8f6d9a826ae1f0b8860.zip
docs(linter): add one-line docstrings to clear coverage warning
CodeRabbit Pre-merge Docstring Coverage check reported 50% on scripts/doc-linter.py (threshold 80%). Add minimal one-line docstrings to each public function; no behavior change. 🤖 Generated by [robots](https://vyos.io)
-rw-r--r--scripts/doc-linter.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/doc-linter.py b/scripts/doc-linter.py
index f580fcdc..9f1e6f57 100644
--- a/scripts/doc-linter.py
+++ b/scripts/doc-linter.py
@@ -88,6 +88,7 @@ def is_suppression_marker(line, kind, in_md_fence, in_rst_codeblock,
def lint_mac(cnt, line):
+ """Flag MAC addresses outside the RFC 7042 documentation range."""
mac = re.search(MAC, line, re.I)
if mac is not None:
mac = mac.group()
@@ -98,6 +99,7 @@ def lint_mac(cnt, line):
def lint_ipv4(cnt, line):
+ """Flag IPv4 addresses outside RFC 5737 / private / multicast ranges."""
ip = re.search(IPV4ADDR, line, re.I)
if ip is not None:
ip = ipaddress.ip_address(ip.group().strip(' '))
@@ -112,6 +114,7 @@ def lint_ipv4(cnt, line):
def lint_ipv6(cnt, line):
+ """Flag IPv6 addresses outside RFC 3849 / private / multicast ranges."""
ip = re.search(IPV6ADDR, line, re.I)
if ip is not None:
ip = ipaddress.ip_address(ip.group().strip(' '))
@@ -125,6 +128,7 @@ def lint_ipv6(cnt, line):
def lint_AS(cnt, line):
+ """Placeholder for future AS-number documentation-range checks (RFC 5398)."""
number = re.search(NUMBER, line, re.I)
if number:
pass
@@ -132,11 +136,13 @@ def lint_AS(cnt, line):
def lint_linelen(cnt, line):
+ """Warn when a line exceeds the 80-character docs convention."""
line = line.rstrip()
if len(line) > 80:
return (f"Line too long: len={len(line)}", cnt, 'warning')
def handle_file_action(filepath):
+ """Run all lint checks on one file, respecting fence/code-block and suppression context."""
errors = []
file_ext = os.path.splitext(filepath)[1].lower()
# Stack of open MD/MyST fences: (char, min_len). Supports nesting like
@@ -236,6 +242,7 @@ def handle_file_action(filepath):
def main():
+ """Entry point: lint the changed-file list from argv, or fall back to walking `docs/`."""
bool_error = True
print('start')
try: