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 alloption. Some reports were internal only or produced files which may be not desired. Reports that are not enabled byalland only with specific mention (ie--reports sarif) are marked in our docs (reports docs) (#662) - It is possible now to change order of the reports in the output using
--reportsoption. Before this release reports were generated in order they are implemented in Robocop code. Now if typu configure--reports x,ythen first reportxand then reportywill be generated. You can also combine it withallif 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 oftimestamp) 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) (#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.
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
tomlwithtomlilibrary (for parsing our configuration files).tomlilibrary 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-caseandtoo-long-keywordrules with newignore_docsparameter (Falseby default) (#613) - Relative paths in the
pyproject.tomlconfiguration 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.