arturobernalg opened a new pull request, #732:
URL: https://github.com/apache/maven-checkstyle-plugin/pull/732

   Fixes #284.
   
   `DefaultCheckstyleExecutor` pre-parsed the `suppressionsLocation` file into 
a plain `FilterSet` and added it to the `Checker` directly. A `FilterSet` does 
not implement Checkstyle's `ExternalResourceHolder`, so `Checker.process()` 
never discovered the suppressions file as an external resource to hash - edits 
to it never changed the cache key, so a cached run kept reporting whatever 
suppression result it had the first time, even after the suppressions file 
changed to no longer suppress a violation.
   
   Declaring suppressions through the checker configuration (a `<module 
name="SuppressionFilter">` with a `file` property) already worked, because that 
module does implement `ExternalResourceHolder`. This builds the exact same 
`SuppressionFilter` module and configures it the way Checkstyle itself would 
from that declaration, instead of pre-loading the suppressions into a 
`FilterSet`, so the plugin's `suppressionsLocation` parameter gets the same 
cache behavior.
   
   Added an integration test (`MCHECKSTYLE-372-suppressions-cache`) that runs 
`checkstyle:check` once with a suppressions file that suppresses a violation, 
then rebuilds (no clean, same cache) with a suppressions file that doesn't - 
confirmed it passed wrongly with the old code and now fails as expected.
   
   Full test suite, checkstyle, spotless and rat pass locally.
   
   ---
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](https://www.apache.org/licenses/LICENSE-2.0)
   check one of the following:
   
   - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
   - [x] I hereby declare that I have filed an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to