AnalyzeImpact checks which changed files are imported by other files Uses ast-grep to extract actual imports for accuracy
(root string, changedFiles []FileInfo)
| 163 | // AnalyzeImpact checks which changed files are imported by other files |
| 164 | // Uses ast-grep to extract actual imports for accuracy |
| 165 | func AnalyzeImpact(root string, changedFiles []FileInfo) []ImpactInfo { |
| 166 | if len(changedFiles) == 0 { |
| 167 | return nil |
| 168 | } |
| 169 | |
| 170 | // Scan all files to get their imports using ast-grep |
| 171 | analyses, err := ScanForDeps(root) |
| 172 | if err != nil { |
| 173 | return nil |
| 174 | } |
| 175 | return AnalyzeImpactFromAnalyses(changedFiles, analyses) |
| 176 | } |
| 177 | |
| 178 | // AnalyzeImpactFromAnalyses computes impact using a pre-computed ast-grep scan, |
| 179 | // so callers that already hold the analyses can avoid a redundant full-repo |