blob: b71b289b1e46232b8ef4eaf6ec9a4d8f3525fc85 [file] [log] [blame]
George Keishinge7e91712021-09-03 11:28:44 -05001#!/usr/bin/env python3
Joy Onyerikwu1483ce02019-06-26 14:56:36 -05002# Custom rules file for robotframework-lint.
George Keishing3c230882022-04-29 03:20:24 -05003# Installation : pip3 install --upgrade robotframework-lint
4# Example usage: python3 -m rflint -rA robot_standards -R robot_custom_rules.py .
Joy Onyerikwu1483ce02019-06-26 14:56:36 -05005import re
6from rflint.common import SuiteRule, ERROR
7
8
9class ExtendInvalidTable(SuiteRule):
10 r'''
11 Extend robotframework-lint SuiteRule function for InvalidTable to allow a table section if it is
12 a section of comments. e.g "*** Comments ***"
13 '''
14 severity = ERROR
15
16 def apply(self, suite):
17 for table in suite.tables:
18 if (not re.match(r'^(settings?|metadata|(test )?cases?|(user )?keywords?|variables?|comments?)$',
19 table.name, re.IGNORECASE)):
20 self.report(suite, "Unknown table name '%s'" % table.name, table.linenumber)