Robocop and Robotidy line-too-long

I have pyproject.toml that set’s up both robotidy and robocop to use line length as 130 characters. However, tidy does not change/split arguments for test template which leads robocop to complain that the line is too long.

Is this because

a) robot doesnt allow template arguments to be split into multiple lines ?
c) tidy doesn’t know how to split the arguments ?

Hi,

I see the doc mentions this:

SplitTooLongLine does not support splitting all Robot Framework types. Currently it will only work on too long keyword calls, variables and selected settings (tags and arguments). Missing types will be covered in the future updates.

However there’s also these parameters maybe:
split_on_every_arg
split_on_every_setting_arg

Hope that helps.
Regards
Charlie

1 Like

Hello @rasjani,
The issue is likely due to Robotidy’s configuration. By default, Robotidy’s SplitTooLongLine transformer does not split template arguments into multiple lines. You can change this behavior by setting the split_on_every_arg flag to True.

Here’s how you can update your pyproject.toml: medicarecard

toml

[tool.robotidy]
line_length = 130
transform = ["SplitTooLongLine"]
configure = ["SplitTooLongLine:split_on_every_arg=True"]

This should allow Robotidy to split template arguments across multiple lines, resolving the Robocop complaint.

Best Regards,
James Keen

1 Like