|
| 1 | +:orphan: |
| 2 | + |
| 3 | +============= |
| 4 | +Robocop 5.1.0 |
| 5 | +============= |
| 6 | + |
| 7 | +You can install the latest available version by running |
| 8 | + |
| 9 | +:: |
| 10 | + |
| 11 | + pip install --upgrade robotframework-robocop |
| 12 | + |
| 13 | +or to install exactly this version |
| 14 | + |
| 15 | +:: |
| 16 | + |
| 17 | + pip install robotframework-robocop==5.1.0 |
| 18 | + |
| 19 | +.. contents:: |
| 20 | + :depth: 2 |
| 21 | + :local: |
| 22 | + |
| 23 | +Rule changes |
| 24 | +============ |
| 25 | + |
| 26 | +Community rule: not-allowed-keyword (#1067) |
| 27 | +------------------------------------------- |
| 28 | + |
| 29 | +New community (optional) rule W10002 ``not-allowed-keyword``. You can use this rule to find keywords that should not |
| 30 | +be used in your project. |
| 31 | + |
| 32 | +For example with following configuration:: |
| 33 | + |
| 34 | + > > robocop -i not-allowed-keyword -c not-allowed-keyword:keywords:click_using_javascript,click_with_sleep |
| 35 | + |
| 36 | +It will find and raise issues in the following code:: |
| 37 | + |
| 38 | + *** Test Cases *** |
| 39 | + Test with obsolete keyword |
| 40 | + [Setup] Click With Sleep 1 min # Robocop will report not allowed keyword |
| 41 | + Test Step |
| 42 | + |
| 43 | + |
| 44 | + *** Keywords *** |
| 45 | + Keyword With Obsolete Implementation |
| 46 | + [Arguments] ${locator} |
| 47 | + Click Using Javascript ${locator} # Robocop will report not allowed keyword |
| 48 | + |
| 49 | +Fixes |
| 50 | +===== |
| 51 | +Task section not recognized for mixed-task-test-settings rule (#1074) |
| 52 | +---------------------------------------------------------------------- |
| 53 | + |
| 54 | +If last section of the file wasn't Tasks section, Robocop assumed that file contains only Test Cases section. This |
| 55 | +caused W0326 ``mixed-task-test-settings`` to be issued with incorrect message. |
| 56 | + |
| 57 | +Thanks @MrBIN89 for finding the issue. |
| 58 | + |
| 59 | +Variables in FOR loop option not recognized by unused-argument (#1073) |
| 60 | +---------------------------------------------------------------------- |
| 61 | + |
| 62 | +Variables in FOR option should be now recognized by W0919 ``unused-argument``:: |
| 63 | + |
| 64 | + *** Keywords *** |
| 65 | + Keyword With For |
| 66 | + [Arguments] ${argument} |
| 67 | + # ${argument} will no longer issue unused-argument |
| 68 | + FOR ${index} ${value} IN ENUMERATE @{LIST} start=${argument} |
| 69 | + Log ${value} |
| 70 | + END |
| 71 | + |
| 72 | +Variable not detected as used in [Tags] and [Documentation] (#1070) |
| 73 | +------------------------------------------------------------------- |
| 74 | + |
| 75 | +I0920 ``unused-variable`` was incorrectly raised even if variable was used in Test Case / Keyword ``[Tags]`` or |
| 76 | +``[Documentation]``. Following code should not raise any issue anymore:: |
| 77 | + |
| 78 | + *** Variables *** |
| 79 | + ${VAR_DOCUMENTATION} Documentation value |
| 80 | + ${VAR_TAG} Tag value |
| 81 | + |
| 82 | + |
| 83 | + *** Test Cases *** |
| 84 | + Test variable in documentation |
| 85 | + [Documentation] ${VAR_DOCUMENTATION} |
| 86 | + No Operation |
| 87 | + |
| 88 | + Test variable in tags |
| 89 | + [Documentation] Documentation in test about variable in tags |
| 90 | + [Tags] ${VAR_TAG} |
| 91 | + No Operation |
| 92 | + |
| 93 | +Comments section with only robocop disabler raising ignored-data (#1044) |
| 94 | +------------------------------------------------------------------------ |
| 95 | + |
| 96 | +Following code will not raise W0704 ``ignored-data`` anymore since comments section contains only robocop disabler and |
| 97 | +empty lines:: |
| 98 | + |
| 99 | + # robocop: off=0701 |
| 100 | + |
| 101 | + *** Test Cases *** |
| 102 | + First Test Case |
| 103 | + [Documentation] Doc |
| 104 | + No Operation |
| 105 | + |
| 106 | +Additionally robotidy disablers (``# robotidy: off``) are now recognized as well. |
| 107 | + |
| 108 | +Relative paths in argument files (#1071) |
| 109 | +----------------------------------------- |
| 110 | + |
| 111 | +Relative paths in argument files will be now resolved correctly. For example, using following command:: |
| 112 | + |
| 113 | + robocop -A tests/args.txt |
| 114 | + |
| 115 | +And tests/args.txt file:: |
| 116 | + |
| 117 | + --ext-rules rules/robocop_rules.py |
| 118 | + |
| 119 | +``--ext-rules rules/robocop_rules.py`` will be resolved to ``--ext-rules tests/rules/robocop_rules.py``. This |
| 120 | +behaviour already worked for toml configuration files and wasn't working correctly for argument files. |
| 121 | + |
| 122 | +Other features |
| 123 | +============== |
| 124 | + |
| 125 | +Robocop file disablers can be defined anywhere in the first comment section (#1044) |
| 126 | +----------------------------------------------------------------------------------- |
| 127 | + |
| 128 | +It was possible to disable Robocop for selected or all rules in the given file. However such disablers had to be defined |
| 129 | +in the the first line of the file:: |
| 130 | + |
| 131 | + # robocop: off |
| 132 | + |
| 133 | + *** Test Cases *** |
| 134 | + Test |
| 135 | + Step |
| 136 | + |
| 137 | +It is now also possible to define file-level disablers anywhere in the first comment section:: |
| 138 | + |
| 139 | + # robocop: off=onerule |
| 140 | + # explanation why the rule is disabled |
| 141 | + # robocop: off=onerule2 |
| 142 | + |
| 143 | + *** Test Cases *** |
| 144 | + Test |
| 145 | + Step |
| 146 | + |
| 147 | +Disable reports from the configuration (#1072) |
| 148 | +---------------------------------------------- |
| 149 | + |
| 150 | +It is now possible to disable all reports with special keyword ``None``:: |
| 151 | + |
| 152 | + robocop --reports all,None |
| 153 | + |
| 154 | +It is useful when Robocop joins configuration from multiple sources (configuration files or cli) but user want to |
| 155 | +override any configured report and do not run any report. |
| 156 | + |
| 157 | +Acknowledgements |
| 158 | +================ |
| 159 | + |
| 160 | +Thanks to the whole community for submitting bug reports and feature requests. |
| 161 | +Without you, Robocop wouldn't be in the place where it is now. All the feedback |
| 162 | +is essential to drive the tool towards higher quality and better user |
| 163 | +experience. |
| 164 | + |
| 165 | +If you want to help us more, consider contributing to the project directly. |
| 166 | +We can offer our constant support to make the work fun and effective. We do |
| 167 | +our best to create a supportive and welcoming environment for everyone. |
| 168 | +Feel free to ping us on our official `#robocop-linter Slack channel`_ anytime. |
| 169 | + |
| 170 | +.. _#robocop-linter Slack channel: https://robotframework.slack.com/archives/C01AWSNKC2H |
0 commit comments