Code autoformatter for Robot Framework
Project description
Robotidy
Introduction
Robotidy is a tool for autoformatting Robot Framework code.
It is spiritual descendant of Robot Framework's internal robot.tidy package.
Documentation
Full documentation available here. :open_book:
Requirements
Python 3.7+ :snake: and Robot Framework 4.0.0+ :robot:.
Installation
You can install Robotidy simply by running:
pip install -U robotframework-tidy
Usage
Call robotidy with path(s) to file/directory with robot files:
robotidy tests
robotidy test.robot
robotidy tests/resources test.robot
All command line options can be displayed in help message by executing:
robotidy --help
See documentation for information how to configure robotidy.
Example
Ugly code before transforming with robotidy:
*** Settings ***
Force Tags tags tag2
Library Collections
Resource important.robot
Library MyCustomLibrary.py
Test Setup Setup Keyword
*** test case*
Test1
[ teardown] Teardown Keyword
Keyword
FOR ${var} IN RANGE 10
Run Keyword If ${var}>5 Other Keyword
END
*** Variables ***
${var}= 2
${bit_longer} 10
${var2} a
... b
*** Keywords ***
A lot prettier code after:
*** Settings ***
Library Collections
Library MyCustomLibrary.py
Resource important.robot
Test Setup Setup Keyword
Force Tags tags tag2
*** Variables ***
${var} 2
${bit_longer} 10
${var2} a
... b
*** Test Cases ***
Test1
Keyword
FOR ${var} IN RANGE 10
IF ${var}>5
Other Keyword
END
END
[Teardown] Teardown Keyword
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file robotframework-tidy-2.1.tar.gz
.
File metadata
- Download URL: robotframework-tidy-2.1.tar.gz
- Upload date:
- Size: 43.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfb844e4d19a9ba6e0d6d7d46d2ff2917841652bb4500fb2de43fd2965dce2dd |
|
MD5 | 3e6888224c5c7ad2bd63443f04631e60 |
|
BLAKE2b-256 | 5862c721c9d60c7064a6a99a80661da71a8afbcf1cf2afc05fe573a615494721 |
Provenance
File details
Details for the file robotframework_tidy-2.1-py3-none-any.whl
.
File metadata
- Download URL: robotframework_tidy-2.1-py3-none-any.whl
- Upload date:
- Size: 61.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7935717c528abbe993217b1ffd7c92cdcf8c83f864fb8914207ce346d7d58c11 |
|
MD5 | 0ed3d17cf04c44591391d77124f85074 |
|
BLAKE2b-256 | ef8088aab7504cef11d026caca8f089d1db65feb3a5d60efe6693cd1f97646a7 |