astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
30.78k stars 1.02k forks source link

False-positive for `N811` for full-caps, but non-constant imports #11862

Open L4rryFisherman opened 2 months ago

L4rryFisherman commented 2 months ago

The line:

from uuid import UUID as UUIDType

flags as N811, whereas UUID is a class and not a constant.

Command used:

> ruff check
file.py:1:18: N811 Constant `UUID` imported as non-constant `UUIDType`

Ruff version: 0.4.8

zawsq commented 2 months ago

Ruff doesn't check type, it only check if it's caps. Just mark it with noqa