File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ Next release
1010
1111- Improve copyright detection for statements with parens or trailing "authors"
1212
13- - Add experimental option for using cached results during scan time.
13+ - Add experimental option for using cached results during scan time. When the
14+ ``--use-cached-results `` option is enabled in the ScanCode CLI, during scan
15+ time for a given Resource, we iterate through the active scanners and see if we
16+ have cached results for those already. If we do, we update our results with the
17+ cached data. If not, we add those scanners to a list of scanners to be run.
18+ After scanning, the cache is updated.
1419
1520v33.0.0rc1 - 2026-05-14
1621------------------------
Original file line number Diff line number Diff line change 1616from scancode_config import results_cache_dir
1717
1818
19+ """
20+ This module provides functions for the storage, retrieval, and organization of
21+ cached ScanCode scanner results.
22+
23+ The cache is stored in the ScanCode .cache directory. Depending on the setup,
24+ this could either be in the .cache directory in the user's home folder for a
25+ particular ScanCode version (in the case of running a ScanCode release) or in
26+ the .cache directory in the ScanCode directory (in the case of running a
27+ ScanCode git checkout).
28+
29+ In the .cache directory, the scanner results for a given Resource is stored in a
30+ directory whose path is created from the sha256 hexdigest of the Resource's
31+ content and its filename. Inside the results directory are JSON files with the
32+ name of scanners (license, copyright, etc.) and inside are the cached results.
33+
34+ When the --use-cached-results option is enabled in the ScanCode CLI, during scan
35+ time for a given Resource, we iterate through the active scanners and see if we
36+ have cached results for those already. If we do, we update our results with the
37+ cached data. If not, we add those scanners to a list of scanners to be run.
38+ After scanning, the cache is updated.
39+ """
40+
1941def hasher_from_chunks (chunks ):
2042 """
2143 Return a sha256 hasher loaded with `chunks`.
You can’t perform that action at this time.
0 commit comments