Ignoring Minified Javascript Files with Ack 2

90 views
Skip to first unread message

Rob Hoelz

unread,
Jun 21, 2012, 1:15:56 PM6/21/12
to ack-...@googlegroups.com
Hey guys,

Someone at work asked me how to tell ack 2 to ignore minified Javascript files, and I replied "Well, it only works for .min.js...".  Then I realized you can ignore them by the file's content
as well! (pretty much)  I wrote a blog post about it for anyone who's interested:

http://hoelz.ro/blog/ignoring-minified-javascript-files-with-ack-2

-Rob

Andy Lester

unread,
Jun 21, 2012, 1:20:19 PM6/21/12
to ack-...@googlegroups.com

On Jun 21, 2012, at 12:15 PM, Rob Hoelz wrote:

as well! (pretty much)  I wrote a blog post about it for anyone who's interested:

http://hoelz.ro/blog/ignoring-minified-javascript-files-with-ack-2

I'm almost wondering if we should do --ignore-file=firstlinematch:/.{200}/ by default.

xoa

Rob Hoelz

unread,
Jun 21, 2012, 8:26:47 PM6/21/12
to ack-...@googlegroups.com, an...@petdance.com
I was considering adding it, but I think it might slow things down a
bit. I'm adding an issue for it now for 2.0 final, though.
signature.asc

Ryan Perry

unread,
Jun 22, 2012, 5:24:43 PM6/22/12
to ack-...@googlegroups.com, an...@petdance.com
Rob, I might suggest it look at the LAST line vs the first.  Often minified JS does not end with a newline and it would probably help the copyright/commenting issue.

Reply all
Reply to author
Forward
0 new messages