Skip to content

Commit

Permalink
Release 5.9.0: Group support (#1162)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhirsz authored Jan 7, 2025
1 parent 7a80205 commit 11ce051
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 3 deletions.
34 changes: 34 additions & 0 deletions docs/releasenotes/5.9.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
:orphan:

=============
Robocop 5.8.0
=============

Update Robocop rules with GROUP support from Robot Framework 7.2.

Following rules are updated & tested with GROUPs:

- ``invalid-if``
- ``missing-keyword-name``
- ``parsing-error``
- ``return-in-test-case``
- ``too-many-calls-in-keyword``
- ``too-many-calls-in-test-case``
- ``possible-variable-overwriting``
- ``bad-indent``
- ``bad-block-indent``

Acknowledgements
================

Thanks to the whole community for submitting bug reports and feature requests.
Without you, Robocop wouldn't be in the place where it is now. All the feedback
is essential to drive the tool towards higher quality and better user
experience.

If you want to help us more, consider contributing to the project directly.
We can offer our constant support to make the work fun and effective. We do
our best to create a supportive and welcoming environment for everyone.
Feel free to ping us on our official `#robocop-linter Slack channel`_ anytime.

.. _#robocop-linter Slack channel: https://robotframework.slack.com/archives/C01AWSNKC2H
2 changes: 1 addition & 1 deletion robocop/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.8.0"
__version__ = "5.9.0"
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ invalid_try_except.robot:256:1 [E] 0401 Robot Framework syntax error: CONTINUE c
invalid_try_except.robot:269:1 [E] 0401 Robot Framework syntax error: RETURN cannot be used in FINALLY branch.
invalid_while.robot:10:1 [E] 0401 Robot Framework syntax error: WHILE accepts only one condition, got 3 conditions 'Too', 'many' and '!'.
invalid_while.robot:16:1 [E] 0401 Robot Framework syntax error: WHILE loop cannot be empty.
invalid_while.robot:21:1 [E] 0401 Robot Framework syntax error: WHILE loop must have closing END.
invalid_while.robot:21:1 [E] 0401 Robot Framework syntax error: WHILE loop must have closing END.
groups.robot:15:1 [E] 0401 Robot Framework syntax error: GROUP accepts only one argument as name, got 3 arguments 'Too', 'many' and 'values'.
38 changes: 38 additions & 0 deletions tests/atest/rules/errors/parsing_error/groups.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
*** Test Cases ***
END missing
[Documentation] FAIL GROUP must have closing END.
GROUP This is not closed
Fail Not run

Empty
[Documentation] FAIL GROUP cannot be empty.
GROUP This is empty
END
Log Outside

Multiple parameters
[Documentation] FAIL GROUP accepts only one argument as name, got 3 arguments 'Too', 'many' and 'values'.
GROUP Too many values
Fail Not run
END
Log Last Keyword

Non-existing variable in name
[Documentation] FAIL Variable '\${non_existing_var}' not found.
GROUP ${non_existing_var} in name
Fail Not run
END
Log Last Keyword

Invalid data is not reported after failures
[Documentation] FAIL Something bad happened!
# We probably should validate syntax before even executing the test and report
# such failures early. That should then be done also with other control structures.
Fail Something bad happened!
GROUP ${non_existing_non_executed_variable_is_ok}
Fail Not run
END
GROUP Empty non-executed GROUP is ok
END
GROUP Even missing END is ok
Fail Not run
2 changes: 1 addition & 1 deletion tests/atest/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def check_rule(
elif actual != expected:
missing_expected = sorted(set(actual) - set(expected))
missing_actual = sorted(set(expected) - set(actual))
error = "Actual issues are different than expected.\n"
error = f"Actual issues are different than expected.\nExpected file: {expected_file}\n"
if missing_expected:
present_in_actual = "\n ".join(missing_expected)
error += f"Actual issues not found in expected:\n {present_in_actual}\n\n"
Expand Down

0 comments on commit 11ce051

Please sign in to comment.