Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-153

Checkstyle doesn't run on projects containing only test classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7
    • 2.7
    • None
    • None
    • Patch

    Description

      We discovered that if a project only contains test classes and no "normal" classes, the canGenerateReport() function returns false, as it only checks for the existence of the sourceDirectory path. If includeTestSourceDirectory is set to true, the function should also check for the existence of the testSourceDirectory path.

      Here's an example patch to the method:

      public boolean canGenerateReport()

      { // TODO: would be good to scan the files here return sourceDirectory.exists() || (includeTestSourceDirectory && testSourceDirectory.exists()); }

      Attachments

        Issue Links

          Activity

            People

              dennisl@apache.org Dennis Lundberg
              bmn Bruce Mackenzie Nielsen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: