robotframework-robocop
robotframework-robocop copied to clipboard
Rule severity depending on thresholds
I'd like to configure e. g. line-too-long to raise warning if length>140, but error when length>200. The same for other parameterized rules.
Nice idea! I need to take a look if it's a low-hanging fruit or it requires significant changes to the code.
I have an idea how it could be implemented - I will try it.
The basic design for now: introduce new class SeverityThreshold
which can be added to Rule definition. It should contain name of the RuleParam that 'controls' severity of the rule:
It could be then configured the same way return status is configured:
robocop -c line-too-long:severity_threshold:warning=140:error=200
By default it would support int but if there is need we could add support for other types (like boolean).
I've manage to implement this. I'm currently working on updating our engine for generating the docs and tests. Docs example: