updating to latest
This commit is contained in:
10
custom_components/hacs/validate/common/hacs_manifest.py
Normal file
10
custom_components/hacs/validate/common/hacs_manifest.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from custom_components.hacs.validate.base import (
|
||||
ActionValidationBase,
|
||||
ValidationException,
|
||||
)
|
||||
|
||||
|
||||
class HacsManifest(ActionValidationBase):
|
||||
def check(self):
|
||||
if "hacs.json" not in [x.filename for x in self.repository.tree]:
|
||||
raise ValidationException("The repository has no 'hacs.json' file")
|
||||
@@ -0,0 +1,10 @@
|
||||
from custom_components.hacs.validate.base import (
|
||||
ActionValidationBase,
|
||||
ValidationException,
|
||||
)
|
||||
|
||||
|
||||
class RepositoryDescription(ActionValidationBase):
|
||||
def check(self):
|
||||
if not self.repository.data.description:
|
||||
raise ValidationException("The repository has no description")
|
||||
@@ -0,0 +1,19 @@
|
||||
from custom_components.hacs.validate.base import (
|
||||
ActionValidationBase,
|
||||
ValidationException,
|
||||
)
|
||||
|
||||
|
||||
class RepositoryInformationFile(ActionValidationBase):
|
||||
async def async_check(self):
|
||||
filenames = [x.filename.lower() for x in self.repository.tree]
|
||||
if self.repository.data.render_readme and "readme" in filenames:
|
||||
pass
|
||||
elif self.repository.data.render_readme and "readme.md" in filenames:
|
||||
pass
|
||||
elif "info" in filenames:
|
||||
pass
|
||||
elif "info.md" in filenames:
|
||||
pass
|
||||
else:
|
||||
raise ValidationException("The repository has no information file")
|
||||
10
custom_components/hacs/validate/common/repository_topics.py
Normal file
10
custom_components/hacs/validate/common/repository_topics.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from custom_components.hacs.validate.base import (
|
||||
ActionValidationBase,
|
||||
ValidationException,
|
||||
)
|
||||
|
||||
|
||||
class RepositoryTopics(ActionValidationBase):
|
||||
def check(self):
|
||||
if not self.repository.data.topics:
|
||||
raise ValidationException("The repository has no topics")
|
||||
Reference in New Issue
Block a user