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 }
For files that I can't load from WebJars, I typically commit them to my
assets/javascripts/vendordirectory. 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:
This doesn't work, since the filtering appears to work on file names rather than full paths.
The only thing that seems to work is providing a pattern filter for
excludeFilterthat 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.