This is an archive of the discontinued LLVM Phabricator instance.

Improved llvm-namespace-comment check.
ClosedPublic

Authored by alexfh on May 19 2014, 7:26 AM.

Details

Summary

Handle various forms of existing namespace closing comments, fix
existing comments with wrong namespace name, ignore short namespaces.

The state of this check now seems to be enough to enable it by default to gather
user feedback ;)

Diff Detail

Event Timeline

alexfh updated this revision to Diff 9570.May 19 2014, 7:26 AM
alexfh retitled this revision from to Improved llvm-namespace-comment check..
alexfh updated this object.
alexfh edited the test plan for this revision. (Show Details)
alexfh added a reviewer: klimek.
alexfh added a subscriber: Unknown Object (MLST).
klimek added inline comments.May 19 2014, 7:33 AM
clang-tidy/llvm/NamespaceCommentCheck.cpp
43

This overall needs a lot more comments to be understandable... perhaps also try to pull out a few functions?

alexfh updated this revision to Diff 9577.May 19 2014, 8:33 AM

Added comments and pulled out a couple of functions. PTAL.

klimek accepted this revision.May 19 2014, 9:29 AM
klimek edited edge metadata.

lg

clang-tidy/llvm/NamespaceCommentCheck.cpp
67

Can you add a comment explaining why it's ok to retry on failure with an incremented location?

74

Can you explain why we need this? (I'd have expected the fix-it to not change the number of newlines, thus just inserting the comment between the } and the newline).

This revision is now accepted and ready to land.May 19 2014, 9:29 AM
alexfh updated this revision to Diff 9579.May 19 2014, 9:43 AM
alexfh edited edge metadata.

Added a comment.

clang-tidy/llvm/NamespaceCommentCheck.cpp
67

Done.

74

We need it for the case where the next token after '}' is on the same line (see the test cases on lines 17 and 32 of unittests/clang-tidy/LLVMModuleTest.cpp).

alexfh closed this revision.May 19 2014, 9:46 AM
clang-tidy/llvm/IncludeOrderCheck.cpp