Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 6, 2021
Merged

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

merged 2 commits into from
Mar 6, 2021

Conversation

cdce8p
Copy link
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

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
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

pylint/checkers/base.py Outdated Show resolved Hide resolved
@cdce8p
Copy link
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
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