You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 thelint
class for cases like this, so that downstreams can testlinter == 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.
The text was updated successfully, but these errors were encountered: