Skip to content

全角文字利用時、アラインメントが揃っているのに警告(Layout/ExtraSpacing)が出る #43

@ver-1000000

Description

@ver-1000000

rubocop-0.57.2 環境で(それ以前でも)、以下のような事象が発生します。

# 警告なし
VALID_CONSTANT = [
  ['Japanese is double-byte character set.', '日本語は全角文字です。'],
  ['English is single-byte character set.',  '英語は半角文字です。']
].freeze

# Layout/ExtraSpacing: Unnecessary spacing detected. が発生する
INVALID_CONSTANT = [
  ['日本語は全角文字です。', 'Japanese is double-byte character set.'],
  ['英語は半角文字です。',   'English is single-byte character set.']
].freeze

文字数でカウントしているのか、日本語を利用した場合、スペースによるアラインメントがうまく認識されません。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions