Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
==========================================
+ Coverage 96.92% 97.01% +0.08%
==========================================
Files 24 25 +1
Lines 1172 1207 +35
==========================================
+ Hits 1136 1171 +35
Misses 36 36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This comment was marked as resolved.
This comment was marked as resolved.
radbasa
requested changes
Jun 19, 2025
radbasa
left a comment
Collaborator
There was a problem hiding this comment.
The three-deep loop can/will be difficult to maintain and debug. As single XPath query or a series of XPath queries can be tested manually using a XPath query utility.
| .Rproj.user | ||
| docs | ||
| inst/doc | ||
| box.linters.Rproj |
Collaborator
There was a problem hiding this comment.
Remove. Don't gitignore Rproj file.
Comment on lines
+113
to
+131
| for (call_node in box_use_calls) { | ||
| # Get all arguments (import specifications) | ||
| args <- xml2::xml_find_all(call_node, "./expr[position() > 1]") | ||
|
|
||
| # Process each argument | ||
| for (arg in args) { | ||
| # Handle alias assignments (like tbl = tibble) | ||
| target_nodes <- xml2::xml_find_all(arg, ".//node()") | ||
|
|
||
| #' Extract components before [ bracket | ||
| import_parts <- extract_import_parts(target_nodes) | ||
|
|
||
| # Combine parts to form full import specifier | ||
| import_text <- paste(import_parts, collapse = "") | ||
|
|
||
| # Store the import text and XML node | ||
| all_imports <- append(all_imports, list(list(text = import_text, node = arg))) | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
Performance concern.
This is a three-deep nested loop with multiple xml searches which themselves are loops:
for
xml_find_all()
for
xml_find_all()
for # extract_import_parts()
O(n^3)
radbasa
reviewed
Jun 19, 2025
| return( | ||
| lintr::Linter(function(source_expression) { | ||
| return(list()) | ||
| list() |
radbasa
added a commit
that referenced
this pull request
Jun 24, 2025
3 tasks
This was referenced Jul 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #149
Duplicates on import should be linted.
Description
box_repeated_calls_linterthat detects repetitions even when on differentbox::usecalls;tests/testthat/test-box_repeated_calls_linter.R;box_repeated_calls_lintertorhino_default_linters;Definition of Done
R CMD check, linter, unit tests, spelling)..Rdfiles withroxygen2::roxygenise())