-
Notifications
You must be signed in to change notification settings - Fork 186
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
add xml_find_function_calls()
helper to source expressions
#2357
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2357 +/- ##
==========================================
- Coverage 98.64% 98.53% -0.12%
==========================================
Files 125 125
Lines 5629 5609 -20
==========================================
- Hits 5553 5527 -26
- Misses 76 82 +6 ☔ View full report in Codecov by Sentry. |
this should probably get a section in the custom linters vignette, I don't see that on your TODO right now |
so far 118s on main vs 113s here for devtools::load_all()
system.time(lintr::lint_package()) So 5 secs savings ATM with only some linters converted. |
We have quite a few It might be worth splitting these into to separate paths with separate calls to |
@MichaelChirico PTAL for another round. If you approve of the changes so far, I would flesh out the documentation. |
I was also hoping for the vignette change to serve as a high-level overview for guiding the review 😅 It would help to leave that in the main PR comment anyway for future reference on such a big change. For now, I'll try reading the tests and see if that suffices. |
Overall change looks pretty good, I think we're close enough to ready that we can re-run the benchmark + start on user-facing docs. |
600370b
to
d874444
Compare
Another performance timing on lintr itself is 117s [main] vs 101s [here] => 14% Speedup 🥳 LMK if you want more comparisons before merging. Otherwise, I think it's good to go. |
Co-authored-by: Michael Chirico <[email protected]>
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.
Might be worth benchmarking on base R as well, here's a snippet I tried:
system.time(withr::with_dir(
"~/svn/r-devel/src/library",
for (pkg in list.files()) if (file.exists(file.path(pkg, "DESCRIPTION")))
lint_package(pkg, linters = linters)
))
But linters
includes cyclocomp_linter()
which probably isn't a good idea, wheels were spinning interminably. So maybe a benchmark on a "reasonable" set of linters instead of the full suite.
Approved now if you want to forego that.
OK, I'm seeing 27% improvement on r-devel using our suite (minus Setupget_linters <- \() modify_defaults(
eval(parse(text = read.dcf(".lintr", "linters"))),
cyclocomp_linter = NULL
)
linters <- get_linters(); system.time(withr::with_dir(
"~/svn/r-devel/src/library",
for (pkg in list.files()) if (file.exists(file.path(pkg, "DESCRIPTION")))
lint_package(pkg, linters = linters)
)) Timings
|
Forgot to remove this when I updated the NEWS in #2357
Thanks @MichaelChirico for taking this to the finish line 👍🏻 |
Forgot to remove this when I updated the NEWS in #2357 Co-authored-by: AshesITR <[email protected]> Co-authored-by: Indrajeet Patil <[email protected]>
#' @param function_names Character vector, names of functions whose calls to examine.. | ||
#' @export | ||
# nolint next: object_length. | ||
make_linter_from_function_xpath <- function(function_names, |
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.
looks like this snuck in without test coverage
fixes #2350
fixes #2338
Filing for early feedback and discussion