fix: support column with Unicode comment#911
Open
ota42y wants to merge 2 commits intoctran:developfrom
Open
Conversation
bcebad0 to
a2a5041
Compare
ctran
approved these changes
Feb 3, 2022
Owner
ctran
left a comment
There was a problem hiding this comment.
LGTM. I'm not sure why the "ci" build didn't get triggered?
8a73b95 to
518badc
Compare
When we crete column with unicode comment, annotate gem does not update that annotation. `\w` means a word character([a-zA-Z0-9_]) and it does not match unicode leteers. https://docs.ruby-lang.org/en/3.0.0/Regexp.html Now `column_pattern` in `annotante_one_file` support ascii characters only and doesn't match column with unicode comment. So the columns will disappear from `old_columns` and `new_columns`. https://github.com/ctran/annotate_models/blob/786394947c041f781df2ee0ea003e09452fa9dba/lib/annotate/annotate_models.rb#L378-L380 Even if we change that column (i.e. nullable to not null), annotate_one_file's check ignore that column so annotation doesn't update. (The first time create it, it works, and the column annotation is left out of date) So I fix column_pattern support unicode letter. Signed-off-by: ota42y <ota42y@gmail.com>
Signed-off-by: ota42y <ota42y@gmail.com>
518badc to
a96e20c
Compare
Author
|
I fixed rubocop warning and these test failed occurred in develop branch so I think this change is no problem. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When we crete column with Unicode comment, annotate gem does not update that annotation.
\wmeans a word character([a-zA-Z0-9_]) and it does not match Unicode leteers.https://docs.ruby-lang.org/en/3.0.0/Regexp.html
Now
column_patterninannotante_one_filesupportascii characters only and doesn't match column with unicode comment.
So the columns will disappear from
old_columnsandnew_columns.annotate_models/lib/annotate/annotate_models.rb
Lines 378 to 380 in 7863949
Even if we change that column (i.e. nullable to not null),
annotate_one_file's check ignore that column so annotation doesn't update.
(The first time create it, it works, and the column annotation is left out of date)
So I fix
column_patternsupport Unicode letter.