Attrs cleanups (#37849)

This commit is contained in:
Ville Skyttä 2020-07-14 20:30:30 +03:00 committed by GitHub
parent 7e280e2b27
commit ac0dbb17af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 141 additions and 148 deletions

View file

@ -11,9 +11,9 @@ import attr
class Error:
"""Error validating an integration."""
plugin = attr.ib(type=str)
error = attr.ib(type=str)
fixable = attr.ib(type=bool, default=False)
plugin: str = attr.ib()
error: str = attr.ib()
fixable: bool = attr.ib(default=False)
def __str__(self) -> str:
"""Represent error as string."""
@ -63,10 +63,10 @@ class Integration:
return integrations
path = attr.ib(type=pathlib.Path)
manifest = attr.ib(type=dict, default=None)
errors = attr.ib(type=List[Error], factory=list)
warnings = attr.ib(type=List[Error], factory=list)
path: pathlib.Path = attr.ib()
manifest: Optional[dict] = attr.ib(default=None)
errors: List[Error] = attr.ib(factory=list)
warnings: List[Error] = attr.ib(factory=list)
@property
def domain(self) -> str: