{"id":41442377,"url":"https://github.com/icholy/todo","last_synced_at":"2026-01-23T14:57:53.151Z","repository":{"id":281529163,"uuid":"945554413","full_name":"icholy/todo","owner":"icholy","description":"Library for parsing structured TODO comments from code.","archived":false,"fork":false,"pushed_at":"2025-03-16T17:59:00.000Z","size":89,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T18:40:15.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icholy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-09T17:39:02.000Z","updated_at":"2025-03-16T17:59:04.000Z","dependencies_parsed_at":"2025-03-09T18:41:01.526Z","dependency_job_id":null,"html_url":"https://github.com/icholy/todo","commit_stats":null,"previous_names":["icholy/todo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/icholy/todo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icholy%2Ftodo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icholy%2Ftodo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icholy%2Ftodo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icholy%2Ftodo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icholy","download_url":"https://codeload.github.com/icholy/todo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icholy%2Ftodo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28694458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-23T14:57:52.504Z","updated_at":"2026-01-23T14:57:53.130Z","avatar_url":"https://github.com/icholy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TODO\n\nA library for parsing structured TODO comments from code.\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/icholy/todo.svg)](https://pkg.go.dev/github.com/icholy/todo)\n\n## Overview\n\n- **Tree-Sitter** is used to parse comments from source files.\n- A simple recursive descent parser then extracts and interprets `TODO` lines.\n\n## Syntax\n\n`TODO` can appear anywhere in a comment line; anything before `TODO` is ignored. Once `TODO` is found:\n\n1. An optional comma-separated list of attributes can follow, enclosed in parentheses.\n2. A colon (`:`) must appear next.\n3. Everything after the colon is the description.\n\n### Examples\n\n```\n// TODO: no attributes\n// TODO(foo,bar): two key-only attributes\n// TODO(created=2025-03-09, assigned=john): multiple key/value\n// TODO(deadline=\"June 2025\"): quoted value \n```\n\n### Grammar\n\n```\ntodo-line  ::= (any text) \"TODO\" [ \"(\" attributes? \")\" ] \":\" description\nattributes ::= attribute [ \",\" attribute ]*\nattribute  ::= bare-key | key-value\nkey-value  ::= bare-key \"=\" (bare-key | quoted-value)\ndescription ::= (any text to end of line)\nbare-key   ::= (any non-whitespace sequence without parentheses, commas, or '=')\nquoted-value ::= \"\\\"\" (any text) \"\\\"\"\n```\n\n## API Usage\n\n``` go\npackage main\n\nimport (\n\t\"os\"\n\t\"fmt\"\n\n\t\"github.com/icholy/todo\"\n)\n\nfunc main() {\n\t// read file source\n\tfile := \"./main.go\"\n\tsource, _ := os.ReadFile(source)\n\n\t// parse todos\n\ttodos, _ := todo.Parse(file, source)\n\n\t// print todos with deadlines\n\tfor _, t := range todos {\n\t\tif _, ok := t.Attribute(\"deadline\"); ok {\n\t\t\tfmt.Println(t)\n\t\t}\n\t}\n}\n```\n\n## CLI Tool\n\nA minimal CLI tool is provided to parse and output these comments as JSON.\n\n### Installation\n\n```\ngo install github.com/icholy/todo/cmd/todo@latest\n```\n\n### Usage Example\n\n```\ntodo ./**/*.go\n./todo.go:88 TODO: investigate compilation error\n```\n\n## Language Support\n\nThe following languages are supported out of the box:\n\n- Golang (.go)\n- TypeScript (.ts, .tsx)\n- JavaScript (.js)\n- Ruby (.rb)\n- Rust (.rs)\n- Python (.py)\n- HTML (.html)\n- CSS (.css)\n- Bash (.sh, .bash)\n- C (.c, .h)\n- C++ (.cpp, .cc, .hpp)\n- C# (.cs)\n- Java (.java)\n- OCaml (.ml, .mli)\n- PHP (.php)\n- Scala (.scala, .sc)\n\nAdditional language support can be added by calling `todo.RegisterLanguage`:\n\n```go\nimport (\n    \"github.com/icholy/todo\"\n    treesitter \"github.com/tree-sitter/go-tree-sitter\"\n    lua \"github.com/tjdevries/tree-sitter-lua/bindings/go\"\n)\n\nfunc init() {\n    todo.RegisterLanguage(todo.LanguageOptions{\n        Name:       \"Lua\",\n        Language:   treesitter.NewLanguage(lua.Language()),\n        Extensions: []string{\".lua\"},\n    })\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficholy%2Ftodo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficholy%2Ftodo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficholy%2Ftodo/lists"}