Skip to content

Comments by multi-byte characters are ignored #836

Open
@a-suenami

Description

@a-suenami

Hi, everyone. So thank you for great product.

I occurred in trouble and want to hear everyone's opinion.

I'm Japanese developer so often add some comment for each database column in Japanese.

For example:

create_table "users", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci", comment: "ユーザ", force: :cascade do |t|
  t.string "name", null: false, comment: "名前"
  t.string "email", null: false, comment: "メールアドレス"
end

However, they're ignored because they don't match a regular expression which checks diff between old schema and new schema, It's specified here.

If we don't have any problems, I want to fix the problem as follows.

# current
column_pattern = /^#[\t ]+[\w\*\.`]+[\t ]+.+$/

# I expect
column_pattern = /^#[\t ]+[^\t ]+[\t ]+.+$/

What do you think?

Commands

$ bundle exec annotate
Model files unchanged.

Version

  • annotate version
    • 3.1.1
  • rails version
    • 6.0.3.2
  • ruby version
    • 2.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions