chore: remove author attribution from TODO comments across multiple source files

Remove "(bob)" author prefix from all TODO comments in benchmark/method_call.wren, include/wren.h, src/main.c, src/wren_common.h, src/wren_compiler.c, src/wren_core.c, src/wren_value.c, src/wren_value.h, and src/wren_vm.c. Update the TODO_PATTERN regex in metrics script to match the new format without author parentheses. Also refactor test file counting in metrics to use os.walk with fnmatch for recursive directory traversal instead of glob.iglob.
This commit is contained in:
Bob Nystrom
2013-12-14 23:28:18 +00:00
parent 07c3dff92f
commit 34db2b2b9f
38 changed files with 171 additions and 171 deletions
+20 -17
View File
@@ -1,10 +1,12 @@
#!/usr/bin/python
import glob
import fnmatch
import itertools
import os
import re
TODO_PATTERN = re.compile(r'\s*// TODO\(')
TODO_PATTERN = re.compile(r'\s*// TODO:')
DOC_PATTERN = re.compile(r'\s*//')
EXPECT_PATTERN = re.compile(r'// expect')
@@ -42,24 +44,25 @@ for source_path in files:
num_code += 1
for test_path in glob.iglob("test/*.wren"):
num_test_files += 1
with open(test_path, "r") as input:
for line in input:
if (line.strip() == ""):
num_test_empty += 1
else:
num_test += 1
for dir_path, dir_names, file_names in os.walk("test"):
for file_name in fnmatch.filter(file_names, "*.wren"):
num_test_files += 1
with open(os.path.join(dir_path, file_name), "r") as input:
for line in input:
if (line.strip() == ""):
num_test_empty += 1
else:
num_test += 1
match = TODO_PATTERN.match(line)
if match:
num_test_todos += 1
continue
match = TODO_PATTERN.match(line)
if match:
num_test_todos += 1
continue
match = EXPECT_PATTERN.search(line)
if match:
num_expects += 1
continue
match = EXPECT_PATTERN.search(line)
if match:
num_expects += 1
continue
print "source:"
print " files ", num_files