collect

collect command reference

Name Short Long Description Remark Status Multiple

Path

-p

--path

The path from which to start traversal.

None

stable

no

Workers

-w

--workers

The amount of workers (threads) used when parsing the collected files.

None

stable

no

Filter

-f

--filter

The regex for filtering the files that are to be parsed.

None

stable

no

Format

--format

The format of the todo statements that are parsed. It is the start literal followed by the end literal, separated with a comma.

Example: --format="// TODO::(,):"

stable

yes

Examples

  • Basic usage:
    senile collect

  • Specifying the root directory:
    senile collect -p ./src

  • Specifying the file filter regex (only .rs files):
    senile collect -f="\.rs$"

  • Specifying the todo statement format:
    senile collect --format="## TODO~[[,]]:"

  • Specifying more formats:
    senile collect --format="// TODO!(,):" --format="## TODO~[[,]]:"

Output

The collect command searches for all todo statements recursively from the given directory/file (tree). It collects information about the todo body, the priority, the file and the line in that file.\ It will output a json formatted string to STDOUT as follows:\

[
  {
    "prio": "$priority",
    "assignee": "$assignee",
    "body": "$todo_body",
    "context": [
      "$context_line",
      "$context_line",
      ...
    ],
    "file": "$fq_relative_file_path",
    "line": $line
  },
  ...
]
Note
These entries are string-sorted by their assigned priority.

Default ToDo statement format in code

The default format is // TODO!($priority, $assignee, $context_lines_below): $content.\ The priority and assignee are self explanatory. You can specify whatever string you want inside them.\ The $context_lines_below argument tells the tool how many lines it shall include below your comment as context.