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

sublinter attribute? #2665

Open
MichaelChirico opened this issue Sep 26, 2024 · 0 comments
Open

sublinter attribute? #2665

MichaelChirico opened this issue Sep 26, 2024 · 0 comments
Labels
feature a feature request or enhancement

Comments

@MichaelChirico
Copy link
Collaborator

An idea based on:

ropensci-review-tools/goodpractice#179

Currently we have some linters that cover multiple rules, paste_linter() is a good example.

For testing purposes, that means relying on the linter message exact wording for a test that ensures a specific lint was captured in some context.

Within our package, that's kind of fine, but it makes it harder for other packages to create non-fragile tests of behavior that wraps {lintr} behavior.

One way forward is to add a new (optional) attribute sublinter to the lint class for cases like this, so that downstreams can test linter == x && sublinter == y. This is similar to an approach taken for other class tests, especially testing for specific error classes more restrictive than just "error".

The only question is if it's worth maintaining this extra complexity.

@MichaelChirico MichaelChirico added the feature a feature request or enhancement label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant