Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
[ is the POSIX test operator, while [[ is the bash keyword
comparision operator. Comparisons such as =~, < and > require
the use of [[.
""",
'default': 'E',
},
}
MESSAGES = {}
_default_errors = []
_default_warnings = []
for k, v in _messages.items():
MESSAGES[k] = _Message(k, v['msg'], v['long_msg'], v['default'])
if v['default'] == 'E':
_default_errors.append(k)
if v['default'] == 'W':
_default_warnings.append(k)
# convert this to the regex strings. This looks a bit weird
# but it fits the current model of error/warning/ignore checking
# easily.
_default_errors = '^(' + '|'.join(_default_errors) + ')'
_default_warnings = '^(' + '|'.join(_default_warnings) + ')'
def is_default_error(error):
return re.search(_default_errors, error)