@@ -120,7 +120,7 @@ def __init__(self, clazz, location, raw, blame, imports):
120120 self .blame = blame
121121 self .source = None
122122
123- raw = collect_chunks (raw , "[\s;]" )
123+ raw = collect_chunks (raw , r "[\s;]" )
124124 self .split = list (raw )
125125
126126 for r in ["field" , "enum_constant" , "volatile" , "transient" , "public" , "protected" , "static" , "final" , "deprecated" ]:
@@ -149,7 +149,7 @@ def __repr__(self):
149149
150150class Argument ():
151151 def __init__ (self , clazz , source , raw , location , blame , imports ):
152- raw = collect_chunks (raw , "\s" )
152+ raw = collect_chunks (raw , r "\s" )
153153 self .annotations = [
154154 Annotation (clazz , self , location , a , blame , imports ) for a in raw if a .startswith ("@" )]
155155 raw = [x for x in raw if not x .startswith ("@" )]
@@ -210,7 +210,7 @@ def __init__(self, clazz, location, raw, blame, imports):
210210 self .blame = blame
211211 self .source = None
212212
213- raw = collect_chunks (raw , "\s" )
213+ raw = collect_chunks (raw , r "\s" )
214214
215215 for r in ["" , ";" ]:
216216 while r in raw : raw .remove (r )
@@ -332,7 +332,7 @@ def __init__(self, pkg, location, raw, blame, imports):
332332 self .methods = []
333333 self .source = None
334334
335- raw = collect_chunks (self .raw , "\s" )
335+ raw = collect_chunks (self .raw , r "\s" )
336336 self .split = list (raw )
337337 self .isEnum = False
338338 if "class" in raw :
@@ -348,7 +348,7 @@ def __init__(self, pkg, location, raw, blame, imports):
348348 if "extends" in raw :
349349 self .extends = Type (self , None , raw [raw .index ("extends" )+ 1 ], location ,
350350 blame , imports )
351- self .extends_path = collect_chunks (self .extends .name , "\." )
351+ self .extends_path = collect_chunks (self .extends .name , r "\." )
352352 else :
353353 self .extends = None
354354 self .extends_path = []
@@ -403,7 +403,7 @@ def _parse_stream(f, api_map, clazz_cb=None):
403403 blame = None
404404 imports = {}
405405
406- re_blame = re .compile ("^([a-z0-9]{7,}) \(<([^>]+)>.+?\) (.+?)$" )
406+ re_blame = re .compile (r "^([a-z0-9]{7,}) \(<([^>]+)>.+?\) (.+?)$" )
407407 for raw in f :
408408 line += 1
409409 raw = raw .rstrip ()
@@ -529,7 +529,7 @@ def notice(clazz):
529529
530530def verify_constants (clazz ):
531531 """All static final constants must be FOO_NAME style."""
532- if re .match ("android\.R\.[a-z]+" , clazz .fullname ): return
532+ if re .match (r "android\.R\.[a-z]+" , clazz .fullname ): return
533533 if clazz .fullname .startswith ("android.os.Build" ): return
534534 if clazz .fullname == "android.system.OsConstants" : return
535535
@@ -555,7 +555,7 @@ def verify_class_names(clazz):
555555 """Try catching malformed class names like myMtp or MTPUser."""
556556 if clazz .fullname .startswith ("android.opengl" ): return
557557 if clazz .fullname .startswith ("android.renderscript" ): return
558- if re .match ("android\.R\.[a-z]+" , clazz .fullname ): return
558+ if re .match (r "android\.R\.[a-z]+" , clazz .fullname ): return
559559
560560 if re .search ("[A-Z]{2,}" , clazz .name ) is not None :
561561 warn (clazz , None , "S1" , "Class names with acronyms should be Mtp not MTP" )
@@ -1314,7 +1314,7 @@ def verify_listener_last(clazz):
13141314
13151315def verify_resource_names (clazz ):
13161316 """Verifies that resource names have consistent case."""
1317- if not re .match ("android\.R\.[a-z]+" , clazz .fullname ): return
1317+ if not re .match (r "android\.R\.[a-z]+" , clazz .fullname ): return
13181318
13191319 # Resources defined by files are foo_bar_baz
13201320 if clazz .name in ["anim" ,"animator" ,"color" ,"dimen" ,"drawable" ,"interpolator" ,"layout" ,"transition" ,"menu" ,"mipmap" ,"string" ,"plurals" ,"raw" ,"xml" ]:
@@ -1374,7 +1374,7 @@ def verify_manager_list(clazz):
13741374def verify_abstract_inner (clazz ):
13751375 """Verifies that abstract inner classes are static."""
13761376
1377- if re .match (".+?\.[A-Z][^\.]+\.[A-Z]" , clazz .fullname ):
1377+ if re .match (r ".+?\.[A-Z][^\.]+\.[A-Z]" , clazz .fullname ):
13781378 if " abstract " in clazz .raw and " static " not in clazz .raw :
13791379 warn (clazz , None , None , "Abstract inner classes should be static to improve testability" )
13801380
0 commit comments