diff --git a/docs/releasenotes/4.12.0.rst b/docs/releasenotes/4.12.0.rst new file mode 100644 index 00000000..518df5bf --- /dev/null +++ b/docs/releasenotes/4.12.0.rst @@ -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. diff --git a/docs/releasenotes/unreleased/fixes.1.rst b/docs/releasenotes/unreleased/fixes.1.rst deleted file mode 100644 index 5c3d4a09..00000000 --- a/docs/releasenotes/unreleased/fixes.1.rst +++ /dev/null @@ -1,14 +0,0 @@ -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} diff --git a/docs/releasenotes/unreleased/fixes.2.rst b/docs/releasenotes/unreleased/fixes.2.rst deleted file mode 100644 index 44479e35..00000000 --- a/docs/releasenotes/unreleased/fixes.2.rst +++ /dev/null @@ -1,9 +0,0 @@ -RenameVariables adding _ to variables with equal sign in Variables section (#692) ---------------------------------------------------------------------------------- - -Following code:: - - *** Variables *** - ${random_seed} = ${None} - -was formatted incorrectly - ``_`` was added before ``=``. diff --git a/docs/releasenotes/unreleased/other.5.rst b/docs/releasenotes/unreleased/other.5.rst deleted file mode 100644 index 524d2211..00000000 --- a/docs/releasenotes/unreleased/other.5.rst +++ /dev/null @@ -1,5 +0,0 @@ -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. diff --git a/docs/releasenotes/unreleased/transformers.1.rst b/docs/releasenotes/unreleased/transformers.1.rst deleted file mode 100644 index dff7d5de..00000000 --- a/docs/releasenotes/unreleased/transformers.1.rst +++ /dev/null @@ -1,10 +0,0 @@ -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 diff --git a/docs/releasenotes/unreleased/transformers.2.rst b/docs/releasenotes/unreleased/transformers.2.rst deleted file mode 100644 index c1a1cc08..00000000 --- a/docs/releasenotes/unreleased/transformers.2.rst +++ /dev/null @@ -1,9 +0,0 @@ -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}`` diff --git a/docs/releasenotes/unreleased/transformers.3.rst b/docs/releasenotes/unreleased/transformers.3.rst deleted file mode 100644 index feba992b..00000000 --- a/docs/releasenotes/unreleased/transformers.3.rst +++ /dev/null @@ -1,15 +0,0 @@ -[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. diff --git a/robotidy/version.py b/robotidy/version.py index bdb8bda6..ade1e2b4 100644 --- a/robotidy/version.py +++ b/robotidy/version.py @@ -1 +1 @@ -__version__ = "4.11.0" +__version__ = "4.12.0"