scalastyle / scalastyle-sbt-plugin

scalastyle-sbt-plugin
Apache License 2.0
139 stars 52 forks source link

scalastyleSources setting does not support individual files #55

Open scf37 opened 8 years ago

scf37 commented 8 years ago

In theory, files could be excluded using following construct: scalastyleSources := scalastyleSources in dao.value .map(PathFinder.apply _) .reduceLeft[PathFinder]((a, b) => a +++ b) .**("*") .filter( ! _.getAbsolutePath.contains("src/main/scala/my/generated/metadata")).get

but - scalastyle seems to take entire parent directory instead of single file passed in.

matthewfarwell commented 7 years ago

Looking at the code, it should just use the file directly, if it ends with .scala. Can you give me more information on the error please?

scf37 commented 7 years ago

Hi! Good to know it is alive after all those months :-)

I do not remember exactly what the problem is but I think that scalastyle does not work with filenames in scalastyleSources, only directory names. E.g. if you have two .scala files in a directory, you can't ignore one of them using scalastyleSources.