News for hackers. Stuff that matters.
Re:Show HN: Summarise all code annotation like TODO or FIXME by ahmadassaf on Sunday February 26, 2017 @02:13PM (#13739121)
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
Re:Show HN: Summarise all code annotation like TODO or FIXME by StreakyCobra on Sunday February 26, 2017 @02:48PM (#13739372)
It would be so much nicer to define better defaults. Like what… 99.99% of the users are never, ever, wanting to see notes that are in the `.git` repository, nor in PNG or any other images. Even hidden dirs and files should not be searched by default I think. All this will cause nightmares to users before they start using it, like the first-poster of this thread had. Provide better defaults, make it vcs-aware (ignored files, etc…) and you will have a much more appreciated product!

It is for the same reason that `rg`/`ag`/`pt` are used nowadays instead of `grep`. 99.99% of the time, you don't want to search files that are ignored by your VCS, and you want to search recursively, and also probably in a case-insensitive way. For `grep` you have to fight with tons of options to filter out files, to enable recursivity and to ignore case. With `ag`? just `ag whatever`.

Defaults make the difference.

Re:Show HN: Summarise all code annotation like TODO or FIXME by ahmadassaf on Sunday February 26, 2017 @03:16PM (#13739560)
i actually ignore a bunch of file extensions

   const BAD_EXTENSIONS = ["!*.jpg", "!*.jpeg", "!*.mov", "!*.mp3", "!*.gif", "!*.png", "!*.log", "!*.bin", "!*.psd", "!*.swf", "!*.fla", "!*.ico"];
I was wondering why `.png` was scanned. However, your comment makes so much sense and it will be wise to add default folders like .git as well

Thanks a lot for that, ill be looking forward to what defaults people also want to have :)

Re:Show HN: Summarise all code annotation like TODO or FIXME by StreakyCobra on Sunday February 26, 2017 @04:15PM (#13739910)
Glad to hear my comment inspired you :-) Good luck with this!

PS: Another idea: Instead of selecting manually what extensions should be used or not, you may want to try being more general, like enabling by default all text-like files, and disabling all data-like files. Maybe with `file --mime` then looking at charset value:

    test.jpg: image/jpeg; charset=binary
    manage.py: text/x-python; charset=us-ascii
Re:Show HN: Summarise all code annotation like TODO or FIXME by wjdp on Sunday February 26, 2017 @03:24PM (#13739611)
There should be the option for an include pattern. I wanted to only check *.py files, this is very cumbersome to do with only excludes.
Re:Show HN: Summarise all code annotation like TODO or FIXME by ahmadassaf on Sunday February 26, 2017 @05:04PM (#13740238)
just realised a fix where you can now:

   notes -i *.py
I hope this helps :)
Re:Show HN: Summarise all code annotation like TODO or FIXME by wjdp on Sunday February 26, 2017 @05:14PM (#13740304)
Fab, cheers
Re:Show HN: Summarise all code annotation like TODO or FIXME by ahmadassaf on Sunday February 26, 2017 @03:37PM (#13739701)
interesting .. will try and fix that.

Thanks for the pointer

Re:Show HN: Summarise all code annotation like TODO or FIXME by kirubakaran on Sunday February 26, 2017 @02:55PM (#13739422)
If you prefix those lines with 4 spaces, it will be interpreted as code, instead of the asterisk being interpreted as <strong>

Example:

   rm -rf *
Re:Show HN: Summarise all code annotation like TODO or FIXME by smarx007 on Sunday February 26, 2017 @05:58PM (#13740508)
Well, you've disabled issues on the repo, that's why I ask.
Re:Show HN: Summarise all code annotation like TODO or FIXME by ahmadassaf on Monday February 27, 2017 @07:41AM (#13743768)
my bad .. did not know they were disabled
Re:Show HN: Summarise all code annotation like TODO or FIXME by Retr0spectrum on Sunday February 26, 2017 @02:34PM (#13739270)
Type \* to get *.
Re:Show HN: Summarise all code annotation like TODO or FIXME by ahmadassaf on Sunday February 26, 2017 @02:41PM (#13739327)
ah sweet ! thanks will update now
Re:Show HN: Summarise all code annotation like TODO or FIXME by ahmadassaf on Sunday February 26, 2017 @02:44PM (#13739346)
still not luck with me .. weird