{"id":13367282,"url":"https://github.com/asticode/Go-astitodo","last_synced_at":"2025-03-12T18:32:12.435Z","repository":{"id":57491692,"uuid":"71175403","full_name":"asticode/go-astitodo","owner":"asticode","description":"Parse TODOs in your GO code","archived":false,"fork":false,"pushed_at":"2024-04-22T12:05:34.000Z","size":31,"stargazers_count":64,"open_issues_count":2,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-25T05:25:29.240Z","etag":null,"topics":["go","golang","todo"],"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/asticode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2016-10-17T19:51:36.000Z","updated_at":"2024-09-18T18:08:10.000Z","dependencies_parsed_at":"2024-06-20T18:52:21.160Z","dependency_job_id":null,"html_url":"https://github.com/asticode/go-astitodo","commit_stats":null,"previous_names":["asticode/gotodo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asticode%2Fgo-astitodo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asticode%2Fgo-astitodo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asticode%2Fgo-astitodo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asticode%2Fgo-astitodo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asticode","download_url":"https://codeload.github.com/asticode/go-astitodo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243271543,"owners_count":20264473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","golang","todo"],"created_at":"2024-07-30T00:01:43.556Z","updated_at":"2025-03-12T18:32:12.104Z","avatar_url":"https://github.com/asticode.png","language":"Go","readme":"[![GoReportCard](http://goreportcard.com/badge/github.com/asticode/go-astitodo)](http://goreportcard.com/report/github.com/asticode/go-astitodo)\n[![GoDoc](https://godoc.org/github.com/asticode/go-astitodo?status.svg)](https://godoc.org/github.com/asticode/go-astitodo)\n[![Test](https://github.com/asticode/go-astitodo/actions/workflows/test.yml/badge.svg)](https://github.com/asticode/go-astitodo/actions/workflows/test.yml)\n[![Coveralls](https://coveralls.io/repos/github/asticode/go-astitodo/badge.svg?branch=master)](https://coveralls.io/github/asticode/go-astitodo)\n\nThis is a Golang library and CLI to parse TODOs in your GO code.\n\nIt parses the comments from the AST and extract their TODOs. It can provide valuable information such as the TODO's assignee which can be filtered afterwards.\n\nMost IDEs allow parsing TODOs but they usually have problems with multi line TODOs, can't parse assignees, etc.\n\nThis is also a good start for people who want to use AST.\n\n# Installation\n\nRun\n\n    go get -u github.com/asticode/go-astitodo/...\n\n# Usage\n\n    $ astitodo -h\n    Usage of astitodo:\n    -a string\n        Only TODOs assigned to this username(s) will be displayed\n    -e value\n        Path that will be excluded from the process\n    -f string\n        Format to use when outputting TODOs (supported formats: text, csv, json) (default \"text\")\n    -o string\n        Destination for output (can be stdout, stderr or a file) (default \"stdout\")\n\n# Formatting\n\nA todo is formatted this way:\n\n```go\n    // TODO\u003cline 1\u003e\n    // \u003cline 2\u003e\n    // ...\n```\n\nYou can also add an assignee:\n\n```go\n    // TODO(this is the assignee)\u003cmessage\u003e\n```\n\n# Examples\n## Basic\n\nAssume the following file:\n\n```go\n    package mypackage\n\n    // TODO Damn this package seems useless\n\n    // Here is a dummy comment\n    // TODO(asticode) This variable should be dropped\n    var myvariable int\n\n    // TODO(username) This should be renamed\n    var oops bool\n\n    // TODO Damn this function should be rewritten\n    // Or maybe it should be dropped as well\n    func UselessFunction() {\n    \tvar a = 1\n    \ta++\n    }\n```\n\nRunning\n\n    go-astitodo \u003cpaths to files or dirs\u003e\n\nwill give\n\n    Message: Damn this package seems useless\n    File: mypackage/main.go:3\n\n    Assignee: asticode\n    Message: This variable should be dropped\n    File: mypackage/main.go:6\n\n    Assignee: username\n    Message: This variable should be renamed\n    File: mypackage/main.go:9\n\n    Message: Damn this function should be rewritten\n    Or maybe it should be dropped  as well\n    File: mypackage/main.go:12\n\n## Filter by assignee\n\nRunning\n\n    go-astitodo -a asticode \u003cpaths to files or dirs\u003e\n\nwill output\n\n    Assignee: asticode\n    Message: This variable should be dropped\n    File: mypackage/main.go:6\n\n### Filter by multiple assignees\n\nRunning\n\n    astitodo -a user,anotheruser \u003cpaths to files or dirs\u003e\n\nwill output\n\n    Assignee: asticode\n    Message: This variable should be dropped\n    File: mypackage/main.go:6\n\n    Assignee: username\n    Message: This variable should be renamed\n    File: mypackage/main.go:9\n\n## Exclude paths\n\nYou can exclude paths by running\n\n    go-astitodo -e path/to/exclude/1 -e path/to/exclude/2 \u003cpaths to files or dirs\u003e\n\n## Change output format\n\nYou can output CSV by running\n\n    go-astitodo -f csv \u003cpath to files or dirs\u003e\n\nYou can output JSON by running\n\n    $ astitodo -f json testdata/ | jq '[limit(1;.[])]'\n\n```json\n    [\n      {\n        \"Assignee\": \"\",\n        \"Filename\": \"testdata/excluded.go\",\n        \"Line\": 3,\n        \"Message\": [\n          \"This todo should be ignored as it is in the excluded path\"\n        ]\n      }\n    ]\n```\n\nUse the `json` support to filter the data with `jq`, then use `text templating` to output `text` content.\n\n    astitodo -f json . | jq '.[] | select(.Assignee==\"\") | \"\\(.Filename):\\(.Line): \\(.Message[0])\"'\n    \"encoder.go:33: It does not escape separators from the encoded data.\"\n    ...\n\n\n## Output to a file\n\nYou can output to a file by running\n\n    go-astitodo -o \u003cpath to output file\u003e \u003cpath to files or dirs\u003e\n\n# Contributions\n\nYou know you want to =D\n","funding_links":[],"categories":["实用工具","實用工具"],"sub_categories":["高级控制台界面","高級控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasticode%2FGo-astitodo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasticode%2FGo-astitodo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasticode%2FGo-astitodo/lists"}