@@ -211,7 +211,7 @@ def adapt_module(module_path, module, check_name, check_name_camel):
211
211
f .write (check_decl )
212
212
else :
213
213
match = re .search (
214
- 'registerCheck<(.*)> *\( *(?:"([^"]*)")?' , line
214
+ r 'registerCheck<(.*)> *\( *(?:"([^"]*)")?' , line
215
215
)
216
216
prev_line = None
217
217
if match :
@@ -383,7 +383,7 @@ def filename_from_module(module_name, check_name):
383
383
if stmt_start_pos == - 1 :
384
384
return ""
385
385
stmt = code [stmt_start_pos + 1 : stmt_end_pos ]
386
- matches = re .search ('registerCheck<([^>:]*)>\(\s*"([^"]*)"\s*\)' , stmt )
386
+ matches = re .search (r 'registerCheck<([^>:]*)>\(\s*"([^"]*)"\s*\)' , stmt )
387
387
if matches and matches [2 ] == full_check_name :
388
388
class_name = matches [1 ]
389
389
if "::" in class_name :
@@ -401,8 +401,8 @@ def filename_from_module(module_name, check_name):
401
401
# Examine code looking for a c'tor definition to get the base class name.
402
402
def get_base_class (code , check_file ):
403
403
check_class_name = os .path .splitext (os .path .basename (check_file ))[0 ]
404
- ctor_pattern = check_class_name + "\([^:]*\)\s*:\s*([A-Z][A-Za-z0-9]*Check)\("
405
- matches = re .search ("\s+" + check_class_name + "::" + ctor_pattern , code )
404
+ ctor_pattern = check_class_name + r "\([^:]*\)\s*:\s*([A-Z][A-Za-z0-9]*Check)\("
405
+ matches = re .search (r "\s+" + check_class_name + "::" + ctor_pattern , code )
406
406
407
407
# The constructor might be inline in the header.
408
408
if not matches :
@@ -476,7 +476,7 @@ def process_doc(doc_file):
476
476
# Orphan page, don't list it.
477
477
return "" , ""
478
478
479
- match = re .search (".*:http-equiv=refresh: \d+;URL=(.*).html(.*)" , content )
479
+ match = re .search (r ".*:http-equiv=refresh: \d+;URL=(.*).html(.*)" , content )
480
480
# Is it a redirect?
481
481
return check_name , match
482
482
@@ -505,7 +505,7 @@ def format_link_alias(doc_file):
505
505
ref_begin = ""
506
506
ref_end = "_"
507
507
else :
508
- redirect_parts = re .search ("^\.\./([^/]*)/([^/]*)$" , match .group (1 ))
508
+ redirect_parts = re .search (r "^\.\./([^/]*)/([^/]*)$" , match .group (1 ))
509
509
title = redirect_parts [1 ] + "-" + redirect_parts [2 ]
510
510
target = redirect_parts [1 ] + "/" + redirect_parts [2 ]
511
511
autofix = has_auto_fix (title )
0 commit comments