Skip to main content

Code autoformatter for Robot Framework

Project description

Unit-tests Codecov PyPI Python versions Licence


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


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-2.2.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

robotframework_tidy-2.2-py3-none-any.whl (64.4 kB view details)

Uploaded Python 3

File details

Details for the file robotframework-tidy-2.2.tar.gz.

File metadata

  • Download URL: robotframework-tidy-2.2.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for robotframework-tidy-2.2.tar.gz
Algorithm Hash digest
SHA256 31bc41efcba37b224bca5b6e4ecae57567dabcbb9d4d74ade62c020c88a669f6
MD5 ca6f5e6dfab20cd47653ff1ed2fea125
BLAKE2b-256 4cec5a8f7c9d811af3dd6b1164c7378f18cb9da50bedf7e65a1d69f39d8a7b7d

See more details on using hashes here.

Provenance

File details

Details for the file robotframework_tidy-2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_tidy-2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0bc200a6c2ced235a4b57243679b29767f2a7277a3e0c72aae23631748f748f5
MD5 c55383d836913c04c62bf656ac9bd075
BLAKE2b-256 1440d60d38540d81cb61c529f973b1fd540ba947cb62df538eec08f92fef1894

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page