forked from jroper/sbt-jshint-plugin
-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
For files that I can't load from WebJars, I typically commit them to my assets/javascripts/vendor directory. Not all of them will pass jshint's tests, so I'd like to exclude them from being linted.
I've tried a couple of approaches:
excludeFilter in (Assets, JshintKeys.jshint) := GlobFilter("*/vendor/*")
This doesn't work, since the filtering appears to work on file names rather than full paths.
managedSourceDirectories in (Assets, JshintKeys.jshint) := List((sourceDirectory in Compile).value / "assets" / "javascripts" / "vendor")
The only thing that seems to work is providing a pattern filter for excludeFilter that explicitly enumerates the files contained in the vendor directory, but this is ugly and doesn't scale well.
Is there a better option available?
Edit: Researching sbt's file filters further, I came up with the following. Not pretty, but I guess it gets the job done.
excludeFilter in (Assets, JshintKeys.jshint) := new FileFilter{ def accept(f: File) = ".*/vendor/.*".r.pattern.matcher(f.getAbsolutePath).matches }
Metadata
Metadata
Assignees
Labels
No labels