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 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
Example
Ugly 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-1.5.1.tar.gz
(32.0 kB
view hashes)
Built Distribution
Close
Hashes for robotframework-tidy-1.5.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dffbd592fbddc5abd5ce1207221a6f82f43c7ade4b5528c007822866d36bd0e |
|
MD5 | 01098262551ddecbab61c816c36bb7cd |
|
BLAKE2b-256 | 2d9b345aecd1865e11cf317d5476300b970c4823352d0f54f939eda699422e68 |
Close
Hashes for robotframework_tidy-1.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 601186e09273bc986b62f8f054e2513e2b8faa1ac23f8ace5c8a128636674ca4 |
|
MD5 | 77725de6e38a86250e777600ccfce120 |
|
BLAKE2b-256 | c1a4031d6da2364298009935f9d2be8965ff7057af6feddb3414cecfbf525b4d |