Skip to content

Enhance parsing tags from keyword documentation #5707

Closed

Description

@pekkaklarck

Keyword tags can be specified using different approaches depending on how keywords are implemented:

  • [Tags] setting with user keywords
  • @keyword decorator with normal library keywords
  • get_keyword_tags method with dynamic keywords

In addition to the above alternatives, it is always possible to specify tags in the documentation. Currently that works so that the last line of the documentation can be like Tags: first, second. In RF 7.5 we are adding support for argument, return value and exception documentation using similar syntax (#5604):

Args:
    first: Doc of the first argument
    second: Doc of the second argument

Returns:
    Return value documentation

For consistency reasons we should enhance Tags parsing so that it works the same way as the other sections. In practice tags should work like this:

  • Should be allowed anywhere, not only on the last line.
  • Should allow tags to be specified in an indented block below the Tags: header.
  • Should also support tags on the same line as the header. This is important from backwards compatibility and also the other sections support this.
  • Should require an empty row between the header and normal documentation. This is a backwards incompatible change so we should initially support Tags: also without an empty row, but that should be deprecated.

In practice we can move parsing tags to the new parser that handles the other sections. This means that the current split_tags_from_doc utility function isn't needed anymore. It's unlikely it's used by others, but it's still safer to deprecate it than to remove it immediately. Deprecation is also easy, because we already have a mechanism for it (#4150, #4501).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions