Hacker News new | ask | show | jobs
by pgilad 4038 days ago
Thanks for the comments. Regarding simple `ag` or `grep` usages: Yeah, that will definitely be faster (as with git grep). The problem arises when you have false positives due to either strings, variable names or other things (perhaps template or pattern matches). Then you will need extremely good regex (which leasot implements) or be really good with filtering the results.

Now what happens when you want the output in different formats? I had a person contacting me for exporting as xml since he wants to plug it in for a CI (jenkins). What if you want a JSON for your own tool?

Leasot is far from the perfect solution to TODOs, but if your use case requires anything other than simple regex, you will run into the same issues that Leasot tries to solve.

As far as speed, in my work project, parsing 552 javascript files takes around 0.2s on my mac. Some of these files being really big.

1 comments

Outputting the data in your own format is actually remarkably simple from the command line - you could build up a complete JSON document by piping the input through `jq`. XML might be a bit harder, but with a bit of find and replace across a template (or by using xmllint), you can create pretty much any document you'd like.

In short, a cool tool, which I hope you had fun creating to fill your needs, but it's not something I could personally justify using at the moment. My lint tools (for Python) and `godoc` already alert me to "XXX" and "TODO" comments, letting me see them as part of my normal programming flow.

I wouldn't expend too much effort trying to convince others of it's utility - you'll get frustrated. Instead, let the tool's utility speak for itself (if its useful to you, it will also be useful to someone else), and move on and create more useful tools.