diff --git a/vsg/rules/line_length.py b/vsg/rules/line_length.py index 1a3ecb62..a21163cc 100644 --- a/vsg/rules/line_length.py +++ b/vsg/rules/line_length.py @@ -23,12 +23,12 @@ class line_length(length.Rule): length.Rule.__init__(self, name=name, identifier=identifier) self.disable = False self.length = 120 - self.solution = 'Reduce line to less than ' + str(self.length) + ' characters' def _get_tokens_of_interest(self, oFile): return oFile.get_lines_with_length_that_exceed_column(self.length) def _analyze(self, lToi): for oToi in lToi: + self.solution = 'Reduce line to less than ' + str(self.length) + ' characters' oViolation = violation.New(oToi.get_line_number(), oToi, self.solution) self.add_violation(oViolation) diff --git a/vsg/tests/length/test_rule_001.py b/vsg/tests/length/test_rule_001.py index 69322733..6f40dcb9 100644 --- a/vsg/tests/length/test_rule_001.py +++ b/vsg/tests/length/test_rule_001.py @@ -37,3 +37,5 @@ class test_length_rule(unittest.TestCase): oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations)) + oViolation = oRule.violations[0] + self.assertEqual('Reduce line to less than 125 characters', oViolation.sSolution)