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
CacheFile: violation on external resource will invalidate entire cache even if no changes are made #4101
When we find a violation in a file on a cache run, we remove the file with the violation from the cachefile.
By default, we put all external resources into the cachefile
However, if we remove an external resource from the cachefile because of a violation, it invalidates the entire cachefile on the next run as they are required to be in the cachefile.
External resources are considered to be changed if they aren't in the cachefile.
Here is how to reproduce:
Step 1: Environment
Step 2: the good run
Please note suppressions file is listed in the cache file and we are running CS on the suppressions file.
Step 3: modify suppressions for a bad run
Step 4: the bad run
Please note suppressions file is NOT listed in the cache file.
As code shows at
Suppressions is a external resource.
If we were checking multiple files in this run, it would act the same as a no cache run.
looks like we have to add "check-resource:" (it will look like protocol) prefix for all internal resources of Checks.
so we will have special processing of "check-resource:" lines.
@rnveach , Will it work ?
@romani that will work as long as any external resource's file name will never be named
Making it start with a specific string like