Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: Doxyfile

Issue 1510893004: Subzero: Improve the Doxygen input filter for TODO extraction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Doxyfile
diff --git a/Doxyfile b/Doxyfile
index 8e88ed11125a827b40f5d62cbad5b14a8f6a2b5f..c9da93981b8309750792b93022821f1ada3f713c 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -849,15 +849,16 @@ IMAGE_PATH =
# or removed, the anchors will not be placed correctly.
# This script transforms TODO strings into a @todo form. It also transforms
-# "//" into "///" (but only when there are exactly 2 '/' characters in a row).
-# The first pattern matches "//" at the beginning of the line, and the second
-# pattern matches a mid-line "//". The third pattern matches "TODO " or
-# "TODO(owner)" or "TODO:". This should cover the usual TODO patterns, while
-# not falsely matching e.g. a call to a function whose name ends in "TODO".
-
-INPUT_FILTER = "sed -e 's?^//\([^/]\)?///\1?' \
- -e 's?\([^/]\)//\([^/]\)?\1///\2?' \
- -e 's/ \(TODO[ (:]\)/ @todo \1/g'"
+# "//" comments into doxygen "///" comments on every line, starting from a line
+# containing a commented TODO, and ending at the next line without a comment.
+
+INPUT_FILTER = "awk ' \
+ { HasComment = /\/\//; HasTripleSlash = /\/\/\//; HasTodo = / TODO[ (:]/; } \
+ HasComment && HasTodo { InTodoBlock = 1; } \
+ !HasComment { InTodoBlock = 0; } \
+ InTodoBlock && !HasTripleSlash { sub(\"//\", \"///\"); } \
+ InTodoBlock { $0 = gensub(/ (TODO[ (:])/, \" @todo \\1\", \"g\", $0); } \
+ { print; }'"
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698