github MarketSquare/robotframework-robocop v7.0.0
Robocop 7.0.0

latest releases: v8.2.3, v8.2.2, v8.2.1...
3 months ago

Features

  • Breaking change Add option --extend-select for linter and formatter (issue #1546)

    --extend-select allows to enable rules and formatters on top of the select configuration. It can be used to
    retain all default rules or formatters and only add additional ones:

    robocop check --extend-select no-embedded-keyword-arguments
    robocop format --extend-select AlignKeywordsSection --extend-select CustomFormatter
    

    Since previous --custom-formatters formatter option already behaved like a --extend-select option (which was
    not documented), it is now deprecated and renamed to --extend-select instead.

    It is also recommended to use --extend-select over --configue name.enabled=True.

  • Breaking change Split wrong-case-in-keyword-name rule into two separate rules (issue #1471):

    wrong-case-in-keyword-name which checks case convention in keyword definition name
    wrong-case-in-keyword-call which checks case convention in keyword call name

    It allows configuring different conventions for keyword definition and keyword call names. If you have existing
    configuration for wrong-case-in-keyword-name (you are ignoring it or configuring) you need to apply the same
    config to wrong-case-in-keyword-call to retain old behaviour.

  • SplitTooLongLine can now split more settings types: Library imports, Test Tags and Keyword Tags (issue #1454)

    Example code before and after the change:

    Library    CustomLibraryWithLongerNameAndSeveralArguments    first_argument    second_argument=${longer_variable_name}    WITH NAME    name
    Library             CustomLibraryWithLongerNameAndSeveralArguments
    ...                     first_argument
    ...                     second_argument=${longer_variable_name}
    ...                 WITH NAME    name
  • Restore project checkers (issue #1108)

    Project checkers were temporarily removed in the Robocop 6.0. There are now brought back in a new form, as a separate
    command:

    robocop check-project
    

    This command behaves similarly to the check command, but it only runs project rules.

    The project checks itself were also refactored to be more flexible. See project checker
    and custom rules project checker for reference.

  • Extend robocop disablers to the whole node (issue #1515

    Robocop will now ignore issues in the whole node (keyword, test case, for loop, keyword call, etc.) when the disabler
    is set in the header / keyword call body. For example:

    *** Keywords ***
    My Keyword  
        FOR    ${var}    IN    1  2  3  # robocop: off=unused-variable
             Log    1
        END
        Keyword    # robocop: off=bad-indent
        ...    ${var}
        ...    ${var2}

    Previously, Robocop would ignore unused-variable only when reported on the FOR header and bad-indent only
    when reported on the same line as disabler comment. After this change, those issues will be ignored in the whole
    FOR loop and the whole Keyword call respectively.

  • Ignore unused variables starting with _ (${_variable}) (issue #1457

Fixes

  • Fix unused-variable and variable-overwritten-before-usage rules not reporting violations in TRY blocks (issue #1548)
  • Fix wrong-case-in-keyword-call rule false positive report on names with . character with first_word_capitalized = True (issue #1555)
  • Fix wrong-case-in-keyword-name rule incorrectly handling names with . character (issue #1555)

Documentation

  • Added documentation linters (with MegaLinter) and fixed several issues in our documentation.

Don't miss a new robotframework-robocop release

NewReleases is sending notifications on new releases.