Skip to content

lint() output should be class c("lints", "list") for S3 dispatch #1494

Closed
@MichaelChirico

Description

@MichaelChirico

I am working on something where I need to edit the line numbers of the lint() output; a natural way to do that is like so:

l <- lint(...)
l <- lapply(l, within, line_number <- line_number + 1)

But this fails because within attempts to dispatch on lints class. For now, we need to call the method explicitly:

l <- lapply(l, within.list, line_number <- line_number + 1)

We could also define a within.lints() method, but that only works for this specific case, I think the problem is more general (it will affect other generics used too process the lint() output, too).

Metadata

Metadata

Assignees

No one assigned

    Labels

    internalsIssues related to inner workings of lintr, i.e., not user-visible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions