Skip to content

PLE2502 documentation does not match the implementation #14346

@dscorbett

Description

@dscorbett

The documentation for bidirectional-unicode (PLE2502) says it checks for “bidirectional unicode characters”. That phrasing is imprecise (a string can be bidirectional but any given character isn’t) but the example code implies it means “right-to-left characters”. However, PLE2502 only checks for a selection of bidi control characters. Not all bidi control characters are right-to-left, and most right-to-left characters are ignored by the rule.

The documentation includes this example:

s = "א" * 100  #  "א" is assigned
print(s)  # prints a 100-character string

However, there is no violation of PLE2502 in that example.

$ ruff --version
ruff 0.7.3
$ ruff check --isolated --select PLE2502 ple2502.py
All checks passed!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions