Show HN: Parse and output TODOs and FIXMEs from comments in your files
1–10 of 44 posts
Re: Show HN: Parse and output TODOs and FIXMEs from comments in your files
#2Many IDEs have built in support for this and I find it very useful. Good that it is coming to the command line too!
It works great as a code review tool, too. Agree on a marker, add review comments to code, commit to source control and tell your team mate about it. It's just about at-your-fingertips as diffs-with-comments tools (like github PRs), and way lighter on the tooling. You also see all the context, not just the changed lines. Eg:
// REVIEW(me): This is getting big, maybe split into two classes?
In smaller teams (say, <5 people on a single shared codebase) I've found this to work remarkably well.Re: Show HN: Parse and output TODOs and FIXMEs from comments in your files
#3I like the idea, but it's a deal-breaker if it can't parse TODOs and FIXMEs at the end of lines—that's where most of mine go.
Re: Show HN: Parse and output TODOs and FIXMEs from comments in your files
#4I just do this: `alias TODO='ack TODO'`
Re: Show HN: Parse and output TODOs and FIXMEs from comments in your files
#5Is there any advantage here over using Ag or Awk or similar:
ag "(TODO|FIXME)"Re: Show HN: Parse and output TODOs and FIXMEs from comments in your files
#6I guess the question is how does this compare to standard existing tools such as grep, i.e. something like
$> grep -Hn TODO test.js
test.js:241:TODO ...Re: Show HN: Parse and output TODOs and FIXMEs from comments in your files
#7I've been using a one-liner git alias to do this for a while now. Works really well.
It uses git grep for grepping/colouring the output and sed to remove prefixed whitespace.
Re: Show HN: Parse and output TODOs and FIXMEs from comments in your files
#8I just do a global search using my text editor.
Re: Show HN: Parse and output TODOs and FIXMEs from comments in your files
#9A lot of comments here comparing it with grep or some other native CLI. I think this fares better at least on three metrics:
1. Fun to build. 2. Output looks prettier. 3. Easier to add more syntactic stuff as edge cases for different languages are factored in. Won't be too hard to extend it for github issues, for example.
Since there would be very few cases of partial matches of "TODO" I think grep would still be much faster.
Re: Show HN: Parse and output TODOs and FIXMEs from comments in your files
#10This functionality is already built into every major OS and this new tool isn't any easier to use than the existing ones:
Linux / UNIX:
grep -n TODO *.js
Windows: find /n "TODO" *.js