Robot Framework Tidy
Robotidy is an autoformatter for Robot Framework code, serving as the spiritual successor to Robot Framework's built-in `robot.tidy` tool. Currently at version 4.18.0, it aims to standardize code appearance across projects. While it receives regular updates, the standalone version has been deprecated since 4.17.0 in favor of its integration into Robocop 6.0+.
Warnings
- deprecated The standalone `robotframework-tidy` tool is deprecated since version 4.17.0. New users and projects are strongly encouraged to use the formatter built into `robotframework-robocop` (version 6.0+). The standalone version may not support the latest Robot Framework features or receive active development in the future.
- gotcha Although `robotframework-tidy` dependencies are now 'opened up' to allow installation with newer Robot Framework versions, the standalone tool's compatibility with very recent Robot Framework releases (especially post-RF 7.0) is not guaranteed due to its deprecated status.
- gotcha When running Robotidy in Continuous Integration (CI) pipelines, it's crucial to use the `--check` flag. This flag makes Robotidy return a non-zero exit code if any files would have been modified, preventing unformatted code from being merged.
- gotcha Older Robot Framework versions (e.g., 4.x and below) do not support modern syntax elements like `BREAK`, `RETURN`, or the `VAR` statement. While `robotframework-tidy` versions 4.10.0+ added support for `VAR` syntax and 4.16.0+ for `GROUP`s (for Robot Framework 7.0+), applying such transformations on older Robot Framework installations will lead to syntax errors.
Install
-
pip install robotframework-tidy
Quickstart
robotidy .