Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Robot Framework code formatter

License

NotificationsYou must be signed in to change notification settings

MarketSquare/robotframework-tidy

Repository files navigation

CodecovPyPIPython versionsLicence


Robotidy

DEPRECATION NOTICE

Starting from Robocop 6.0, Robotidy is part of Robocop as formatter.

If you are new users, please usehttps://github.com/MarketSquare/robotframework-robocop instead.

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 availablehere. 📖

Requirements

Python 3.8+ 🐍 and Robot Framework 4.0.0+ 🤖.

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 testsrobotidy test.robotrobotidy tests/resources test.robot

All command line options can be displayed in help message by executing:

robotidy --help

Seedocumentation for information how to configurerobotidy.

Example

Ugly code before transforming with robotidy:

*** Settings ***Force Tags  tags  tag2Library  CollectionsResource  important.robotLibrary   MyCustomLibrary.pyTest 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         CollectionsLibrary         MyCustomLibrary.pyResource        important.robotTest Setup      Setup KeywordForce 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

[8]ページ先頭

©2009-2025 Movatter.jp