ctran/annotate_models

Annotation fails for columns with comments

Tianyi6679 opened this issue · 0 comments

annotate fails to capture update on columns whose comments are included in the annotation (with_comment: true)

column_pattern = /^#[\t ]+[\w\*\.`]+[\t ]+.+$/
this pattern seems to cause the issue because it cannot capture lines with these characters /[\[\]():]/ in column comments.

Can we include these additional characters to the pattern as they are common and might appear in the column comments?
So maybe something along the lines of

column_pattern = /^#[\t ]+[\w\*\.`\[\]():]+[\t ]+.+$/

Thank you!

Commands

$ bundle exec rake annotate
Model files unchanged.

Version

  • annotate version
    3.1.1
  • rails version
    6.1.4.1
  • ruby version
    2.7.1