unicode-literal
What it does
Section titled “What it does”Reports a string with the u prefix.
Why it matters
Section titled “Why it matters”In Python 3 every str is Unicode, so u"text" and "text" are the same. The prefix was needed to bridge Python 2.
To fix, remove the u.
Example
Section titled “Example”... pass
x = u"a" "b"y = f(u"a", "b")
try: pass...Configuration
Section titled “Configuration”python: lint: rules: unicode-literal: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line unicode-literal in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| ruff | UP025 |
full |