From 5ba6e9fef19e5fac2e91682d35da7fc79eff63c0 Mon Sep 17 00:00:00 2001 From: Jeremiah Leary Date: Wed, 25 Nov 2020 15:48:38 -0600 Subject: [PATCH] token_indent would not handle indents which were not defined. --- vsg/rules/token_indent.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vsg/rules/token_indent.py b/vsg/rules/token_indent.py index 176bdbad..78de3b2e 100644 --- a/vsg/rules/token_indent.py +++ b/vsg/rules/token_indent.py @@ -37,6 +37,8 @@ class token_indent(rule.Rule): oViolation.set_action('remove_whitespace') self.add_violation(oViolation) elif len(lTokens) == 2: + if lTokens[1].get_indent() is None: + continue iWhitespace = len(lTokens[0].get_value()) iIndent = self.indentSize * lTokens[1].get_indent() if iWhitespace != iIndent: @@ -45,6 +47,8 @@ class token_indent(rule.Rule): oViolation.set_action('adjust_whitespace') self.add_violation(oViolation) elif len(lTokens) == 1: + if lTokens[0].get_indent() is None: + continue if lTokens[0].get_indent() != 0: sSolution = 'Indent level ' + str(lTokens[0].get_indent()) oViolation = violation.New(oToi.get_line_number(), oToi, sSolution)