Skip to content

Commit

Permalink
Enable RUF001 to lint confusable characters (#13788)
Browse files Browse the repository at this point in the history
Characters which look the same but have different underlying codes (homographs)
are problematic. Enable Ruff's "confusable" character linter to prevent new
code from accidentally including them.

Allow small sigma because of its use in statistics.
  • Loading branch information
covracer committed Apr 1, 2024
1 parent d9a2f7a commit e380566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ exclude_lines = [
]

[tool.ruff]
allowed-confusables = ["σ"]
exclude = [
".git",
'node_modules',
Expand Down Expand Up @@ -166,7 +167,6 @@ ignore = [
'E731', # Do not assign a lambda expression, use a def
'E741', # Ambiguous variable name: I
'UP035', # Import from `collections.abc` instead: `Iterator`
'RUF001', # String contains ambiguous unicode character `σ` (did you mean `o`?)
'RUF012', # Mutable class attributes should be annotated with `typing.ClassVar`
'TID252', # Prefer absolute imports over relative imports from parent modules
]
Expand Down

0 comments on commit e380566

Please sign in to comment.