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
robotframework-tidy-4.11.0.tar.gz
(82.0 kB
view hashes)
Built Distribution
Close
Hashes for robotframework-tidy-4.11.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 255cad777a2bd24a5744164aceb57a15d14066b873601860c6504500f549af5e |
|
MD5 | 7ce2f447c2a9d5bf1f85201da3fd38c7 |
|
BLAKE2b-256 | ab24921f6aeeaeda476df51a3a48b2169811567e03f0d799508efd162c8d23e1 |
Close
Hashes for robotframework_tidy-4.11.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41897f5d0c6d1884f8420d6ca4e5dde98f0dd312b02a90e88745f6300c32cf3c |
|
MD5 | 1ccf6196652f8aed9bc9505031be3436 |
|
BLAKE2b-256 | 6e394dba387c26e5ec0399d314011cbac28f55f09d6416568f8e7a9a162585e8 |