Skip to content
TODO get - tool to extract todo tasks from source code
Go
Branch: master
Clone or download
Latest commit 19d47cb Aug 25, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Add more tests Aug 22, 2019
.travis.yml Calculate test coverage on travis Aug 19, 2019
LICENSE Initial commit Aug 17, 2019
README.md Update README.md Aug 25, 2019
appveyor.yml Update appveyor.yml Aug 19, 2019
environment.go Update environment.go Aug 25, 2019
environment_test.go Fix GIT_DIR issue Aug 20, 2019
main.go Add min characters limit Aug 25, 2019
todogenerator.go Add min characters limit Aug 25, 2019
todogenerator_test.go Add more tests Aug 22, 2019

README.md

tdg

TODO get - tool to extract todo tasks from source code

Build Status Build status Go Report Card Codacy Badge Maintainability

license copyright language

About

This tool generates json from comments contained in the source code. Main use-case for it is to create automatic issues based on TODO/FIXME/BUG/HACK comments. This tool supports additional tag information in the comment (Category, Issue etc.).

Example of the comment (everything but the first line is optional):

// TODO: This is title of the issue to create
// category=SomeCategory issue=123 estimate=30m
// This is a multiline description of the issue
// that will be in the "Body" property of the comment

Sample generated json (if run in this repository root as tdg -verbose):

{
  "root": "/Users/ribtoks/go/src/github.com/ribtoks/tdg",
  "branch": "master",
  "author": "Taras Kushnir",
  "project": "tdg",
  "comments": [
    {
      "type": "TODO",
      "title": "This is title of the issue to create",
      "body": "This is a multiline description of the issue\nthat will be in the \"Body\" property of the comment",
      "file": "README.md",
      "line": 19,
      "issue": 123,
      "category": "SomeCategory",
      "estimate": 0.5
    }
  ]
}

Supported comments: //, /*, #, %, ;; (adding new supported comments is trivial).

Install

As simple as

go get github.com/ribtoks/tdg

Build

As simple as

go build

Usage

-help
	Show help
-include value
	Include pattern (can be specified multiple times)
-log string
	Path to the logfile (default "tdg.log")
-min-chars int
	Include comments with more chars than this (default 30)
-min-words int
	Skip comments with less than minimum words (default 3)
-root string
	Path to the the root of source code (default "./")
-stdout
	Duplicate logs to stdout
-verbose
	Output human-readable json

Example:

tdg -root ~/Projects/xpiks-root/xpiks/src/ -include "\.(cpp|h)$" -verbose

Include pattern is a regexp. With verbose flag you get human-readable json and log output in stdout. Without verbose flag this tool could be used as input for smth else like curl.

How to contribute

  • Fork tdg repository on GitHub
  • Clone your fork locally
  • Configure the upstream repo (git remote add upstream git@github.com:ribtoks/tdg.git)
  • Create local branch (git checkout -b your_feature)
  • Work on your feature
  • Build and Run tests (go tests -v)
  • Push the branch to GitHub (git push origin your_feature)
  • Send a pull request on GitHub
You can’t perform that action at this time.