Skip to content

Default target version doesn't work well with rules version matching #1466

@bhirsz

Description

@bhirsz

If not target version is specified, Robocop by default assumes major version of Robot in current environment:

    if value is None:
        return misc.ROBOT_VERSION.major

This doesn't work well with extended version matching in rules:

    name = "invalid-section"
    rule_id = "NAME16"
    message = "Invalid section '{invalid_section}'"
    severity = RuleSeverity.ERROR
    version = ">=6.1"

In this case since ">=6.1" is above "6" target version, it will be excluded.

We should improve default target version hnadling - either by allowing to define more granular versions, or by corrently assuming default target version (not 6.0 from enum, but 6.1.1 from environment).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions