[PATCH] D68682: format::cleanupAroundReplacements removes whole line when Removals leave previously non-blank line blank

Conrad Poelman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 20 23:25:55 PST 2019


poelmanc updated this revision to Diff 230375.
poelmanc marked 3 inline comments as done.
poelmanc retitled this revision from "Clang-tidy fix removals removing all non-blank text from a line should remove the line" to "format::cleanupAroundReplacements removes whole line when Removals leave previously non-blank line blank".
poelmanc edited the summary of this revision.
poelmanc added a comment.

I addressed the latest code review comments, added tests to `clang/unittests/Format/CleanupTest.cpp`, and updated numerous tests to reflect improved removal of blank lines.

I now realize how widely used `cleanupAroundReplacements` is. That's great as this fix improves `clang-change-namespace` as a side-effect. However, I have little experience running tests beyond clang-tidy or on Linux (I'm testing with MSVC) and would appreciate help identifying any test failures or regressions. Also please check my change to `FixOnlyAffectedCodeAfterReplacements` in clang/unittests/Format/CleanupTest.cpp.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68682/new/

https://reviews.llvm.org/D68682

Files:
  clang-tools-extra/clang-query/QueryParser.cpp
  clang-tools-extra/clang-tidy/readability/RedundantControlFlowCheck.cpp
  clang-tools-extra/test/clang-tidy/checkers/modernize-redundant-void-arg.cpp
  clang-tools-extra/test/clang-tidy/checkers/readability-redundant-control-flow.cpp
  clang-tools-extra/test/clang-tidy/checkers/readability-redundant-declaration.cpp
  clang-tools-extra/test/clang-tidy/checkers/readability-redundant-member-init.cpp
  clang-tools-extra/test/clang-tidy/checkers/readability-simplify-bool-expr.cpp
  clang-tools-extra/unittests/clang-change-namespace/ChangeNamespaceTests.cpp
  clang-tools-extra/unittests/clang-move/ClangMoveTests.cpp
  clang/include/clang/Basic/CharInfo.h
  clang/include/clang/Format/Format.h
  clang/lib/AST/CommentLexer.cpp
  clang/lib/AST/CommentParser.cpp
  clang/lib/AST/CommentSema.cpp
  clang/lib/Format/Format.cpp
  clang/unittests/Format/CleanupTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68682.230375.patch
Type: text/x-patch
Size: 43995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191121/d7df2336/attachment-0001.bin>


More information about the cfe-commits mailing list