Robotframework-tidy

Latest version: v4.14.0

Safety actively analyzes 681775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

2.6.0

IndentNestedKeywords
The order of the transformers changed - now ``IndentNestedKeyword`` runs before ``AlignSettingsSection``. Thanks for
this change settings will be properly indented by other transformers after ``IndentNestedKeyword`` splits the keywords ([318](https://github.com/MarketSquare/robotframework-tidy/issues/318)):

robotframework
*** Settings ***
Suite Setup Run Keywords
... No Operation
... No Operation


Fixes
- Extended encoding (such as characters like ÁáÉéĚěÍíÓóÚúÝýŮůŘřŤťŠšĎČčŇň) is now supported in ``--diff`` mode ([324](https://github.com/MarketSquare/robotframework-tidy/issues/324))
- ``indent`` parameter is now taken into account by ``NormalizeTags`` transformer ([323](https://github.com/MarketSquare/robotframework-tidy/issues/323))
- ``spacecount`` parameter is now taken into account in inline IFs by NormalizeSeparators transformer ([322](https://github.com/MarketSquare/robotframework-tidy/issues/322))

2.5.0

Indent run keywords

New ``IndentNestedKeywords`` transformer for formatting whitespace in run keywords variants such as ``Run Keywords`` or
``Run Keyword And Continue On Failure``. It will result in transforming following code:
robotframework
Run Keyword Run Keyword If ${True} Run keywords Log foo AND Log bar ELSE Log baz

to:
robotframework
Run Keyword
... Run Keyword If ${True}
... Run keywords
... Log foo
... AND
... Log bar
... ELSE
... Log baz


Remove empty lines in multiline statements
``NormalizeNewLines`` transformer now removes empty lines inside multiline statements:
robotframework
*** Keywords ***
Keyword
Keyword With
... Multiline arguments

... With empty lines

will be formatted to:
robotframework
*** Keywords ***
Keyword
Keyword With
... Multiline arguments
... With empty lines

2.4.1

Fix for ``SplitTooLongLine`` transformer breaking keywords with veeery long names ([314](https://github.com/MarketSquare/robotframework-tidy/issues/314))

2.4

Extra ``--indent`` option

Robotidy normalizes all whitespaces using the same fixed amount of spaces (configurable via ``--spacecount``).
It's then optionally modified by various transformers such as AlignSettingsSection.
This release add additional option ``--indent`` that allows to configure indentation separately ([293](https://github.com/MarketSquare/robotframework-tidy/issues/293)).

It's now possible to have for example indentation of 4, but separator between the tokens (``spacecount``) equal to 2 spaces:

robotidy --indent 4 --spacecount 2


Keyword
FOR ${index} ${item} IN ENUMERATE {LIST}
My Keyword ${index} ${item}
END


``skip_documentation`` for NormalizeSeparators

It is now possible to skip formatting suite, test case and keyword documentation with NormalizeSeparator transformer
by using ``skip_documentation`` parameter ([300](https://github.com/MarketSquare/robotframework-tidy/issues/300)):


robotidy --configure NormalizeSeparators:skip_documentation=True src


Other
- Added ``--skip-gitignore`` flag to ignore ``.gitignore`` files and parse files listed there ([299](https://github.com/MarketSquare/robotframework-tidy/issues/299)).

2.3

Prettified output
Tidied out and colorized the console output of the Robotidy such as help messages, transformer docstrings and errors ([298](https://github.com/MarketSquare/robotframework-tidy/issues/298)).

2.2

Disable formatting from source code

Previously the only option to disable formatting in part of the file was to use cumbersome
``--startline`` and ``--endline`` markers. This release brings new feature - comment disablers.
You can disable formatting in Robot Framework statement or in span of lines using `` robotidy: off`` marker.

To skip the formatting for one statement:

robotframework
Keyword That Is Longer Than Allowed Line Length ${arg} robotidy: off


To skip multiple lines:

robotframework
*** Test Cases ***
Test that will be formatted
Step

robotidy: off
Test that will not be formatted
Step

robotidy: on
Another test that will be formatted
Step


`` robotidy: on`` marker is used to enable the formatting again - but is not required. `` robotidy: off`` will disable
the formatting to the end of the current block:

robotframework
Keyword That Is Formatted
IF $condition
Formatted
ELSE
Formatted
robotidy: off
Not Formatted
WHILE $condition
Not Formatted
END
END
Formatted


It's possible to disable the formatting in whole file by putting `` robotidy: off`` on first line:

robotframework
robotidy: off
*** Settings ***
Library Collections


You can also disable the formatting in whole section if you put `` robotidy: off`` in section header:

robotframework
*** Test Cases ***
Formatted
Step

*** Keywords *** robotidy: off
Not Formatted
Step


Transformers
- NormalizeNewLines now removes leading, trailing and consecutive empty lines in IF, FOR, WHILE, TRY EXCEPT blocks ([288](https://github.com/MarketSquare/robotframework-tidy/issues/288))

Fixes
- It's no longer possible to forcefully enable transformer not supported in installed Robot Framework version ([281](https://github.com/MarketSquare/robotframework-tidy/issues/281), [#283](https://github.com/MarketSquare/robotframework-tidy/issues/283))

Other
- You can now disable coloring the output with ``--no-color`` cli option or by setting ``$NO_COLOR`` environment variable ([268](https://github.com/MarketSquare/robotframework-tidy/issues/268))
- Added an option to set target version of Robot Framework when formatting the files:

robotidy --target-version rf4 .

It will disable all transformers that require Robot Framework greater than <target-version> to run (even if you have Robot Framework greater than <target-version> installed). ([253](https://github.com/MarketSquare/robotframework-tidy/issues/253))

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.