Skip to content

Add --class-const-naming-style#4185

Merged
Pierre-Sassoulas merged 2 commits into
pylint-dev:masterfrom
cdce8p:naming-style-class_const
Mar 6, 2021
Merged

Add --class-const-naming-style#4185
Pierre-Sassoulas merged 2 commits into
pylint-dev:masterfrom
cdce8p:naming-style-class_const

Conversation

@cdce8p
Copy link
Copy Markdown
Member

@cdce8p cdce8p commented Mar 5, 2021

Steps

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature or an important bug fix, add a What's New entry in doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.

Description

Add a new naming style class-const.
This will apply to:

  • Enum constants
  • Class variables if annotated with ClassVar

Although this technically is a new feature, there might be a point in including it in 2.7.3 (see issue below).

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Related Issue

Closes #4181

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 5, 2021

Coverage Status

Coverage increased (+0.001%) to 91.487% when pulling f844792 on cdce8p:naming-style-class_const into 803a252 on PyCQA:master.

@Pierre-Sassoulas Pierre-Sassoulas added the Enhancement ✨ Improvement to a component label Mar 5, 2021
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.7.3 milestone Mar 5, 2021
Copy link
Copy Markdown
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feature for 2.8 :)
Edit: Or it could be considered a fix for 2.7.3

Comment thread pylint/checkers/base.py Outdated
@cdce8p
Copy link
Copy Markdown
Member Author

cdce8p commented Mar 6, 2021

A utils.is_class_var function does make a lot of sense. I updated the MR.

I would consider it a fix. The impact is most likely limited and can be easily mitigated by adding class-const-naming-style=any to the pylintrc file.

@cdce8p
Copy link
Copy Markdown
Member Author

cdce8p commented Mar 6, 2021

I believe this MR is ready for merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement ✨ Improvement to a component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it possible to allow lower case enum names

3 participants