Using robotidy on CI #675
-
Hello all, I want to configure robotidy to be executed on a gitlab-ci pipeline, how can I do that? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I would start by defining what is you goal. Do you want Robotidy to run with the same configuration you are using locally and warn if the file was modified in CI? And it would work as test if file was or wasnt formatted properly ie in PR. In that case you want to keep configuration i file (to make it easier to reuse the same configuration) and run Robotidy with additional command '--check' (https://robotidy.readthedocs.io/en/stable/quickstart.html#status-code). It will run the tool, not modify files but return status 1 if any file was modified. Gitlab should fail any build with the command that returns 1 status code. As per configuring build you can reuse build for any python tool. I can find and share example if needed later |
Beta Was this translation helpful? Give feedback.
-
It worked, feel free to add to the documentation if needed. |
Beta Was this translation helpful? Give feedback.
Example pipeline:
I didn't test it - if it works, mention it here so I can add it to our documentation as example.
And Robotidy by default looks for configuration file in the project root, that's why we don't need to provide path to config file. "pip install robotframework-tidy" will also install most recent robotframework version (if nothing was installed before). If you wish to use specific version of robot framework then specify the version: