robotframework-tidy
robotframework-tidy copied to clipboard
Errorneous documentation regarding InlineIf transformer
Hi, as regards https://robotidy.readthedocs.io/en/latest/transformers/InlineIf.html:
It reads:
With following configuration Robotidy will transform all IFs to inline IFs if they are under 140 characters long:
robotidy --line-length 140 src.robot
This does not function for me this way: there remains block-IF even when the resulting line would be about 100 chars long. I think there is 80-chars limit (see discussion on Slack on April 4), which is applied and is not documented.
However, I would like Robotidy work as written in docs: when only global line_length is set, it would affect everything; but for particular transformers it could be overridden. :)
There is a typo in the last example:
robotidy --line-length 140 --configure InlineIf:line_length:80 src.robot
The last ":" should be changed to "=".
Thanks for the report - most likely the issue is withing..building the documentation:
Currently 1.6.2 is live while it should be 2.3. Most recent version described the line-length option bit better.
Hovewer there is typo in the example - I will fix it, thanks!
However, I would like Robotidy work as written in docs: when only global line_length is set, it would affect everything; but for particular transformers it could be overridden. :)
That's how InlineIf worked at the beginning but then some people opposed saying that global limit is bit too lenient for InlineIf case (120 line length) and that's why it use separate value of 80. I need to think about this - most likely it should be discussed and decided on during style guide discussions that (I hope) will soon kick off.
Linked PR with typo fixes and rebuilded the online documentation and added warning if the doc version is not up to date:
Linked PR with typo fixes and rebuilded the online documentation and added warning if the doc version is not up to date:
That's great! Can we have it in Robocop as well? :)
Linked PR with typo fixes and rebuilded the online documentation and added warning if the doc version is not up to date:
That's great! Can we have it in Robocop as well? :)
Yes of course, it's actually fairly easy flag to set in the readthedocs so I just did it. For robocop due to the different theme the warning looks bit nicer: