Skip to content

invalid-name type alias false-positive for union variables without assignment values #8540

@yilei

Description

@yilei

Bug description

# pylint: disable=missing-docstring
from typing import Union
x: Union[str, int]

Configuration

No response

Command used

pylint t.py

Pylint output

************* Module t
t.py:3:0: C0103: Type alias name "x" doesn't conform to predefined naming style (invalid-name)

Expected behavior

No output.

Pylint version

pylint 2.17.2
astroid 2.15.2
Python 3.11.1 (main, Jan 10 2023, 15:08:01) [Clang 14.0.0 (clang-1400.0.29.202)]

OS / Environment

No response

Additional dependencies

Similar to #8487. This is a bug found in #8537, let me send a separate PR first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Positive 🦟A message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions