[Rule] GROUP rules
Robot Framework 7.2 introduce new syntax: GROUP. We need to add rules that will cover it.
Proposals:
- GROUP without name
GROUP
Keyword Call
END
- Nested GROUPs
GROUP Named
GROUP At some point we may recommend not using nested groups / use custom keywords instead
Keyword Call
END
END
- Too many parameters - already handled by parsing error
GROUP Too many values
Fail Not run
END
- Empty group
GROUP Empty group
END
- Invalid syntax (for some reason parsing error does not catch it):
GROUP Group without end
```
Also #1158
How about GROUP with a single keyword in the body?
GROUP foo
Do only one thing
END
And maybe a rule for too deeply nested stuff. You can do this without groups, but groups make it easier to create deep nesting:
GROUP foo
IF something
FOR i IN range(10)
GROUP bar
...
END
END
END
END
How about GROUP with a single keyword in the body?
GROUP foo Do only one thing END
yes, typically we should avoid it - we can add len rule for it (configurable if needed). Also too big group rule
any ideas to get this published?
It should be implemented first :) currently I'm handling ongoing issues after 6.0 release, but if not someone else, then I could take a look ina upcoming weeks. If you have ideas for different group rules then also please share.
Hi! Any update on covering GROUP syntax ? I have used the formatter & all indentations got removed inside GROUP sections:
Before formatting:
GROUP Name of Group
Keyword Call
Keyword Call
Keyword Call
END
After formatting:
GROUP Name of Group
Keyword Call
Keyword Call
Keyword Call
END
Is there a workaround to avoid this ?
@MarvKler
It is not expected behaviour - I will check it out. At minimum Robocop should support GROUP syntax as it is. This thread was created for additional support (like extra linter rules). I'm not sure if you are related but at the same time other user reported #1424 . I will give updates to this issue in that thread