Skip to content

Commit

Permalink
Release 4.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bhirsz committed May 14, 2024
1 parent 66bdb73 commit 015602f
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 63 deletions.
102 changes: 102 additions & 0 deletions docs/releasenotes/4.12.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
:orphan:

===============
Robotidy 4.12.0
===============

Several updates and fixes for ``RenameVariables`` and ``OrderSettings`` transformers. We are also dropping support for
Python 3.7 with this update.

You can install the latest available version by running

::

pip install --upgrade robotframework-tidy

or to install exactly this version

::

pip install robotframework-tidy==4.12.0

.. contents::
:depth: 2
:local:


Transformers changes
====================

Ignore variable separator in RenameVariables (#682)
---------------------------------------------------

Added new ``ignore`` mode to ``variable_separator`` parameter. It allows to ignore variable separators when
formatting with ``RenameVariables``::

*** Variables ***
# following variables will have variable separators (spaces and underscores) untouched
${variable with space} value
${mixed_variable and_space} value

Ignoring additional variables in RenameVariables (#692)
-------------------------------------------------------

``RenameVariables`` will now ignore and do not transform following variables:

- ``${None}``
- ``${True}``
- ``${False}``
- numerical values such as ``${0x1A}`` or ``${0b01010}``

[Timeout] and [Setup] order for keywords in OrderSettings (#690)
-----------------------------------------------------------------

Default order of keyword settings in ``OrderSettings`` transformer was modified. Robot Framework 7.0 added ``[Setup]``
to keywords (which wasn't supported by Robotidy until now). ``[Timeout]`` order was also changed.

Old default order was ``documentation,tags,timeout,arguments`` and new order is
``documentation,tags,arguments,timeout,setup``.

``[Timeout]`` order was changed to follow Robot Framework Style Guide recommendation.

If you are using ``OrderSettings`` with custom order, this change requires to add ``setup`` to your order.

Note that if you're using ``[Setup]`` with keywords in your code (supported in RF from 7.0) but run Robotidy with older
version (pre 7.0) it will order ``[Setup]`` like a keyword call - essentially ignoring its order.

Fixes
=====

Handle default default of environment variable in RenameVariables (#677)
------------------------------------------------------------------------

``RenameVariables`` did not handle default value of environment variable correctly. Now following code::

Set Test Variable ${local variable} %{env variable=string message}
Log %{MY_ENV=${global}}
Log %{my env=${global} with extra}

should be transformed to::

Set Test Variable ${local_variable} %{ENV_VARIABLE=string message}
Log %{MY_ENV=${GLOBAL}}
Log %{MY_ENV=${DEFAULT} with extra string}

RenameVariables adding _ to variables with equal sign in Variables section (#692)
---------------------------------------------------------------------------------

Following code::

*** Variables ***
${random_seed} = ${None}

was formatted incorrectly - ``_`` was added before ``=``.

Other features
==============

Deprecated support for 3.7 (#570)
---------------------------------

We dropped support for Python 3.7 as it is reached end of lifecycle. It allowed us to refactor our code to use more
recent Python features like improved typing.
14 changes: 0 additions & 14 deletions docs/releasenotes/unreleased/fixes.1.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/releasenotes/unreleased/fixes.2.rst

This file was deleted.

5 changes: 0 additions & 5 deletions docs/releasenotes/unreleased/other.5.rst

This file was deleted.

10 changes: 0 additions & 10 deletions docs/releasenotes/unreleased/transformers.1.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/releasenotes/unreleased/transformers.2.rst

This file was deleted.

15 changes: 0 additions & 15 deletions docs/releasenotes/unreleased/transformers.3.rst

This file was deleted.

2 changes: 1 addition & 1 deletion robotidy/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.11.0"
__version__ = "4.12.0"

0 comments on commit 015602f

Please sign in to comment.