1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#!/usr/bin/python -tt
def does_include_using_namespace(lines, fn):
if 'system_headers.h' in fn:
return []
if not fn.endswith('.h'):
return []
for lineno, line in enumerate(lines, 1):
if 'using namespace' in line:
return [(fn, lineno,
"Do not use \"using namespace\" in header files.")]
return []
evaluate_matches = does_include_using_namespace
#################
# ALLOWED TESTS #
#################
allowed = [
"""
""",
]
###################
# FORBIDDEN TESTS #
###################
forbidden = [
"""
using namespace
""",
]
|