Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Robotidy configuration file that disables long-line-wrapping

I’m using robotidy but I haven’t quite managed to wrap my head around how I’m supposed to tell robotidy to not wrap long-lines.

I have tried the following in the robotidy.toml:

  [tool.robotidy]
  transform = [
     "SplitTooLongLine:line_length=9999"
  ]

Unfortunately even though this does indeed disable long-line-wrapping it also disables all other kinds of transformations as well which is obviously not the intended effect.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

There are few ways of configuring the transformers in robotidy.

  1. --transform – like you noticed – will select and run only transformers listed using --transform option. You can optionally pass configuration through --transform option. Not suitable for your case because you want to run rest of the transformers.
  2. --configure – pass configuration to your transformer:
  [tool.robotidy]
  configure = [
     "SplitTooLongLine:line_length=9999"
  ]

It will run all default transformers and additionaly configure SplitTooLongLine with line_length parameter 9999.

Hovewer I think it would be better to disable SplitTooLong altogether since you don’t want to run it – you can use enabled parameter for that:

[tool.robotidy]
configure = [
    "SplitTooLongLine:enabled=False"
]

It’s described in the docs (I admit though I should link it better, for example in every transformer provide url to this page): https://robotidy.readthedocs.io/en/latest/configuration/configuring_transformers.html#configuring-transformers

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading