From 947ee47c87d34abcd8982a61c12888e26111175d Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 5 Mar 2021 03:20:07 +0100 Subject: Add --class-const-naming-style --- ChangeLog | 5 ++++ doc/user_guide/options.rst | 6 +++++ pylint/checkers/base.py | 19 +++++++++++++-- tests/functional/n/name_preset_snake_case.py | 5 ++++ tests/functional/n/name_preset_snake_case.rc | 1 + tests/functional/n/name_preset_snake_case.txt | 9 ++++--- tests/functional/n/name_styles.py | 7 ++++++ tests/functional/n/name_styles.txt | 35 ++++++++++++++------------- 8 files changed, 64 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6bb635efb..4211c8814 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,6 +37,11 @@ Release date: TBA Closes #3167 +* Add ``--class-const-naming-style`` for Enum constants and class variables annotated + with ``typing.ClassVar`` + + Closes #4181 + What's New in Pylint 2.7.2? =========================== diff --git a/doc/user_guide/options.rst b/doc/user_guide/options.rst index dc464812a..93833d009 100644 --- a/doc/user_guide/options.rst +++ b/doc/user_guide/options.rst @@ -35,6 +35,8 @@ name is found in, and not the type of object assigned. +--------------------+---------------------------------------------------------------------------------------------------+ | ``class-attribute``| Attributes defined in class bodies. | +--------------------+---------------------------------------------------------------------------------------------------+ +| ``class-const`` | Enum constants and class variables annotated with ``ClassVar`` | ++--------------------+---------------------------------------------------------------------------------------------------+ | ``inlinevar`` | Loop variables in list comprehensions and generator expressions. | +--------------------+---------------------------------------------------------------------------------------------------+ @@ -76,6 +78,8 @@ Following options are exposed: .. option:: --class-attribute-naming-style=