Repository navigation
Docstring parsing from Google style docs - #5684
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Google-style docstring parser utility and its unit tests, while also applying widespread test string formatting cleanups and collapsing some generic type annotations to one-liners.
Changes:
- Introduce
robot.utils.docstring.parse_docstring()andParsedDocStringto extractArgs/Returnssections. - Add comprehensive unit tests for docstring parsing and add
assert_in()to test assertions utilities. - Refactor various tests and a few model type declarations to remove extra parentheses / collapse multi-line constructs.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| utest/utils/test_markuputils.py | Simplifies expected table HTML string construction in tests. |
| utest/utils/test_importer_util.py | Simplifies temporary module file content generation in tests. |
| utest/utils/test_docstring.py | Adds unit tests covering docstring parsing behavior and edge cases. |
| utest/utils/test_deprecations.py | Simplifies multi-line string construction in a deprecation test. |
| utest/utils/test_argumentparser.py | Simplifies multi-line help/usage string construction in tests. |
| utest/running/test_markdownparser.py | Simplifies multi-line markdown fixture strings in tests. |
| utest/result/test_visitor.py | Simplifies nested calls that embed multi-line model strings. |
| utest/parsing/test_model.py | Simplifies embedded model text strings in tests. |
| utest/output/test_jsonlogger.py | Simplifies expected JSON fragments as multi-line strings in tests. |
| src/robot/utils/docstring.py | Adds new docstring parsing implementation. |
| src/robot/utils/asserts.py | Adds assert_in() helper used by new tests. |
| src/robot/running/model.py | Collapses long generic base class type parameters into one line. |
| src/robot/result/model.py | Collapses long generic base class type parameters into one line. |
| src/robot/model/control.py | Collapses long generic base class type parameters into one line. |
| src/robot/model/body.py | Collapses long generic base class type parameters into one line. |
| atest/testdata/libdoc/DynamicLibrary.py | Simplifies returned multi-line documentation string construction. |
| atest/testdata/libdoc/Annotations.py | Simplifies exec() multi-line string usage for annotations. |
| atest/genrunner.py | Simplifies generated robot file header string writes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aaltat
force-pushed
the
docstring
branch
2 times, most recently
from
June 12, 2026 16:28
f902887 to
2e70a55
Compare
pekkaklarck
requested changes
Jun 16, 2026
Member
There was a problem hiding this comment.
This PR is too big and needs to be split to at least three parts:
- Documentation parser and its tests.
- Integrating parser to rest of the Robot and Libdoc code. This probably should include writing docs to Libdoc specs, but that part could also be in a separate PR.
- Libdoc HTML UI changes.
aaltat
force-pushed
the
docstring
branch
2 times, most recently
from
June 17, 2026 14:03
086c723 to
385e773
Compare
| import unittest | ||
| from dataclasses import dataclass | ||
|
|
||
| import yaml |
Comment on lines
+29
to
+34
| def get_data(self, data): | ||
| for test in data.lstrip().split("= = =\n"): | ||
| name, test = test.split("\n", 1) | ||
| name = name[2:] | ||
| docstring, expected = test.split("- - -\n") | ||
| expected = yaml.safe_load(expected) or {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is part of the #5604 but only implements the parsing part.