Skip to content

Exclude should ignore groups #2831

@WetRobot

Description

@WetRobot

This works

lintr::lint(
  text = "x = 1",
  linters = lintr::assignment_linter(),
  exclude = "(?:a)|(?:b)"
)

But this

lintr::lint(
  text = "x = 1",
  linters = lintr::assignment_linter(),
  exclude = "(a)|(b)"
)

raises an error that I think most users will not understand:

Error in `[.data.frame`(re_matches(lines, exclude, locations = TRUE),  : 
  undefined columns selected

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions