-
Notifications
You must be signed in to change notification settings - Fork 2
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
Make sure the content to the left of TODO items doesn't get deleted when marking a TODO item as complte #27
Conversation
I will probably remove the rm_line argument, it seems unsafe + not well tested. Give more info of the source of todo deletion. I may have broken line resolving, although I didn't touch this part
WalkthroughThe recent updates to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 2
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- NEWS.md (1 hunks)
- R/outline.R (2 hunks)
- R/use-todo.R (1 hunks)
- tests/testthat/test-use-todo.R (3 hunks)
Files skipped from review due to trivial changes (1)
- tests/testthat/test-use-todo.R
Additional Context Used
LanguageTool (16)
NEWS.md (16)
Near line 31: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ... *file_outline()
better support for todo in md files *file_outline()
should ...
Near line 33: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...tline()should recognize and transform markdown links automatically with new
markup_hr...
Near line 35: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...nly takes care of changing gh issues in markdown links. Newmarkup_href()
is more gene...
Near line 50: The progressive form of the verb may be more appropriate here.
Context: ...work better with Quarto books, avoiding to look in_book
and_execute
, and classify...
Near line 50: Do not mix variants of the same word (‘regexp’ and ‘regex’) within a single text.
Context: ...c file name, hence not looking for this regexp when searching for conflicts. * `file_...
Near line 54: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ... default. *file_outline()
truncates todo items to fit on a single line. * can n...
Near line 58: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...k. * Simplified internal function frommark_todo_as_complete()
tocomplete_todo()
* ...
Near line 60: Did you mean “giving”? Or maybe you should add a pronoun? In active voice, ‘encourage’ + ‘to’ takes an object, usually a pronoun.
Context: ...element on the first line (to encourage to give an informative description as first lin...
Near line 60: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ...informative description as first line) (todos or tests excluded) * Improved support ...
Near line 77: Possible missing preposition found.
Context: ... what to do.force
is now deprecated. Is now separated in smaller functions that...
Near line 94: Did you mean “writing”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun.
Context: ... max before min. *use_todo()
allows to write to no project with use_todo("all::") *...
Near line 94: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ... allows to write to no project with use_todo("all::") *use_todo()
provides the h...
Near line 96: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...use_todo()
provides the handy :: as a shortcut for `use_todo("tod...
Near line 96: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...j>:: as a shortcut for `use_todo("todo items", "proj") to write TODO ite...
Near line 96: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...odo items> as a shortcut for `use_todo("todo items", "proj") to write TODO items to ...
Near line 100: To form a complete sentence, be sure to include a subject.
Context: ... a RStudio project *complete_todo()
can be used multiple times sequentially and...
Additional comments not posted (7)
R/use-todo.R (4)
140-140
: LGTM!
144-148
: LGTM!
161-173
: LGTM!
187-191
: LGTM!R/outline.R (3)
595-596
: Improved regex pattern accuracy.
614-616
: Ensured regex pattern is modified twice if needed.
616-616
: Ensured regex pattern is modified twice if needed.
@@ -133,36 +133,63 @@ complete_todo <- function(line_id, file, regexp, rm_line = NULL) { | |||
)) | |||
} | |||
|
|||
line_content_before_comment <- stringr::str_extract(line_content, "([^#]+)#", group = 1) |
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.
Consider renaming line_content_before_comment
to line_content_prefix
for clarity.
- line_content_before_comment <- stringr::str_extract(line_content, "([^#]+)#", group = 1)
+ line_content_prefix <- stringr::str_extract(line_content, "([^#]+)#", group = 1)
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
line_content_before_comment <- stringr::str_extract(line_content, "([^#]+)#", group = 1) | |
line_content_prefix <- stringr::str_extract(line_content, "([^#]+)#", group = 1) |
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- R/outline.R (2 hunks)
- R/use-todo.R (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- R/outline.R
- R/use-todo.R
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- R/use-todo.R (2 hunks)
- tests/testthat/test-use-todo.R (3 hunks)
Files skipped from review as they are similar to previous changes (2)
- R/use-todo.R
- tests/testthat/test-use-todo.R
Current status is that there is too much deletion happening..
WHich means that somethings ends up resolving to an empty string somewhere.
I probably should change my testing strategy to make sure smaller chunks are behaving well.
todo rename rm_line to rn_tag