fat / smoosh

something like a himalountain.
342 stars 21 forks source link

Enable jshint to be skipped on individual files #11

Closed tauren closed 13 years ago

tauren commented 13 years ago

This commit makes it possible to skip jshint processing on individual files. Simply put a bang (!) before the filepath to exclude that file from jshint.

For example, the following setting will run script.js through jshint, but it will not run header.js through jshint.

"base": [ "!./src/header.js", "./src/script.js" ],

All other processing continues to take place on all files.

fat commented 13 years ago

hm... i'm not crazy about the "!" syntax. I'd rather it be something like:

"base": [ { src: "./src/header.js", jshint: false }, "./src/script.js" ],
tauren commented 13 years ago

@fat -- I agree and almost went that route. I'll look into what it would take to refactor things to work that way.

tauren commented 13 years ago

Now it works just like you specified. The bang (!) method is no longer included and a sourcePath object must be specified with src and jshint=false attributes if jshint is to be skipped.

fat commented 13 years ago

also - you sir are a gentleman and a scholar! Thank you very much for all the work

tauren commented 13 years ago

@fat -- there you go! Let me know when you pull it in and publish a new version in npm. I'm currently using npm link with smoosh and want to remove it. Thanks!

tauren commented 13 years ago

Jumped the gun and didn't test it completely. The change you suggested doesn't work, so I switched it back. Let me know if you have a better suggestion.

fat commented 13 years ago

OH yep. my bad -- it should be:

return typeof name != 'string' && !name.jshint;
tauren commented 13 years ago

Yep, that works. Duh, I should have figured that out, but all my brainpower was elsewhere today.

tauren commented 13 years ago

@fat: could you release this new version on npm?

fat commented 13 years ago

just published!