Hacking: Ignore tools/ for C303
These files should use print statements, because they're normal Python. Change-Id: I8ee51a3a6a3514ab71de438c14e0d2aa2fa4606e
This commit is contained in:
parent
c5078eaefc
commit
437f5be7c8
@ -414,15 +414,19 @@ def check_unicode_usage(logical_line, noqa):
|
|||||||
|
|
||||||
|
|
||||||
def check_no_print_statements(logical_line, filename, noqa):
|
def check_no_print_statements(logical_line, filename, noqa):
|
||||||
# The files in cinder/cmd do need to use 'print()' so
|
# CLI and utils programs do need to use 'print()' so
|
||||||
# we don't need to check those files. Other exemptions
|
# we shouldn't check those files.
|
||||||
# should use '# noqa' to avoid failing here.
|
if noqa:
|
||||||
if "cinder/cmd" not in filename and not noqa:
|
return
|
||||||
if re.match(no_print_statements, logical_line):
|
|
||||||
msg = ("C303: print() should not be used. "
|
if "cinder/cmd" in filename or "tools/" in filename:
|
||||||
"Please use LOG.[info|error|warning|exception|debug]. "
|
return
|
||||||
"If print() must be used, use '# noqa' to skip this check.")
|
|
||||||
yield(0, msg)
|
if re.match(no_print_statements, logical_line):
|
||||||
|
msg = ("C303: print() should not be used. "
|
||||||
|
"Please use LOG.[info|error|warning|exception|debug]. "
|
||||||
|
"If print() must be used, use '# noqa' to skip this check.")
|
||||||
|
yield(0, msg)
|
||||||
|
|
||||||
|
|
||||||
def check_no_log_audit(logical_line):
|
def check_no_log_audit(logical_line):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user