Skip to content

params of unregister foreach, where they are in the env? (linting) #38

@latot

Description

@latot

Hi hi, I'm working in a project, where is registered foreach, and then on exit unregistered:

  old_do_par <- doFuture::registerDoFuture()
  on.exit(
    with(
        old_do_par,
        foreach::setDoPar(fun = fun, data = data, info = info)
    ),
    add = TRUE
  )

Probable this code comes from: https://www.rdocumentation.org/packages/doFuture/versions/0.12.2/topics/registerDoFuture

And when we run linting we get:

lintr::lint_package(".")
file.R:124:58: warning: [object_usage_linter] no visible binding for global variable ‘info’
        foreach::setDoPar(fun = fun, data = data, info = info)

The point is clear, even with that definition, the fun, data and info are not declared everywhere, this vars belongs to the package foreach? or from where?

Thx!.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions