From 2cc025a619ae94e8e59eb1a79c10fc74e9a3a59f Mon Sep 17 00:00:00 2001 From: rebortg Date: Fri, 11 Dec 2020 14:33:14 +0100 Subject: linter: improve IPv4 detection --- .github/vyos-linter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/vyos-linter.py b/.github/vyos-linter.py index bb58786d..ffa355c0 100644 --- a/.github/vyos-linter.py +++ b/.github/vyos-linter.py @@ -5,7 +5,7 @@ import sys import ast IPV4SEG = r'(?:25[0-5]|(?:2[0-4]|1{0,1}[0-9]){0,1}[0-9])' -IPV4ADDR = r'(?:(?:' + IPV4SEG + r'\.){3,3}' + IPV4SEG + r')' +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 @@ -135,6 +135,7 @@ def handle_file_action(filepath): for error in errors: print(f"::{error[2]} file={filepath},line={error[1]}::{error[0]}") print('') + exit() return False -- cgit v1.2.3