scalastyle / scalastyle-sbt-plugin

scalastyle-sbt-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scalastyleSources setting does not support individual files

scf37 opened this issue · comments

commented

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.

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?

commented

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.