Hello Dan Burkert, Adar Dembo,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/5560

to review the following change.

Change subject: KUDU-1812. Clang tool for replacing DebugString calls
......................................................................

KUDU-1812. Clang tool for replacing DebugString calls

This is a clang-based tool that auto-replaces pb.DebugString or
pb.ShortDebugString call with SecureDebugString(pb) or
SecureShortDebugString(pb).

It's not 100% effective due to some complexity with macros that I
couldn't figure out, but seemed to cover 99% of the cases, and I managed
to get it to insert TODOs in most of the spots it couldn't figure out.
Manual grepping can take care of the remaining spots.

This can be run using:
$ cd build/latest
$ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ../../
$ make
$ find ../../src/kudu/ -name \*.cc | \
  xargs -P8 -n1 ../../build-support/tools/kudu-lint/run-pb-refactor.sh
$ clang-apply-replacements /tmp/repl/

It doesn't take care of auto-adding necessary includes, but was in
general useful.

The usefulness of this tool is probably fleeting -- we could decide to
not commit this patch at all, or we could commit it and later repurpose
it (in a simpler form) as a pre-commit check that no new calls to
DebugString are added.

Change-Id: If74fc3cc69c3d6048abaa3b0d1f1ff2b2aaeec00
---
M build-support/tools/kudu-lint/CMakeLists.txt
A build-support/tools/kudu-lint/refactor-pb-tostring.cc
A build-support/tools/kudu-lint/run-pb-refactor.sh
3 files changed, 201 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/60/5560/1
-- 
To view, visit http://gerrit.cloudera.org:8080/5560
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If74fc3cc69c3d6048abaa3b0d1f1ff2b2aaeec00
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Dan Burkert <danburk...@apache.org>

Reply via email to