Skip to content

Commit

Permalink
Disable unused import analysis for files retained with `--retain-file…
Browse files Browse the repository at this point in the history
…s`. Closes #748
  • Loading branch information
ileitch committed May 25, 2024
1 parent f18d0ac commit 00391e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

##### Bug Fixes

- None.
- Disable unused import analysis for files retained with `--retain-files`.

## 2.19.0 (2024-05-20)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ final class UnusedImportMarker: SourceGraphMutator {

// For each source file, determine whether its imports are unused.
for (file, referencedModules) in referencedModulesByFile {
// Ignore retained files.
if configuration.retainFilesMatchers.anyMatch(filename: file.path.string) {
continue
}

let unreferencedImports = file.importStatements
.filter {
// Only consider modules that have been indexed as we need to see which modules
Expand Down

0 comments on commit 00391e6

Please sign in to comment.