Comments get lost when generating annotations
When there are already comments above a class definition, AnnotateModels deletes them when regenerating annotations.
Here's a short video showing the issue: https://cln.sh/Iw7NsPk7yEfmkyPWtIim
Version
- annotate version: 3.2
- rails version: 5.2.6.2
- ruby version: 2.7.5
running into this as well
It works to add a blank line above the comment before annotating, but you need to find them first (I spotted it accidentally when reviewing a PR).
Yes but obviously nobody remembers to do that on a large team :) On Jul 29, 2022, 8:30 AM -0400, alexeyr-ci1 @.***>, wrote:
It works to add a blank line above the comment before annotating, but you need to find them first (I spotted it accidentally when reviewing a PR). — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Sorry, it's actually worse than I thought. It looked like it worked only because the comment wasn't getting regenerated. If I use --force (or do a schema change which forces a regeneration), then the first time eats the empty line and leaves the comment intact (so really hard to note in code review), and the next time eats the comment 🤣.
Is there a workaround for this?
Hey folks, I believe I was able to solve this bug in my gem https://github.com/drwl/annotaterb/pull/72
I wasn't aware of the fork. I'll definitely check it out. Thanks!