Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation fails for columns with comments #946

Open
Tianyi6679 opened this issue Apr 8, 2022 · 0 comments
Open

Annotation fails for columns with comments #946

Tianyi6679 opened this issue Apr 8, 2022 · 0 comments

Comments

@Tianyi6679
Copy link

Tianyi6679 commented Apr 8, 2022

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
drwl added a commit to drwl/annotaterb that referenced this issue May 18, 2023
* Extracts `AnnotationDiffGenerator` out of `FileAnnotator`
* Updates the column pattern regex based on
ctran/annotate_models#946
* Adds some tests for `FileAnnotator`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant