[GRADLE-3291] Discrepancy in handling `source` between Checkstyle and FindBugs Created: 24/Apr/15  Updated: 24/Jan/17  Resolved: 24/Jan/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Sterling Greene Assignee: Unassigned
Resolution: Won't Fix Votes: 0


 Description   

https://discuss.gradle.org/t/discrepancy-in-handling-source-between-checkstyle-and-findbugs/9318

I have the following:

checkstyle

{ sourceSets = [ subProject.sourceSets.main ] configFile = rootProject.file( 'shared/config/checkstyle/checkstyle.xml' ) showViolations = false ignoreFailures = true }

// exclude generated java sources - by explicitly setting the base source dir
checkstyleMain.source = 'src/main/java'

findbugs

{ sourceSets = [ subProject.sourceSets.main, subProject.sourceSets.test ] ignoreFailures = true toolVersion = '3.0.1' // for now we need to set this to low so that FindBugs will actually report the DM_CONVERT_CASE warning we care about reportLevel = 'low' }

// exclude generated java sources - by explicitly setting the base source dir
findbugsMain.source = 'src/main/java'

// because cfg package is a mess mainly from annotation stuff
checkstyleMain.exclude '*/org/hibernate/cfg/*'
checkstyleMain.exclude '*/org/hibernate/cfg/'
findbugsMain.exclude '*/org/hibernate/cfg/*'
findbugsMain.exclude '*/org/hibernate/cfg/'
The checkstyleMain task does in fact only process the src/main/java dir. findbugsMain, however, processes every source directory in the main SourceSet.



 Comments   
Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Steve Ebersole [ 15/Nov/16 ]

AFAIK this is still an issue and would be nice to have some consistency. So I think it is worthwhile to move. However, if I may make a suggestion... Gradle Jira has a lot of issues that really just sit "forever". If this is something the Gradle team is simply not going to do, I'd personally suggest to just close it. For example just today I got notified of 27 issues, most of which I had completely forgotten about because they have just sat for so long.

Comment by Benjamin Muschko [ 24/Jan/17 ]

The main reason for the difference in behavior is that Checkstyle looks at sources but FindBugs looks at class files. To be honest I can't see this work being prioritized anytime soon. I am going to close it. In case this comes up again then it can be handled on GitHub.

Generated at Wed Jun 30 12:44:58 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.