etsy / sbt-checkstyle-plugin

SBT Plugin for Running Checkstyle on Java Sources
MIT License
32 stars 25 forks source link

Support remote Checkstyle files #14

Closed josephearl closed 8 years ago

josephearl commented 8 years ago

Fixes #13. Classpath loading TODO - any ideas for finding a file in the class path, I couldn't see anything built into sbt? (dependencyClasspath in Compile).value returnsSeq[Attributed[File]]`

ajsquared commented 8 years ago

Regarding the TODO, resouces in Compile may be what you want. It will give you a Seq[File] listing all the resource files from the build. This wouldn't cover resources files that are contained in one of the dependency JARs though. Something like http://stackoverflow.com/a/29580046/4893584 is the way to get a class loader to load those.

ajsquared commented 8 years ago

This looks good - do you want to add loading the config file from the classpath in this PR or a separate one?

josephearl commented 8 years ago

@ajsquared I will try adding the resources into this PR using the link you just posted

josephearl commented 8 years ago

Updated to support loading from the class path

josephearl commented 8 years ago

I should add a test for the class path functionality that includes a jar as a dependency that has a checkstyle config in and make sure I can access that

josephearl commented 8 years ago

Added test and updated README

josephearl commented 8 years ago

This PR would change checkstyleConfig setting from File to CheckstyleConfig which would break existing clients.

One option is to revert checkstyleConfig to File and expose the new behaviour through checkstyleConfigLocation. If checkstyleConfigLocation is not set then use the checkstyleConfig value.

Another option is to use some major version change to signify the break.

josephearl commented 8 years ago

Added a commit that goes with the first option and exposes the new behaviour through checkstyleConfigLocation.

ajsquared commented 8 years ago

With all the changes you've made I was planning to have a major version release, so I'm okay with having the breaking change. It looks like you've already made a change to keep it compatible though, so that's good too.

ajsquared commented 8 years ago

Thanks again for all your work on these features. These have been great improvements and I really appreciate the time you've spent on them!