Skip to content

Started getting "invalid name" errors on a module-level global variable after upgrade to pylint 4.0.4 #10768

@baruchoxman

Description

@baruchoxman

Bug description

pylint --include-naming-hint=y utils/myfile.py

utils/myfile.py:16:0: C0103: Constant name "_g_is_installed" doesn't conform to UPPER_CASE naming style ('([^\\W\\da-z][^\\Wa-z]*|__.*__)$' pattern) (invalid-name)

This is the content - the global is changed later on hence it is not a const:

_g_is_installed = False


def x():
    global _g_is_installed
    _g_is_installed = True

Configuration

Command used

pylint --include-naming-hint=y myfile.py

Pylint output

myfile.py:16:0: C0103: Constant name "_g_is_installed" doesn't conform to UPPER_CASE naming style ('([^\\W\\da-z][^\\Wa-z]*|__.*__)$' pattern) (invalid-name)

Expected behavior

Before the upgrade it was passing

Pylint version

python 3.12
pylint 4.0.4
astroid 4.0.2

OS / Environment

No response

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions