Checkers

Robocop lint rules are internally grouped into similar groups called checkers. Each checker can scan for multiple related issues (like LengthChecker checks both for min and max length of keyword). You can refer to specific rules reported by checkers by its name or id (for example 0501 or too-long-keyword).

Checkers are categorized into following groups:
  • 01: base
  • 02: documentation
  • 03: naming
  • 04: errors
  • 05: lengths
  • 06: tags
  • 07: comments
  • 08: duplications
  • 09: misc
  • 10: spacing
  • 11-50: not yet used: reserved for future internal checkers
  • 51-99: reserved for external checkers

Checker has two basic types:

  • VisitorChecker uses Robot Framework parsing api and Python ast module for traversing Robot code as nodes
  • RawFileChecker simply reads Robot file as normal file and scans every line

Every rule has a unique id made of 4 digits where first 2 are group id while 2 latter are rule id. Unique id as well as rule name can be used to refer to the rule (e.g. in include/exclude statements, configurations etc.) You can optionally configure rule severity or other parameters.

class robocop.rules.RuleSeverity

Rule severity. It can be configured with -c / --configure id_or_msg_name:severity:value Where value can be first letter of severity value or whole name, case insensitive. For example

-c line-too-long:severity:e

Will change line-too-long message severity to error.

You can filter out all rules below given severity value by using following option:

-t/--threshold <severity value>

Example:

--threshold E

Will only report rules with severity E and above.

ERROR = 'E'
INFO = 'I'
WARNING = 'W'
class robocop.checkers.VisitorChecker

Bases: robocop.checkers.BaseChecker, robot.parsing.model.visitor.ModelVisitor

visit_File(node)

Perform generic ast visit on file node.

class robocop.checkers.RawFileChecker

Bases: robocop.checkers.BaseChecker

parse_file()

Read file line by line and for each call check_line method.

Documentation

  • [W0201] missing-doc-keyword: Missing documentation in keyword

    Defined in robocop.checkers.robocop.checkers.documentation.MissingDocumentationChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0202] missing-doc-testcase: Missing documentation in test case

    Defined in robocop.checkers.robocop.checkers.documentation.MissingDocumentationChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0203] missing-doc-suite: Missing documentation in suite

    Defined in robocop.checkers.robocop.checkers.documentation.MissingDocumentationChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity

Naming

  • [W0301] invalid-char-in-name: Invalid character %s in %s name

    Defined in robocop.checkers.robocop.checkers.naming.InvalidCharactersInNameChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    invalid_chars <class ‘set’>
  • [W0302] not-capitalized-keyword-name: Keyword name should be capitalized

    Defined in robocop.checkers.robocop.checkers.naming.KeywordNamingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0303] keyword-name-is-reserved-word: ‘%s’ is a reserved keyword%s

    Defined in robocop.checkers.robocop.checkers.naming.KeywordNamingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0304] not-enough-whitespace-after-newline-marker: Provide at least two spaces after ‘…’ marker

    Defined in robocop.checkers.robocop.checkers.naming.KeywordNamingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0305] underscore-in-keyword-name: Underscores in keyword name can be replaced with spaces

    Defined in robocop.checkers.robocop.checkers.naming.KeywordNamingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0306] setting-name-not-capitalized: Setting name should be capitalized or upper case

    Defined in robocop.checkers.robocop.checkers.naming.SettingsNamingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0307] section-name-invalid: Section name should should be in format ‘* Capitalized *’ or ‘* UPPERCASE *

    Defined in robocop.checkers.robocop.checkers.naming.SettingsNamingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0308] not-capitalized-test-case-title: Test case title should start with capital letter

    Defined in robocop.checkers.robocop.checkers.naming.TestCaseNamingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0309] section-variable-not-uppercase: Section variable name should be uppercase

    Defined in robocop.checkers.robocop.checkers.naming.VariableNamingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0310] non-local-variables-should-be-uppercase: Test, suite and global variables should be uppercased

    Defined in robocop.checkers.robocop.checkers.naming.VariableNamingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0311] else-not-upper-case: ELSE and ELSE IF should be upper case

    Defined in robocop.checkers.robocop.checkers.naming.KeywordNamingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity

Errors

  • [E0401] parsing-error: Robot Framework syntax error: %s

    Defined in robocop.checkers.robocop.checkers.errors.ParsingErrorChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0402] missing-whitespace-after-setting: There should be at least two spaces after the %s setting

    Defined in robocop.checkers.robocop.checkers.errors.TwoSpacesAfterSettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity

Lengths

  • [W0501] too-long-keyword: Keyword is too long (%d/%d)

    Defined in robocop.checkers.robocop.checkers.lengths.LengthChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    max_len <class ‘int’>
  • [W0502] too-few-calls-in-keyword: Keyword have too few keywords inside (%d/%d)

    Defined in robocop.checkers.robocop.checkers.lengths.LengthChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    min_calls <class ‘int’>
  • [W0503] too-many-calls-in-keyword: Keyword have too many keywords inside (%d/%d)

    Defined in robocop.checkers.robocop.checkers.lengths.LengthChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    max_calls <class ‘int’>
  • [W0504] too-long-test-case: Test case is too long (%d/%d)

    Defined in robocop.checkers.robocop.checkers.lengths.LengthChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    max_len <class ‘int’>
  • [W0505] too-many-calls-in-test-case: Test case have too many keywords inside (%d/%d)

    Defined in robocop.checkers.robocop.checkers.lengths.LengthChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    max_calls <class ‘int’>
  • [W0506] file-too-long: File has too many lines (%d/%d)

    Defined in robocop.checkers.robocop.checkers.lengths.LengthChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    max_lines <class ‘int’>
  • [W0507] too-many-arguments: Keyword has too many arguments (%d/%d)

    Defined in robocop.checkers.robocop.checkers.lengths.LengthChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    max_args <class ‘int’>
  • [W0508] line-too-long: Line is too long (%d/%d)

    Defined in robocop.checkers.robocop.checkers.lengths.LineLengthChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    line_length <class ‘int’>
  • [W0509] empty-section: Section is empty

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySectionChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0510] number-of-returned-values: Too many return values (%d/%d)

    Defined in robocop.checkers.robocop.checkers.lengths.NumberOfReturnedArgsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    max_returns <class ‘int’>
  • [W0511] empty-metadata: Metadata settings does not have any value set

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0512] empty-documentation: Documentation is empty

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0513] empty-force-tags: Force Tags are empty

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0514] empty-default-tags: Default Tags are empty

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0515] empty-variables-import: Import variables path is empty

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0516] empty-resource-import: Import resource path is empty

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0517] empty-library-import: Import library path is empty

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0518] empty-setup: Setup does not have any keywords

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0519] empty-suite-setup: Suite Setup does not have any keywords

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0520] empty-test-setup: Test Setup does not have any keywords

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0521] empty-teardown: Teardown does not have any keywords

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0522] empty-suite-teardown: Suite Teardown does not have any keywords

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0523] empty-test-teardown: Test Teardown does not have any keywords

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0524] empty-timeout: Timeout is empty

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0525] empty-test-timeout: Test Timeout is empty

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0526] empty-arguments: Arguments are empty

    Defined in robocop.checkers.robocop.checkers.lengths.EmptySettingsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity

Tags

  • [W0601] tag-with-space: Tags should not contain spaces

    Defined in robocop.checkers.robocop.checkers.tags.TagNameChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [I0602] tag-with-or-and: Tag with reserved word OR/AND. Hint: make sure to include this tag using lowercase name to avoid issues

    Defined in robocop.checkers.robocop.checkers.tags.TagNameChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0603] tag-with-reserved: Tag prefixed with reserved word robot:. Only allowed tag with this prefix is robot:no-dry-run

    Defined in robocop.checkers.robocop.checkers.tags.TagNameChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [I0605] could-be-forced-tags: All tests in suite share those tags: “%s”. You can define them in Force Tags in suite settings instead

    Defined in robocop.checkers.robocop.checkers.tags.TagScopeChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [I0606] tag-already-set-in-force-tags: This tag is already set by Force Tags in suite settings

    Defined in robocop.checkers.robocop.checkers.tags.TagScopeChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [I0607] unnecessary-default-tags: Tags defined in Default Tags are always overwritten

    Defined in robocop.checkers.robocop.checkers.tags.TagScopeChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity

Comments

  • [W0701] todo-in-comment: Found %s in comment

    Defined in robocop.checkers.robocop.checkers.comments.CommentChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0702] missing-space-after-comment: Missing blank space after comment character

    Defined in robocop.checkers.robocop.checkers.comments.CommentChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0703] invalid-comment: Invalid comment. ‘#’ needs to be first character in the cell. For block comments you can use ‘* Comments *’ section

    Defined in robocop.checkers.robocop.checkers.comments.CommentChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0704] ignored-data: Ignored data found in file

    Defined in robocop.checkers.robocop.checkers.comments.IgnoredDataChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0705] bom-encoding-in-file: This file contains BOM (Byte Order Mark) encoding not supported by Robot Framework

    Defined in robocop.checkers.robocop.checkers.comments.IgnoredDataChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity

Duplications

  • [E0801] duplicated-test-case: Multiple test cases with name “%s” in suite

    Defined in robocop.checkers.robocop.checkers.duplications.DuplicationsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0802] duplicated-keyword: Multiple keywords with name “%s” in file

    Defined in robocop.checkers.robocop.checkers.duplications.DuplicationsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0803] duplicated-variable: Multiple variables with name “%s” in Variables section. Note that Robot Framework is case insensitive

    Defined in robocop.checkers.robocop.checkers.duplications.DuplicationsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0804] duplicated-resource: Multiple resource imports with path “%s” in suite

    Defined in robocop.checkers.robocop.checkers.duplications.DuplicationsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0805] duplicated-library: Multiple library imports with name “%s” and identical arguments in suite

    Defined in robocop.checkers.robocop.checkers.duplications.DuplicationsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0806] duplicated-metadata: Duplicated metadata “%s” in suite

    Defined in robocop.checkers.robocop.checkers.duplications.DuplicationsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0807] duplicated-variables-import: Duplicated variables import with path “%s” in suite

    Defined in robocop.checkers.robocop.checkers.duplications.DuplicationsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0808] section-already-defined: ‘%s’ section header already defined in file

    Defined in robocop.checkers.robocop.checkers.duplications.DuplicatedOrOutOfOrderSectionChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0809] section-out-of-order: ‘%s’ section header is defined in wrong order: Setting(s) > Variable(s) > Test Case(s) / Task(s) > Keyword(s)

    Defined in robocop.checkers.robocop.checkers.duplications.DuplicatedOrOutOfOrderSectionChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0810] both-tests-and-tasks: Both Task(s) and Test Case(s) section headers defined in file

    Defined in robocop.checkers.robocop.checkers.duplications.DuplicatedOrOutOfOrderSectionChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity

Misc

  • [W0901] keyword-after-return: [Return] is not defined at the end of keyword. Note that [Return] does not return from keyword but only set returned variables

    Defined in robocop.checkers.robocop.checkers.misc.ReturnChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0902] keyword-after-return-from: Keyword call after ‘Return From Keyword’ keyword

    Defined in robocop.checkers.robocop.checkers.misc.ReturnChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0903] empty-return: [Return] is empty

    Defined in robocop.checkers.robocop.checkers.misc.ReturnChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0906] redundant-equal-sign: Redundant equal sign in variable assignment

    Defined in robocop.checkers.robocop.checkers.misc.EqualSignChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E0907] nested-for-loop: Nested for loops are not supported. You can use keyword with for loop instead

    Defined in robocop.checkers.robocop.checkers.misc.NestedForLoopsChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [I0908] if-can-be-used: ‘%s’ can be replaced with IF block since Robot Framework 4.0

    Defined in robocop.checkers.robocop.checkers.misc.IfBlockCanBeUsed

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W0909] inconsistent-assignment: The assignment sign is not consistent through the file. Expected ‘%s’ but got ‘%s’ instead

    Defined in robocop.checkers.robocop.checkers.misc.ConsistentAssignmentSignChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    assignment_sign_type <function parse_assignment_sign_type at 0x7ff551ce6d08>
  • [W0910] inconsistent-assignment-in-variables: The assignment sign is not consistent inside the variables section. Expected ‘%s’ but got ‘%s’ instead

    Defined in robocop.checkers.robocop.checkers.misc.ConsistentAssignmentSignChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    assignment_sign_type <function parse_assignment_sign_type at 0x7ff551ce6d08>
  • [W0911] wrong-import-order: BuiltIn library import ‘%s’ should be placed before ‘%s’

    Defined in robocop.checkers.robocop.checkers.misc.SettingsOrderChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity

Spacing

  • [W1001] trailing-whitespace: Trailing whitespace at the end of line

    Defined in robocop.checkers.robocop.checkers.spacing.InvalidSpacingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W1002] missing-trailing-blank-line: Missing trailing blank line at the end of file

    Defined in robocop.checkers.robocop.checkers.spacing.InvalidSpacingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W1003] empty-lines-between-sections: Invalid number of empty lines between sections (%d/%d)

    Defined in robocop.checkers.robocop.checkers.spacing.EmptyLinesChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    empty_lines <class ‘int’>
  • [W1004] empty-lines-between-test-cases: Invalid number of empty lines between test cases (%d/%d)

    Defined in robocop.checkers.robocop.checkers.spacing.EmptyLinesChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    empty_lines <class ‘int’>
  • [W1005] empty-lines-between-keywords: Invalid number of empty lines between keywords (%d/%d)

    Defined in robocop.checkers.robocop.checkers.spacing.EmptyLinesChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    empty_lines <class ‘int’>
  • [W1006] mixed-tabs-and-spaces: Inconsistent use of tabs and spaces in file

    Defined in robocop.checkers.robocop.checkers.spacing.InconsistentUseOfTabsAndSpacesChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W1007] uneven-indent: Line is %s-indented

    Defined in robocop.checkers.robocop.checkers.spacing.UnevenIndentChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [E1008] bad-indent: Indent expected

    Defined in robocop.checkers.robocop.checkers.spacing.UnevenIndentChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W1009] empty-line-after-section: Too many empty lines after section header (%d/%d)

    Defined in robocop.checkers.robocop.checkers.spacing.EmptyLinesChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
       
    empty_lines <class ‘int’>
  • [W1010] too-many-trailing-blank-lines: Too many blank lines at the end of file

    Defined in robocop.checkers.robocop.checkers.spacing.InvalidSpacingChecker

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity
  • [W1011] misaligned-continuation: Continuation marker should be aligned with starting row

    Defined in robocop.checkers.robocop.checkers.spacing.MisalignedContinuation

    Configurable parameters
    name type
    severity robocop.rules.RuleSeverity