Store IWYU result for a file. Args: file_path: Source file path. compiler_args_key: Compiler args fingerprint. removals: List of removal strings (empty = clean).
(self, file_path: Path, compiler_args_key: str, removals: list[str])
| 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. |
| 159 | |
| 160 | Args: |
| 161 | file_path: Source file path. |
| 162 | compiler_args_key: Compiler args fingerprint. |
| 163 | removals: List of removal strings (empty = clean). |
| 164 | """ |
| 165 | if not self._enabled: |
| 166 | return |
| 167 | |
| 168 | file_hash = _compute_file_hash( |
| 169 | file_path, compiler_args_key, self._source_tree_hash |
| 170 | ) |
| 171 | self._data[str(file_path)] = { |
| 172 | "hash": file_hash, |
| 173 | "removals": removals, |
| 174 | "timestamp": time.time(), |
| 175 | } |
| 176 | |
| 177 | def save(self) -> None: |
| 178 | """Flush cache to disk. Call after all updates.""" |