Skip to content

Integration with roxygen2: data structure for get_source_expressions() #2004

@MichaelChirico

Description

@MichaelChirico

There are a number of linters it would be nice to write regarding roxygen2 documentation, e.g. ensuring @param entries are in sync with the declaration (of course @inheritParams makes this hard to to completely, but certainly @param X should only happen when X is indeed a parameter.

We could also apply the rest of the lint suite directly to code in @examples.

Parsing the roxygen markup is easy enough: roxygen2::parse_file(). The key will be integrating this result with our existing data structure from get_source_expressions(), which I don't see a super clean way to do while also ensuring we keep the link between which doc entry corresponds to which source expression.

As a reminder, the current structure is laid out here: https://lintr.r-lib.org/reference/get_source_expressions.html#value.

We also likely want to keep the data structure back-compatible unless we want this to become a version 4.0.0 thing.

So filing this issue first for design discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementroxygen2Linting package documentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions