Skip to main content

Incremental scan cache

vulkro-sf antipatterns caches each file's findings, so the next scan only re-runs detectors on files whose source changed.

vulkro-sf antipatterns . # uses ~/.vulkro/sf-antipattern-cache.json
vulkro-sf antipatterns . --cache-dir .vulkro-cache # cache in the workspace (CI)
vulkro-sf antipatterns . --no-cache # full re-scan
SettingFlagVariable
Cache folder (default ~/.vulkro/)--cache-dir <path>VULKRO_SF_CACHE_DIR
Turn the cache off--no-cacheVULKRO_SF_NO_CACHE=1

What invalidates an entry​

Each entry is keyed by the file's SHA-256, the detector version, the --compliance profiles and the project's own namespaces (from sfdx-project.json, --exclude-namespace and .vulkro-sf.yml). Changing any of these re-runs the affected files. A release that changes a detector re-runs every file.

What is cached​

The findings before filtering. So disable in .vulkro-sf.yml and // vulkro: ignore AP-XXX comments are applied on every read: removing either brings the findings back on the next scan without a re-scan.

The cache file is plain JSON. Delete it to force a full re-scan.

In CI​

Keep the cache folder between runs:

- uses: actions/cache@v4
with:
path: .vulkro-cache
key: vulkro-sf-${{ github.run_id }}
restore-keys: vulkro-sf-
- run: vulkro-sf antipatterns . --cache-dir .vulkro-cache --format junit > junit.xml

See also: CI/CD