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

Missing cache file invalidation when suppressionsLocation file is modified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0
    • None
    • None
    • None

    Description

      I came across some buggy behavior with suppressions file and the cache file.

      Steps to reproduce:
      1. Have code with violations.
      2. Run checkstyle:check.
      3. Add a suppressions file (with suppressionsLocation) that suppress the violations.
      4. Re-run checkstyle:check. Violations are suppressed as expected.
      5. Modify suppressions file so that the violations are no longer suppressed.
      6. Re-run checkstyle:check. No violations, even though they shouldn't be suppressed.

      Work-arounds:

      • Disable the use of cache file.
      • Include the suppressions file from the config file instead of with suppressionsLocation in the plugin config.

      Is this a known issue?
      Is this by design?
      For performance reasons you might not want to wipe the cache file when the suppression file is modified (but AFAICT that's what Checkstyle does when a suppressions file is included via the config).

      On the other hand, this bit me because I modified a regexp in the suppression file so that it accidentally no longer suppressed what it was supposed to suppress.
      Since I didn't get any violations I thought it still worked. But when the cache file got reset the violations came back.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Snago Robin Karlsson
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: