-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed as not planned
Labels
C: invalid-nameDiscussion 🤔Needs decision 🔒Needs a decision before implemention or rejectionNeeds a decision before implemention or rejectionNeeds specification 🔐Accepted as a potential improvement, and needs to specify edge cases, message names, etc.Accepted as a potential improvement, and needs to specify edge cases, message names, etc.
Description
Bug description
Here is the contents of the file sglobals.py
#pylint: disable=missing-module-docstring
TheGreetingWithABadName = "Hello, World!"
Here is the output of pylint sglobals.py
:
sglobals.py:2:0: C0103: Constant name "TheGreetingWithABadName" doesn't conform to UPPER_CASE naming style (invalid-name)
Clearly the opinion is that TheGreetingWithABadName
is a constant, so it must be a codesmell if we later assign to this. But pylint has nothing to say about the following file in the same directory:
#pylint: disable=missing-module-docstring
import sglobals
sglobals.TheGreetingWithABadName = "Hello, OtherWorld!"
Similarly, assigning to module-level functions and so is not caught by pylint.
Configuration
No response
Command used
pylint a.py
Pylint output
Your code has been rated at 10.00/10
Expected behavior
I would have expected a warning to the effect that assigning to module level variables is at least frowned upon
Pylint version
pylint 2.14.4
astroid 2.11.7
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110]
OS / Environment
Debian 11.4
Additional dependencies
No response
Metadata
Metadata
Assignees
Labels
C: invalid-nameDiscussion 🤔Needs decision 🔒Needs a decision before implemention or rejectionNeeds a decision before implemention or rejectionNeeds specification 🔐Accepted as a potential improvement, and needs to specify edge cases, message names, etc.Accepted as a potential improvement, and needs to specify edge cases, message names, etc.