grunt-search has been updated to allow you to search for an array of strings, not just a string or regexp. https://github.com/benkeen/grunt-search
grunt-search 0.1.6
Sergei Z contributed another couple of updates to the JUnit functionality, so I thought I’d include a new “custom” logFormat option, which allows anyone to use the search results in whatever form they want.
grunt-search 0.1.5
New version of grunt-search released. logCondition and scopeMatchToFile options added, courtesy of Sergei Z.
https://www.npmjs.org/package/grunt-search
grunt-search 0.1.4
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!
grunt-search
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!
Recent Comments