bolinfest / plovr

plovr: a Closure build tool
78 stars 49 forks source link

Support excluding of warnings via regex pattern #27

Closed rgpower closed 9 years ago

rgpower commented 10 years ago

Dear @bolinfest,

Please accept this re-submit of pull request #20 which includes the code-style fixes you asked for and rebased off your most recent master branch.

Here's the the summary of the feature provided by this pull request:

I believe this will allow a close to Issue 1: Make it possible to suppress warnings from individual JS file.

Example usage

  # plovr.cfg
  {
    "warning-exclude-paths": [
    "^/closure/goog/testing/stacktrace.js",
    "^/closure/goog/iter/iter.js",
    "^/closure/goog/labs/promise/promise.js",
    "^/closure/goog/labs/promise/thenable.js",
    # transitive dependencies seem to resolved more fully...
    ".*?/closure/goog/mochikit/async/deferred.js"
    ],
  }

In the interests of other warning suppression, this branch also updates the Config.getJsContentType method to return application/javascript instead of text/javascript since the latter seems to upset HtmlUnit:

WARNING: Obsolete content type encountered: 'text/javascript'

Many thanks for considering this pull request, and for plovr itself.

Sincerely, Rick Power