-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Update pylint to 2.13.0 #68656
Update pylint to 2.13.0 #68656
Conversation
@@ -86,28 +88,23 @@ def name(self) -> str: | |||
"""Return the Alexa API name of this interface.""" | |||
raise NotImplementedError | |||
|
|||
@staticmethod | |||
def properties_supported() -> list[dict]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These static methods are overwritten with normal instance methods. Which means technically the signatures aren't compatible. You can't, for example, just exchange a call to AlexaCapability.properties_supported
with one to a subclass AlexaEndpointHealth.properties_supported
.
core/homeassistant/components/alexa/capabilities.py
Lines 376 to 378 in 70648d6
def properties_supported(self): | |
"""Return what properties this entity supports.""" | |
return [{"name": "powerState"}] |
Furthermore, they are accessed via self.xxx
anyway. So removing staticmethod
here seems fine.
core/homeassistant/components/alexa/capabilities.py
Lines 190 to 196 in 70648d6
properties_supported = self.properties_supported() | |
if properties_supported: | |
result["properties"] = { | |
"supported": self.properties_supported(), | |
"proactivelyReported": self.properties_proactively_reported(), | |
"retrievable": self.properties_retrievable(), | |
} |
Proposed change
Update pylint to
2.13.0
.This is a bigger feature update, see below for some notable changes. I'll open a followup to remove
pylint: disable
messages which now have become obsolete. Those are not included here to keep the diff a bit smaller.Release post: https://pylint.pycqa.org/en/latest/whatsnew/2.13.html
Compare view: pylint-dev/pylint@v2.12.2...v2.13.0
Notable changes
invalid-name
checker for TypeVars. See Make TypeVars private (1) #68205T
,_U
,AnyStr
,_CallableT
,_EntityT
,T_co
,T_contra
T_CALLABLE
,SomeType
(or anything ending inType
)used-before-assignment
logic, especially withtry
/except
blocks.staticmethod
is overwritten with an instance method (or the other way round). Usually,staticmethod
can be removed in these cases as the methods are called from the instance anyway.redefined-slots-in-subclass
checker.__slots__
in subclasses should not contain items from the parent class__slots__
. Python docs.arguments-differ
check to allow redefinitions with extra parameters if those have default values.Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: