tools: Remove unnecessary warning generated during documentation generation

This commit is contained in:
Roland Dobai 2021-03-03 19:08:28 +01:00
parent 3ddfe1e8ac
commit bccb5be82f

View File

@ -74,8 +74,7 @@ class ConfigTargetVisibility(object):
implication_list = [self._implies_invisibility(item[1]), self._implies_invisibility(item[2])] implication_list = [self._implies_invisibility(item[1]), self._implies_invisibility(item[2])]
if all([implies for (implies, _) in implication_list]): if all([implies for (implies, _) in implication_list]):
source_list = [s for (_, s) in implication_list if s.startswith(self.target_env_var)] source_list = [s for (_, s) in implication_list if s.startswith(self.target_env_var)]
if len(set(source_list)) != 1: # set removes the duplicates # if source_list has more items then it should not matter which will imply the invisibility
print('[WARNING] list contains targets: {}'.format(source_list))
return (True, source_list[0]) return (True, source_list[0])
return (False, None) return (False, None)
elif item[0] in self.direct_eval_set: elif item[0] in self.direct_eval_set:
@ -94,8 +93,7 @@ class ConfigTargetVisibility(object):
vis_list = [self._visible(node) for node in item.nodes] vis_list = [self._visible(node) for node in item.nodes]
if len(vis_list) > 0 and all([not visible for (visible, _) in vis_list]): if len(vis_list) > 0 and all([not visible for (visible, _) in vis_list]):
source_list = [s for (_, s) in vis_list if s is not None and s.startswith(self.target_env_var)] source_list = [s for (_, s) in vis_list if s is not None and s.startswith(self.target_env_var)]
if len(set(source_list)) != 1: # set removes the duplicates # if source_list has more items then it should not matter which will imply the invisibility
print('[WARNING] list contains targets: {}'.format(source_list))
return (True, source_list[0]) return (True, source_list[0])
if item.name.startswith(self.target_env_var): if item.name.startswith(self.target_env_var):