Skip to content

CLI program that will take a list of existing 'tasks', then go through a given codebase and identify moved tasks, new tasks, and deleted tasks.

License

Notifications You must be signed in to change notification settings

f0rbit/todo-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

todo-tracker is a tool to traverse a directory, identify tasks based on specified tags, and compare the tasks found with an existing dataset to produce a diff. It is implemented in Go for efficient multi-threaded traversal.

Building

To build the application, run make build or:

go build -o todo-tracker

Usage

Arguments

  • parse <directory> <config.json>: Traverse the directory and identify tasks based on the configuration => ParsedTask[]
  • diff <previous_json> <new_json>: Compare two JSON outputs and produce a diff => DiffResult[]

Examples

Parsing a directory

./todo-tracker parse ./resources/codebase ./resources/config.json

Parsing a changed directory

./todo-tracker parse ./resources/codebase-changed ./resources/config.json

Generating a diff

./todo-tracker diff output-base.json output-new.json

Testing

The make diff command will run through an example parse of resources/codebase and resources/codebase-changed and generate an example diff.

Outputs

type ParsedTask = {
    id: string;
    file: string;
    line: number;
    tag: string;
    text: string;
    context: string[];
};

type DiffResult = {
    id: string;
    tag: string;
    type: "SAME" | "MOVE" | "UPDATE" | "NEW" | "DELETE";
    data: {
        old: DiffInfo | null;
        new: DiffInfo | null;
    };
};

type DiffInfo = {
    text: string;
    line: number;
    file: string;
    context: string[];
};

Configuration

The configuration file is a JSON file that specifies the tags to look for and the files or directories to ignore.

Example Configuration

{
    "tags": [
        {
            "name": "todo",
            "match": [
                "@todo",
                "TODO:"
            ]
        },
        {
            "name": "bug",
            "match": [
                "@bug",
                "BUG:"
            ]
        },
        {
            "name": "note",
            "match": [
                "@note",
                "NOTE:"
            ]
        }
    ],
    "ignore": [
        "node_modules",
		"readme.md"
    ]
}

resources/config.json

Configuration Schema

type Config = {
    tags: Tag[];
    ignore?: string[];
};

type Tag = {
    name: string;
    match: string[];
};

About

CLI program that will take a list of existing 'tasks', then go through a given codebase and identify moved tasks, new tasks, and deleted tasks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published