-
Notifications
You must be signed in to change notification settings - Fork 186
Add linter_level Attribute to Linter()
#2352
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
Conversation
FYI I won't be available for detailed review for some days |
Thanks for the heads-up |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2352 +/- ##
=======================================
Coverage 99.41% 99.41%
=======================================
Files 124 124
Lines 5642 5654 +12
=======================================
+ Hits 5609 5621 +12
Misses 33 33 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Definitely an appreciable speed-up.
(I've a nitpicky comment, but don't feel strongly either way.)
if (!is.function(fun) || length(formals(args(fun))) != 1L) { | ||
stop("`fun` must be a function taking exactly one argument.", call. = FALSE) | ||
} | ||
linter_level <- match.arg(linter_level) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB:
match.arg(NA, NA_character_)
# Error in match.arg(NA, NA_character_) :
# 'arg' must be NULL or a character vector
Maybe match.arg(as.character(linter_level))
is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that can omit linter_level=
if you want NA
. But yes, would be nicer to allow logical NA
as well.
fixes #2351