Remove annotations from related files regardless of exclude_* options#343
Remove annotations from related files regardless of exclude_* options#343jeduardo824 wants to merge 1 commit into
Conversation
When a related file type is excluded (e.g. `exclude_tests: true`), `annotaterb models --delete` skipped those files, leaving previously written annotations orphaned with no built-in way to clean them up. ProjectAnnotationRemover reuses RelatedFilesListBuilder, which gates each related type on the `exclude_*` options for both annotation and removal. Add a `for_removal:` flag (default false) that bypasses those guards so removal reaches every related file; the annotate path is unchanged. Removing an annotation from a file that has none is a no-op. Refs drwl#340 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
OdenTakashi
left a comment
There was a problem hiding this comment.
Thanks for fixing this. Looks great to me!
However, as I mentioned in issue #340, there is a possibility that a certain usage pattern may no longer work after this change, so I’d like @drwl to take a look at that point.
That said, I don’t think that usage pattern is actually intended, so I’m personally fine with merging this as-is.
|
I do think it's an issue. Between this and the other issues, I'm thinking that an approach forward would be to add another option to 'delete all' annotations regardless of any inclusions/exclusions. Thoughts? @jeduardo824 @OdenTakashi |
|
@drwl @jeduardo824 My earlier approval focused on fixing #340, but on reflection, making What do you think, @jeduardo824? |
When a related file type is excluded (e.g.
exclude_tests: true),annotaterb models --deleteskipped those files, leaving previously written annotations orphaned with no built-in way to clean them up.ProjectAnnotationRemover reuses RelatedFilesListBuilder, which gates each related type on the
exclude_*options for both annotation and removal. Add afor_removal:flag (default false) that bypasses those guards so removal reaches every related file; the annotate path is unchanged. Removing an annotation from a file that has none is a no-op.Refs #340