grunt-search 0.1.4

Posted on Mar 9, 2014 in grunt-search, Open Source Projects | 0 comments

grunt-search 0.1.4 has just been released. It’s a Grunt plugin that searches a list of files for particular search strings and logs the results in JSON, XML or text format – or just output to the console.

This new version contains a contribution from Sergeii Iavorsky, to allow for generating the results in JUnit format as well. Thanks, Sergeii!

Read More

grunt-search

Posted on Dec 13, 2013 in Blog, grunt-search, Open Source Projects | 0 comments

I just released my very first Grunt plugin – and npm package – that searches a codebase and logs the findings.

Errr… what’s Grunt?

Grunt is the best thing since… you name it. It’s a build tool that allows web developers to run whatever “grunt” tasks they need, like minifying JS or CSS, Sass generation, file bundling, file renaming, moving, etc. etc. Basically it’s a one-stop shop for all those nagging things you need to do when deploying a site. I’ve been using it for various recent personal projects (generatedata.com, birdsearch.org) and for my day job. But one particular piece of functionality I found I couldn’t do, was a simple search-and-log.

grunt-search

There are a bunch of search-and-replace Grunt plugins out there, but for my job at the CBC, we needed something simpler for logging purposes only. We wanted to run various tests on our codebase to look for certain things: inline styles, inline event handlers, old, unwanted HTML tags, etc. None of these weren’t significant enough to warrant failing the build, but they do give a clue as the health of the codebase.

So basically, we run this function along with jshint in our dev environments to warn us about the accumulation of crap.

It’s fairly well documented, and can be downloaded via npm:
https://npmjs.org/package/grunt-search

The source code is all found on github:
http://github.com/benkeen/grunt-search

Enjoy!

Read More