Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[doc] How to configure "-cache <path>" #1394
Affects PMD Version: 6.8.0
I want to use the incremental analysis of the PMD. I looked up the document and it says use -cache to specify a location for the analysis cache file to use.But when I use the '-cache' argument within CLI, I just can't set the right parameter. It seems like I have trouble in generating the cache file at the first running , I do it like "-cache /path" which '/path' is the directory where I want to store the cache file. But I got the Error says"Could not load analysis cache from file. /***/*** (Is a directory)" . Then I set the path as an empty file like '.../cache' , and I got "Cache file a is malformed, will not be used for current analysis" . It seems like I can't generate the cache file at the first time . This may be an simple question but I am new for PMD and I didn't find the right way to do this on Internet. So I would be appreciated if you can help me with this.
Code Sample demonstrating the issue:
Running PMD through: [CLI]
The way I see it:
On your end, could you please confirm that the cache has been created when a file was provided, and that following executions can use it?
Hi @xyf0921 , thanks for testing! Could you also check, whether an error is displayed, if the file doesn't exist yet? That is the most common case for the first run.
I think, you've already checked the first case. If the second case is, like I've described it, then we don't have a bug here.
The only thing left would be improving the documentation here: https://pmd.github.io/pmd-6.8.0/pmd_userdocs_incremental_analysis.html and https://pmd.github.io/pmd-6.8.0/pmd_userdocs_cli_reference.html#options
Thanks for checking.
I guess, we should log out instead of "Analysis cache invalided..." just something like "Creating new analysis cache file..." (and do this only once, not for both rulesets and classpath changes).
And update the documentation to clearly state, that this is a file, that and when it is being created, when it is being invalidated (malformed, ruleset and/or classpath changes).