MCPcopy Create free account
hub / github.com/FastLED/FastLED / get

Method get

ci/iwyu_cache.py:127–155  ·  view source on GitHub ↗

Look up cached IWYU result for a file. Args: file_path: Source file path. compiler_args_key: Compiler args fingerprint. Returns: List of removal strings if cached (empty list = clean), or None on cache miss.

(self, file_path: Path, compiler_args_key: str)

Source from the content-addressed store, hash-verified

125 pass # Non-fatal
126
127 def get(self, file_path: Path, compiler_args_key: str) -> list[str] | None:
128 """Look up cached IWYU result for a file.
129
130 Args:
131 file_path: Source file path.
132 compiler_args_key: Compiler args fingerprint.
133
134 Returns:
135 List of removal strings if cached (empty list = clean),
136 or None on cache miss.
137 """
138 if not self._enabled:
139 self._misses += 1
140 return None
141
142 file_hash = _compute_file_hash(
143 file_path, compiler_args_key, self._source_tree_hash
144 )
145 key = str(file_path)
146
147 entry = self._data.get(key)
148 if entry is not None and entry.get("hash") == file_hash:
149 removals = entry.get("removals")
150 if isinstance(removals, list):
151 self._hits += 1
152 return removals
153
154 self._misses += 1
155 return None
156
157 def put(self, file_path: Path, compiler_args_key: str, removals: list[str]) -> None:
158 """Store IWYU result for a file.

Callers 15

setup_eslintFunction · 0.45
mainFunction · 0.45
run_testsFunction · 0.45
parse_argsFunction · 0.45
run_autoresearch_loopFunction · 0.45
run_testMethod · 0.45
get_driversMethod · 0.45
needs_rebuildFunction · 0.45
_env_default_max_bytesFunction · 0.45

Calls 1

_compute_file_hashFunction · 0.85

Tested by 15

mainFunction · 0.36
run_testsFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
test_cachedFunction · 0.36
test_concurrent_checksFunction · 0.36
mainFunction · 0.36
send_rpcFunction · 0.36