@ -37,7 +37,8 @@ virt_import_re = re.compile(
r " ^ \ s*(?:import|from) nova \ .(?:tests \ .)?virt \ .( \ w+) " )
virt_config_re = re . compile (
r " CONF \ .import_opt \ ( ' .*? ' , ' nova \ .virt \ .( \ w+)( ' |.) " )
author_tag_re = re . compile ( " ^ \ s*# \ s*@?(a|A)uthor: " )
author_tag_re = ( re . compile ( " ^ \ s*# \ s*@?(a|A)uthor: " ) ,
re . compile ( " ^ \ . \ . \ s+moduleauthor:: " ) )
asse_trueinst_re = re . compile (
r " (.)*assertTrue \ (isinstance \ (( \ w| \ .| \ ' | \" | \ [| \ ])+, "
" ( \ w| \ .| \' | \" | \ [| \ ])+ \ ) \ ) " )
@ -158,9 +159,13 @@ def no_vi_headers(physical_line, line_number, lines):
def no_author_tags ( physical_line ) :
if author_tag_re . match ( physical_line ) :
pos = physical_line . find ( ' author ' )
return pos , " N315: Don ' t use author tags "
for regex in author_tag_re :
if regex . match ( physical_line ) :
physical_line = physical_line . lower ( )
pos = physical_line . find ( ' moduleauthor ' )
if pos < 0 :
pos = physical_line . find ( ' author ' )
return pos , " N315: Don ' t use author tags "
def assert_true_instance ( logical_line ) :