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

I suggest that ruff should update the code for detecting ambiguous unicode characters with following VSCode's code. #4268

Closed
yuji38kwmt opened this issue May 7, 2023 · 1 comment · Fixed by #4274
Labels
configuration Related to settings and configuration

Comments

@yuji38kwmt
Copy link

Python code

sample.py

# HIRAGANA LETTER
"""
あいうえお
かきくけこ
さしすせそ
たちつてと
なにぬねの
はひふへほ
まみむめも
やゆよ
らりるれろ
わゐゑを

"""

# KATAKANA LETTER
"""
アイウエオ
カキクケコ
サシスセソ
タチツテト
ナニヌネノ
ハヒフヘホ
マミムメモ
ヤユヨ
ラリルレロ
ワヰヱヲ

"""

Command

$ ruff check sample.py --select RUF
sample.py:22:5: RUF001 [*] String contains ambiguous unicode character `ノ` (did you mean `/`?)
Found 1 error.
[*] 1 potentially fixable with the --fix option.

Issue

The above python code contains all HIRAGANA and KATAKANA LETTERS, but Ruff only identifies ノ (Katakana Letter No) as an ambiguous unicode character.

Ruff's code for detecting ambiguous Unicode characters was ported from VSCode's code, but this code was modified in 2021. In March 2023, VSCode fixed the code. Therefore, I suggest that Ruff should update its code for detecting ambiguous Unicode characters.

Settings

no pyproject.toml

Version

$ ruff --version
ruff 0.0.264

@charliermarsh charliermarsh added the configuration Related to settings and configuration label May 7, 2023
@charliermarsh
Copy link
Member

Nice, we'll pull in this update, thanks.

akx added a commit to akx/ruff that referenced this issue May 8, 2023
akx added a commit to akx/ruff that referenced this issue May 8, 2023
akx added a commit to akx/ruff that referenced this issue May 8, 2023
akx added a commit to akx/ruff that referenced this issue May 8, 2023
akx added a commit to akx/ruff that referenced this issue May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Related to settings and configuration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants