News for hackers. Stuff that matters.
Re:Show HN: Summarise all code annotation like TODO or FIXME by Ruud-v-A on Sunday February 26, 2017 @01:34PM (#13738795)
Or you could just run `git grep --line-number TODO`.
Re:Show HN: Summarise all code annotation like TODO or FIXME by ahmadassaf on Sunday February 26, 2017 @01:39PM (#13738832)
this will give you any line that has `TODO` in them, whether that was a TODO comment or just an occurrence of that word. An example:

README.md:149: * Must have one of the words: NOTE, OPTIMIZE, TODO, HACK, XXX, FIXME, or BUG

which brought this from the readme file but it was not a "real" to do.

you can then start thinking of passing regex to the grep, and trying to catch all the other annotations like FIXME, NOTE, etc. and then again you need a way to start ignoring certain files, maybe you do not want to check all the files in your node_modules, etc.

All in all, this module is just a little helper that tries to solve all these little issues.

Thanks for the pointer :)

Re:Show HN: Summarise all code annotation like TODO or FIXME by onion2k on Sunday February 26, 2017 @04:59PM (#13740194)
Wouldn't 'git grep --line-number ^TODO' fix that (only match TODO at the start of a line)? Maybe with some whitespace matching if you indent your TODOs?
Re:Show HN: Summarise all code annotation like TODO or FIXME by cryptarch on Sunday February 26, 2017 @06:16PM (#13740582)
I don't put my TODO's at the start of lines? Usually only in single-line comments after some code.

I think a script with a few grep invocations for all code files with lines containing TODO/FIXME etc. is about right, takes minutes to set up and will work for all but the most obscure cases.

It'll easily deal with your README.md case.

Re:Show HN: Summarise all code annotation like TODO or FIXME by StavrosK on Sunday February 26, 2017 @06:29PM (#13740660)
I'm not convinced that "^\s(//|#|--)\s(TODO|FIXME|XXX)\s*:" (i.e. a fairly simple regex) isn't a plausible way to do what's required of this. All the colors and everything are nice, but a simple bash script sounds eminently doable.
Re:Show HN: Summarise all code annotation like TODO or FIXME by cryptarch on Monday February 27, 2017 @07:22AM (#13743684)
You can easily get the colors and fancy UTF chars with an xargs | printf so a Bash/sh script should do fine.
Re:Show HN: Summarise all code annotation like TODO or FIXME by seanp2k2 on Monday February 27, 2017 @05:46AM (#13743306)
Ack is also great for stuff like this, and easy to run as a hook or NPM thing https://beyondgrep.com