Title: | Find All TODO Comments and More |
---|---|
Description: | This is a simple addin to 'RStudio' that finds all 'TODO', 'FIX ME', 'CHANGED' etc. comments in your project and shows them as a markers list. |
Authors: | Dominik Krzemiński [aut, cre] |
Maintainer: | Dominik Krzemiński <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.2 |
Built: | 2024-10-25 04:46:40 UTC |
Source: | https://github.com/dokato/todor |
Extracts the list of unique files which contain a todor
marker and applies extract_markers_to_md
to each of these files.
build_markdown_report(markers)
build_markdown_report(markers)
markers |
List of todor markers. |
Build Rstudio Markers
build_rstudio_markers(markers)
build_rstudio_markers(markers)
markers |
list of markers |
Clean line from comment tags
clean_comments(line, pattern = NULL)
clean_comments(line, pattern = NULL)
line |
character with comment tag to remove |
pattern |
character with pattern to detect (default NULL) |
cleaned character
## Not run: clean_comments("#' TODO abc abc") #"TODO abc abc" ## End(Not run)
## Not run: clean_comments("#' TODO abc abc") #"TODO abc abc" ## End(Not run)
Create markers
create_markers(todo.list)
create_markers(todo.list)
todo.list |
list of files with lists of items detected in each |
markers list
Extracts all todor
markers in a given file and converts
them to bullet-pointed markdown syntax. The file name is printed in bold at
the top of each section.
extract_markers_to_md(file, markers)
extract_markers_to_md(file, markers)
file |
Name of file. Used to extract TODOs in that file from the list of markers. |
markers |
List of |
Find package
find_package(path = getwd())
find_package(path = getwd())
path |
character with path to directory with R code files |
package path
Find patterns like
# TODO text
#TODO Test this thing.
#TODO: Test this thing.
#TODO - Test this thing.
<!-- TODO Test this thing. -->
<!-- TODO: Test this thing. -->
<!-- TODO - Test this thing. -->
find_pattern(text, patterns = c("TODO", "FIXME"))
find_pattern(text, patterns = c("TODO", "FIXME"))
text |
character with text |
patterns |
character vector |
character with pattern in brackets or NULL
It lists recursively with full path names.
list_files_with_extension(extension, search_path)
list_files_with_extension(extension, search_path)
extension |
character with extension |
search_path |
character with path to start searching from |
list of files with specified extension
It calls find_pattern
on given file and return detected markers or NULL.
process_file(filepath, patterns)
process_file(filepath, patterns)
filepath |
character with |
patterns |
vector of characters with given patterns to detect, e.g. c("TODO", "BUG") |
list of markers (which are lists describing properties of detected item from find_pattern)
Called on project that are not R packages. Checks all places in the code
which require amendents as specified in todo_types
on R and r files.
It triggers rstudio markers to appear.
todor( todo_types = NULL, search_path = getwd(), file = NULL, output = "markers" )
todor( todo_types = NULL, search_path = getwd(), file = NULL, output = "markers" )
todo_types |
vector with character describing types of elements to detect. If NULL default items will be used. |
search_path |
vector with paths that contains comments you are looking for. |
file |
character with path to file. If not NULL the search_path will be ignored. |
output |
what form should the output take? "markers" (default) creates a marker for each TODO and lists them in the "Markers" Rstudio pane. "markdown" converts the TODO list to markdown syntax. "list" results in a list of files with lists of items detected in each |
There are several options that let you control TODOr behaviour:
todor_rmd
- when set to TRUE it searches also through Rmd files
(default TRUE).
todor_rnw
- when set to TRUE it searches also through Rnw files
(default FALSE).
todor_rhtml
- when set to TRUE it searches also through Rhtml files
(default FALSE).
todor_exclude_packrat
when set to FALSE, all files in the "packrat"
directory are excluded (default TRUE).
todor_exclude_r
when TRUE, it ignores R and r files (default FALSE)
todor_patterns
must be vector. Contains all the names of patterns to
be detected. Default are: "FIXME", "TODO", "CHANGED", "IDEA", "HACK", "NOTE",
"REVIEW", "BUG", "QUESTION", "COMBAK", "TEMP".
Todor file
todor_file(file_name, todo_types = NULL, output = "markers")
todor_file(file_name, todo_types = NULL, output = "markers")
file_name |
character with file name |
todo_types |
vector with character describing types of elements to detect. If NULL default items will be used. |
output |
what form should the output take? "markers" (default) creates a marker for each TODO and lists them in the "Markers" Rstudio pane. "text" coverts the TODO list to markdown syntax |
Calls todor_file
function on active document path.
todor_file_addin()
todor_file_addin()
Called on packages. Checks all places in the code which require amendents
as specified in todo_types
.
It triggers rstudio markers to appear.
todor_package(todo_types = NULL)
todor_package(todo_types = NULL)
todo_types |
vector with character describing types of elements to detect. If NULL default items will be used. |
Calls todor_package
function.
todor_package_addin()
todor_package_addin()
Calls todor
function.
todor_project_addin()
todor_project_addin()