boakley edited this page Nov 30, 2014 · 2 revisions

(This documentation is woefully incomplete. I'm working on it.)

rflint is a simple static analysis tool for robotframework .txt, .tsv and .robot files in the plain text format (space separated, pipe-separated or tab-separated). It takes as input one or more files, and runs a set of rules against each file.

Rules are simple python classes with a single method, apply. Depending on the parent class, this method will be given a reference to a test suite object, a testcase object, or a keyword object. At the moment, rflint will only look for rules in the rules folder where rflint is installed.

Example rule that checks for duplicate testcase names within a suite:

import rflint.rule as rule

class DuplicateTestNames(rule.SuiteRule):
    '''Verify that no tests have a name of an existing test in the same suite'''
    severity = rule.ERROR

    def apply(self, suite):
        cache = []
        for testcase in suite.testcases:
            if name in cache:
      , testcase.linenumber, "Duplicate testcase name")
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.