blob: 39eecdf71070232567603a0b415557ee570a9e70 [file] [log] [blame]
Joy Onyerikwu1483ce02019-06-26 14:56:36 -05001#!/usr/bin/env python
2# Custom rules file for robotframework-lint.
3# Example usage: python -m rflint -A robot_standards -R robot_custom_rules.py .
4import re
5from rflint.common import SuiteRule, ERROR
6
7
8class ExtendInvalidTable(SuiteRule):
9 r'''
10 Extend robotframework-lint SuiteRule function for InvalidTable to allow a table section if it is
11 a section of comments. e.g "*** Comments ***"
12 '''
13 severity = ERROR
14
15 def apply(self, suite):
16 for table in suite.tables:
17 if (not re.match(r'^(settings?|metadata|(test )?cases?|(user )?keywords?|variables?|comments?)$',
18 table.name, re.IGNORECASE)):
19 self.report(suite, "Unknown table name '%s'" % table.name, table.linenumber)