1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00

Bump pylint from 2.10.2 to 2.11.1 (#2334)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
dependabot[bot]
2021-09-19 19:22:28 +02:00
committed by GitHub
parent 50da630811
commit dbb195691b
40 changed files with 219 additions and 384 deletions

View File

@@ -182,7 +182,7 @@ class ArrayInitializer(Expression):
cpp += f" {arg},\n"
cpp += "}"
else:
cpp = "{" + ", ".join(str(arg) for arg in self.args) + "}"
cpp = f"{{{', '.join(str(arg) for arg in self.args)}}}"
return cpp
@@ -348,13 +348,11 @@ def safe_exp(obj: SafeExpType) -> Expression:
return float_
if isinstance(obj, ID):
raise ValueError(
"Object {} is an ID. Did you forget to register the variable?"
"".format(obj)
f"Object {obj} is an ID. Did you forget to register the variable?"
)
if inspect.isgenerator(obj):
raise ValueError(
"Object {} is a coroutine. Did you forget to await the expression with "
"'await'?".format(obj)
f"Object {obj} is a coroutine. Did you forget to await the expression with 'await'?"
)
raise ValueError("Object is not an expression", obj)
@@ -703,7 +701,7 @@ class MockObj(Expression):
return str(self.base)
def __repr__(self):
return "MockObj<{}>".format(str(self.base))
return f"MockObj<{str(self.base)}>"
@property
def _(self) -> "MockObj":
@@ -761,7 +759,7 @@ class MockObjEnum(MockObj):
self._is_class = kwargs.pop("is_class")
base = kwargs.pop("base")
if self._is_class:
base = base + "::" + self._enum
base = f"{base}::{self._enum}"
kwargs["op"] = "::"
kwargs["base"] = base
MockObj.__init__(self, *args, **kwargs)