Add guard to catch null comments in similarity check
This commit is contained in:
Родитель
7ce5e8273a
Коммит
e5bac3ea9a
|
@ -24,6 +24,9 @@ class CheckCommentSimilarity(LocalizationTestCase):
|
|||
violations = []
|
||||
|
||||
for string in self.collection.strings_for_language(self.configuration.default_language()):
|
||||
if string.value is None or string.comment is None:
|
||||
continue
|
||||
|
||||
similarity = difflib.SequenceMatcher(None, string.value, string.comment).ratio()
|
||||
|
||||
if similarity > maximum_comment_similarity_ratio:
|
||||
|
|
|
@ -68,7 +68,7 @@ class LocalizationTestCase(abc.ABC):
|
|||
try:
|
||||
violations = self.run_test()
|
||||
|
||||
if not violations:
|
||||
if violations is None:
|
||||
raise Exception(f"Failed to get exceptions from test: {self.__class__.name()}")
|
||||
|
||||
if len(violations):
|
||||
|
|
Загрузка…
Ссылка в новой задаче