Skip to content
LDerikx edited this page Mar 2, 2020 · 5 revisions

rflint

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.

Usage

usage: python -m rflint [-h] [--error RULENAME] [--ignore RULENAME] [--warning RULENAME] [--list] [--describe] [--no-filenames] [--format FORMAT] [--version] [--verbose] [--configure CONFIGURE] [--recursive] [--rulefile RULEFILE] [--argumentfile ARGUMENTFILE] ...

positional arguments: file

optional arguments:

  • -h, --help show this help message and exit
  • --error RULENAME, -e RULENAME Assign a severity of ERROR to the given RULENAME
  • --ignore RULENAME, -i RULENAME Ignore the given RULENAME
  • --warning RULENAME, -w RULENAME Assign a severity of WARNING for the given RULENAME
  • --list, -l show a list of known rules and exit
  • --describe, -d describe the given rules
  • --no-filenames suppress the printing of filenames
  • --format FORMAT, -f FORMAT Define the output format
  • --version Display version number and exit
  • --verbose, -v Give verbose output
  • --configure CONFIGURE, -c CONFIGURE Configure a rule
  • --recursive, -r Recursively scan subfolders in a directory
  • --rulefile RULEFILE, -R RULEFILE import additional rules from the given RULEFILE
  • --argumentfile ARGUMENTFILE, -A ARGUMENTFILE read arguments from the given file

You can use 'all' in place of RULENAME to refer to all rules.

For example: '--ignore all --warn DuplicateTestNames' will ignore all rules except DuplicateTestNames.

FORMAT is a string that performs a substitution on the following patterns: {severity}, {linenumber}, {char}, {message}, and {rulename}.

For example: --format 'line: {linenumber}: message: {message}'.

ARGUMENTFILE is a filename with contents that match the format of standard robot framework argument files

If you give a directory as an argument, all files in the directory with the suffix .txt, .robot, .resource, or .tsv will be processed. With the --recursive option, subfolders within the directory will also be processed.

Clone this wiki locally