Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def should_warn(self, error):
# if in the errors list, overrides warning level
if self.error_list and re.search(self.error_list, error):
return False
if messages.is_default_warning(error):
return True
return self.warning_list and re.search(self.warning_list, error)