
Show HN: Summarise all code annotation like TODO or FIXME - ahmadassaf
https://github.com/ahmadassaf/code-notes
======
jacquesm
There was this too:

[https://github.com/JohnPostlethwait/fixme](https://github.com/JohnPostlethwait/fixme)

~~~
ahmadassaf
actually the tool is mainly based on this tool .. but the guy is not
maintaining it and i decided to fill in some of the gaps. Thanks for the
pointer though

~~~
cursive
I am John Postlethwait. You could have submitted a PR. That's when/how open
source works. I even state that I am happy to look at incoming changes, I'm
just not actively maintaining it.

This is a very minor, nigh silly, project but this sort of wanton bifurcation
hurts open source's reputation and is already a huge problem in the Node
community.

~~~
jmiserez
While I agree in general that PRs are better than forks, I don't think what
you're saying is totally fair. Your choice of licensing explicitely allows
forks (and almost anything else) to happen. There have been many discussions
on the topic [1], and there is no easy solution.

Then, your choice of words is not ideal:

> _NOTE: I no longer actively maintain this package. I 'd love to get PRs to
> keep it going though!_

If it's not maintained anymore then I as a developer don't really gain
anything (bugfixes, features) by submitting a PR vs. just forking myself. So
the choice to fork is understandable, even if it's not what you intended to
happen.

[1] [https://arstechnica.com/information-
technology/2014/10/how-d...](https://arstechnica.com/information-
technology/2014/10/how-do-you-avoid-being-forked-into-oblivion/)

~~~
jacquesm
The name on the license was changed I think that totally justifies the remarks
made and they were made extremely courteous given the situation.

Forking is fine, merging two packages is fine, removing the authors name from
the license (while leaving his name all over the rest of the package, which
shows that there is no malicious intent, merely some confusion) is not.

------
Ruud-v-A
Or you could just run `git grep --line-number TODO`.

~~~
ahmadassaf
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 :)

~~~
onion2k
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?

~~~
cryptarch
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.

~~~
StavrosK
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.

~~~
cryptarch
You can easily get the colors and fancy UTF chars with an xargs | printf so a
Bash/sh script should do fine.

------
thedjinn
For those not working with JavaScript here's the same thing made with 40 lines
of Ruby and no external dependencies.

[https://gist.github.com/thedjinn/17c68d1e62b5594581625c016b0...](https://gist.github.com/thedjinn/17c68d1e62b5594581625c016b00e42a)

~~~
ahmadassaf
nice ! would be nice as well if you can pass exclusion rules for files,
extensions and directories

------
tedmiston
Would be awesome if you could hit return on an issue in the list and navigate
to it in your editor.

This would be pretty trivial with the Sublime CLI, for example in Python:

    
    
        import os
        os.system('subl foo.py:10')

------
buckhx
Anyone know of a vim plugin that has similar functionality?

~~~
glabsounet
Isn't a script and the _:cexpr_ command enough?

~~~
kevincox
Or just :grep?

------
Nition
Visual Studio also has this. View -> Task List.

~~~
seanp2k2
Pycharm and IIRC all of the IntelliJ-based IDEs also have this built in
[https://blog.jetbrains.com/pycharm/2013/06/working-with-
todo...](https://blog.jetbrains.com/pycharm/2013/06/working-with-todo-in-
pycharm/)

------
smarx007
How can I report issues? The tool tries to scan PNG files in the repo as well
the .git folder of the repo as well.

~~~
ahmadassaf
you can report issues in the github repo. However, if you want to ignore files
and folders you need to pass those patterns to the function. For example, you
want to exclude .git and .png then you need to run the command:

    
    
        notes -x *.git/ -x *.png
    

in general if you want to exclude hidden files and folders you need to run it
with -h true which excludes hidden dirs and files, so you can run

    
    
        notes -h true -x *.png

~~~
Retr0spectrum
Type \\* to get *.

~~~
ahmadassaf
ah sweet ! thanks will update now

------
maaaats
Would having a git push hook that checks for remaining/added todos with this
be a good idea?

~~~
pryelluw
Build it! Ill test it. :)

~~~
ahmadassaf
cool ! let me know what you think

~~~
pryelluw
Email in my profile

------
midgetjones
If you're using Rails, you can do `rake notes`

------
willemmali
sh-based alternative and shameless plug:

[https://gitlab.com/willemmali-sh/todo](https://gitlab.com/willemmali-sh/todo)

Fresh off the press, please let me know if you have feature requests or find
bugs.

Edit: is my tone off-putting or did I break some social norm here?

~~~
ahmadassaf
great stuff .. will try it out now and let you know

~~~
willemmali
Cool, hope it's useful to you :)

------
andrepd
Great. A 100-line python or perl (or even bash) script instead requires the
whole machinery of node.js to work. Brave new world.

~~~
cryptarch
I'm writing an `sh`-based version, should take about 20 minutes minus the
fluff.

~~~
kaushalmodi
Please share when done.

~~~
cryptarch
I'm starting writing now, was already too late to start last night.

~~~
kaushalmodi
Thanks! Will give it a shot.

~~~
cryptarch
Cool, hope it works well for you :)

If not, I'd greatly appreciate some feedback, I'm newish to sh programming and
CLI design in general.

