Minor cleanup of code-smell tests. (#45658)

* Minor cleanup of code-smell tests.
* Add exception handling for YAML load.
This commit is contained in:
Matt Clay
2018-09-14 11:12:06 -07:00
committed by GitHub
parent 235b11f681
commit e7426e3795
5 changed files with 31 additions and 19 deletions

View File

@@ -129,7 +129,7 @@ def main():
with open(path, 'r') as path_fd:
for line, text in enumerate(path_fd.readlines()):
match = re.search(r'(?: |[^C]\()(_)(?: |,|\))', text)
match = re.search(r'(?: |[^C]\()(_)(?:[ ,)])', text)
if match:
print('%s:%d:%d: use `dummy` instead of `_` for a variable name' % (