def _get_style_test_options(filename):
""" Returns (skip, ignores) for the specifies source file.
"""
skip = False
ignores = []
text = open(filename, 'rb').read().decode('utf-8')
# Iterate over lines
for i, line in enumerate(text.splitlines()):
if i > 20:
break
if line.startswith('# styletest:'):
if 'skip' in line:
skip = True
elif 'ignore' in line:
words = line.replace(',', ' ').split(' ')
words = [w.strip() for w in words if w.strip()]
words = [w for w in words if
(w[1:].isnumeric() and w[0] in 'EWFCN')]
ignores.extend(words)
return skip, ignores
评论列表
文章目录