Robotframework-robocop

Latest version: v5.4.0

Safety actively analyzes 666166 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 10

2.6.0

This release focuses on better support for Robot Framework 6.0 and improvements to our documentation and spacing rules.

Several other changes are listed in [full release notes](https://github.com/MarketSquare/robotframework-robocop/blob/master/docs/releasenotes/2.6.0.rst).

2.5.0

Several changes to our spacing and comments rules and also initial suppport for Robot Framework 5.1 features such as languages or ``AS`` markers.


Robot Framework 5.1 support

Language markers

Robocop now supports reading the Robot Framework files in different languages
using ``--language`` option. More details in our [docs](https://robocop.readthedocs.io/en/stable/user_guide.html#language-support) (646).

WITH NAME deprecated in favour of AS

Alias for library import can be now defined using ``AS`` marker (same as in Python).
``WITH NAME`` will be gradually deprecated in the future Robot Framework versions.
That's why we added support for ``AS`` marker to existing rules and created new
rule ``deprecated-with-name`` which will warn on ``WITH NAME`` usage starting from RF 5.1 (642).

Empty lines handling refactor (708)

We changed how we're recognizing the empty lines in spacing rules.
Previously ``consecutive-empty-lines``, ``empty-lines-between-keywords`` and ``empty-lines-between-test-cases``
rules ignored comments. This lead to suprising behaviours, for example following code reported three empty lines
between keywords:


*** Keywords ***
Keyword
Pass

comment 1

comment 2

Second Keyword
Pass



Detecting end of the keyword / test was also not working correctly (in above example `` comment 1`` should belong
to ``Keyword`` and do not count towards empty lines between keywords).
``consecutive-empty-lines`` now also works inside ``IF``, ``FOR``, ``WHILE`` and ``TRY`` blocks.

Configurable ``todo-in-comment``

New ``markers`` parameter in ``todo-in-comment`` rule that allows to define your own
markers that should be reported when found in the comment (674).

Configurable block comments in ``missing-space-after-comment``

New ``block`` parameter in ``missing-space-after-comment`` rule that allows to define
pattern for block comments that should be ignored by the rule (689)

Keywords inside run keywords are now parsed

Keywords inside keywords like ``Run Keywords`` or ``Run Keyword If`` are now recognized
and handled by keyword rules (691, 520).

Fixes

- ``too-few-calls-in-test-case`` now properly count keywords inside templated tests.
It is now also possible to ignore templated tests in ``too-few-calls-in-test-case`` rule
with ``ignore_templated`` parameter (685)
- ``too-few-calls-in-test-case`` and ``too-few-calls-in-keyword`` now counts new RF 5.0 syntax (such as
``RETURN`` or ``BREAK`` statements). The code inside ``IF``, ``FOR``, ``WHILE`` and ``TRY`` blocks is now
also recognized by those rules (704)
- several naming rules now reports with more precise location (290)
- duplicated import name now acknowledge the aliased name (699)
- external rules are now properly loaded from installed Python module (709)
- critical failures in Robot Framework that cause Robocop to stop working are now wrapped with more
user friendly message (586)

Acknowledgements

Big thanks to everyone:
ger-kil, Lucas-C, antonpaa and UliSei for raising issues and helping to improve
our documentation.
rikerfi for extending our comment rules

2.4.0

Several improvements and fixes for Robocop reports & first updates for upcoming Robot Framework 5.1 release. Rule severity can be also be dynamic depending on the rule other parameters.

Reports improvements & fixes
-----------------------------------
- Not all reports will be generated when using ``--reports all`` option. Some reports were internal only or produced files which may be not desired. Reports that are not enabled by ``all`` and only with specific mention (ie ``--reports sarif``) are marked in our docs ([reports docs](https://robocop.readthedocs.io/en/latest/reports.html)) (#662)
- It is possible now to change order of the reports in the output using ``--reports`` option. Before this release reports were generated in order they are implemented in Robocop code. Now if typu configure ``--reports x,y`` then first report ``x`` and then report ``y`` will be generated. You can also combine it with ``all`` if you only want one report at the top and rest in default order: ``--reports x,all`` (664)
- Invalid report name will now fail and suggest alternative if you made a typo - previously invalid report name was silenty ignored. For example it was possible to configure ``--reports timestamps`` (instead of ``timestamp``) and user was not aware of it (665)

Sarif report
-------------
Robocop can now generate report in ``sarif`` format. This format is accepted by various CI platforms as result of code scanning and can be used to integrate into Github CI (more details in our [docs](https://robocop.readthedocs.io/en/stable/ci.html)) (#638)

Configurable rule severity
-----------------------------
It is now possible to configure rule to report with different rule severity depending if the rule exceed given thresholds (614).
For example if you want ``line-too-long`` rule to issue warning on lines above 120 characters long and error on lines longer than 200 character you can configure it using ``severity_threshold``:

robocop -c line-too-long:line_length=120 -c line-too-long:severity_threshold:warning=120:error=200


More on the feature in our [docs](https://robocop.readthedocs.io/en/latest/rule_severity_thresholds.html#rule-severity-thresholds).


``too-few-calls-in-test-case`` rule
------------------------------------
New rule ``too-few-calls-in-test-case``. If the test case have less that allowed number of keyword calls (1 by default) it will report an error.

Other
------
- Replaced ``toml`` with ``tomli`` library (for parsing our configuration files). ``tomli`` library was selected to be part of Python vendored-in libraries in future Python release (609)
- Handle new reserved tags in Robot Framework 5.1 (660)
- You can ignore documentation in ``too-long-test-case`` and ``too-long-keyword`` rules with new ``ignore_docs`` parameter (``False`` by default) (613)
- Relative paths in the ``pyproject.toml`` configuration file are now resolved using configuration file parent directory as parent (and not using tool current working directory which lead to unexpected behaviour) (612)

Acknowledgements
----------------------
Big thanks to ds-dustenharrison, bollwyvl, adrszad, ZephyrusMB, phermann-DGL, rikerfi for raising the issues and providing the feedback.

2.3.0

New report and small fix.

Timestamp report
----------------------
Report that returns Robocop execution timestamp (628 637). Example:


Reported: 2022-07-10 21:25:00 +0300


Handle comments with separators inside
----------------------------------------------
When comment in Robot Framework contains more than one space of separator inside, it is recognized as two separate comments under the hood. It lead to a few small bugs when processing such comments - it is now resolved (634).
Additionally block comments (starting with `) are now ignored by ``missing-space-after-comment`` rule.

Acknowledgements
----------------------
Big thanks to MoreFamed , UliSei for raising the issues and rikerfi for implementing the ``timestamp`` report.

2.2.0

Updates to rule severity and threshold handling.

- Fixed the bug where the overriden rule severity wasn't taken into account by reports (623)
- Threshold severity can be now configured the same way the rule severity is configured (624)
- Invalid threshold value now raises an error instead of silently using INFO severity (624)

Other
-------
Updated Robocop python requirements to ">=3.6". The requirement did not change but we were missing this data in our metadata (621).

Acknowledgements 💪🏻
-----------------------------
UliSei for raising the issues regarding our rule & threshold severity

2.1.0

You can configure it using "all" or "version":

robocop --reports version src


Naming rules changes
-----------------------------
Update to some of our naming rules done by jannek76 (615).
- ``wrong-case-in-keyword-name`` rule received a new parameter: ``pattern``. It allows you to define pattern that will be ignored from the keyword name. It's useful when Robocop doesn't detect the name of the keyword correctly (it works as a workaround for 595).

- ``not-allowed-char-in-name`` split to ``not-allowed-char-in-name`` (which now covers test case and keyword names) and ``not-allowed-char-in-filename`` (which now covers suite names). Same as the original rule, ``not-allowed-char-in-filename`` also accepts ``patern`` that defines which characters are not allowed in a name. This split allows you to configure ``patern`` separately for suite and test/keyword names.

Acknowledgements 💪🏻
-----------------------------
Big thanks to everyone!
jannek76 For improving our (not-so-simple) naming rules
rikerfi For adding new report

Page 5 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.