- Notifications
You must be signed in to change notification settings - Fork12
TODOr - RStudio add-in for finding TODO, FIXME, CHANGED etc. comments in your code.
License
dokato/todor
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is RStudio addin that finds allTODO,FIXME,CHANGED etc. comments in yourproject orpackage and shows them as a markers list.
Stable release from CRAN:
install.packages("todor")
The latest version:
devtools::install_github("dokato/todor")# orremotes::install_github("dokato/todor")
When you write an R package, sometimes it's useful to make a note in comments about a place for improvement.
simple_function<-function(a,b) {# TODO in the future check the type of input herea+b}
WithTODOr, detecting such places in the forest of code lines is simple. There are several options to do so. You can click at "Addins" button in the top panel and select one of the options:
- "Find active file TODOs" (for the active file in RStudio editor)
- "Find package TODOs" (if you are creating package)
- "Find project TODOs" (if you are inside the RStudio project)
It is also possible to calltodor
directly from RStudio console:
>todor::todor()
or you can call:
>todor::todor(c("TODO"))
to limittodor
detection only to"TODO"
tags.
HINT: By defaulttodor
works on projects, but you can calltodor_package
to search an entire package.
Regardless of the option that you have chosen, as a result you should see the Markers tab next to your console window in RStudio.
To perform the search on a single file just call:
>todor::todor_file("path_to_file.R")
For more thorough walkthrough check this video-tutorial:https://youtu.be/f4mTYyD2C-8
By defaultTODOr looks for the following notes:FIXME,TODO,CHANGED,IDEA,HACK,NOTE,REVIEW,BUG,QUESTION,COMBAK,TEMP.
But you may change it by settingtodor_patterns
option, for example:
options(todor_patterns= c("FIXME","TODO","CUSTOM"))
In markdown you probably don't want to use#
comments. But that's okay, asTODOr
supports HTML-like comments too.
#Section<!-- TODO Change this section.-->* Very important element.
You can switch off the markdown search:
options(todor_rmd=FALSE)
Searching throughRnw
files (a default option is set below).
options(todor_rnw=TRUE)
Searching throughRhtml
files.
options(todor_rhtml=FALSE)
Searching throughR
,r
files.
options(todor_exclude_r=FALSE)
Excluding packrat directory.
options(todor_exclude_packrat=TRUE)
Including extra file formats.
options(todor_extra= c("txt","dat"))options(todor_extra=NULL)