@@ -58,14 +58,14 @@ def do_license_check(name, contents):
58
58
for line in fileinput .input (file_names ,
59
59
openhook = fileinput .hook_encoded ("utf-8" )):
60
60
61
- if fileinput . filename (). find ( "tidy.py" ) == - 1 :
62
- if line . find ( cr_flag ) != - 1 :
61
+ if "tidy.py" not in fileinput . filename () :
62
+ if cr_flag in line :
63
63
check_cr = False
64
- if line . find ( tab_flag ) != - 1 :
64
+ if tab_flag in line :
65
65
check_tab = False
66
- if line . find ( linelength_flag ) != - 1 :
66
+ if linelength_flag in line :
67
67
check_linelength = False
68
- if line . find ( "TODO" ) != - 1 :
68
+ if "TODO" in line :
69
69
report_err ("TODO is deprecated; use FIXME" )
70
70
match = re .match (r'^.*/(\*|/!?)\s*XXX' , line )
71
71
if match :
@@ -86,10 +86,10 @@ def do_license_check(name, contents):
86
86
if "SNAP" in line :
87
87
report_warn ("unmatched SNAP line: " + line )
88
88
89
- if check_tab and (line . find ( '\t ' ) != - 1 and
90
- fileinput . filename (). find ( "Makefile" ) == - 1 ):
89
+ if check_tab and ('\t ' in line and
90
+ "Makefile" not in fileinput . filename () ):
91
91
report_err ("tab character" )
92
- if check_cr and not autocrlf and line . find ( '\r ' ) != - 1 :
92
+ if check_cr and not autocrlf and '\r ' in line :
93
93
report_err ("CR character" )
94
94
if line .endswith (" \n " ) or line .endswith ("\t \n " ):
95
95
report_err ("trailing whitespace" )
0 commit comments