Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude should ignore groups #2831

Open
WetRobot opened this issue Mar 11, 2025 · 1 comment
Open

Exclude should ignore groups #2831

WetRobot opened this issue Mar 11, 2025 · 1 comment
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@WetRobot
Copy link

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
@AshesITR
Copy link
Collaborator

Thanks for raising this. When fixing, we could also apply regex validation to other settings (nolint directives, for example).

@MichaelChirico MichaelChirico added the bug an unexpected problem or unintended behavior label Mar 11, 2025
@MichaelChirico MichaelChirico added this to the 3.3.0 milestone Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants