jsilvanus created this revision.
Herald added projects: All, clang, clang-format.
Herald added a subscriber: cfe-commits.
Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay.
jsilvanus requested review of this revision.
Herald added a comment.

NOTE: Clang-Format Team Automated Review Comment

It looks like your clang-format review does not contain any unit tests, please 
try to ensure all code changes have a unit test (unless this is an `NFC` or 
refactoring, adding documentation etc..)

Add your unit tests in `clang/unittests/Format` and you can build with `ninja 
FormatTests`.  We recommend using the `verifyFormat(xxx)` format of unit tests 
rather than `EXPECT_EQ` as this will ensure you change is tolerant to random 
whitespace changes (see FormatTest.cpp as an example)

For situations where your change is altering the TokenAnnotator.cpp which can 
happen if you are trying to improve the annotation phase to ensure we are 
correctly identifying the type of a token, please add a token annotator test in 
`TokenAnnotatorTest.cpp`


The instructions in the documentation only mentioned how to include
bindings for clang-format into vim using python2. Add the instructions
for python3 which were already present in the source comments.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153338

Files:
  clang/docs/ClangFormat.rst


Index: clang/docs/ClangFormat.rst
===================================================================
--- clang/docs/ClangFormat.rst
+++ clang/docs/ClangFormat.rst
@@ -145,8 +145,13 @@
 
 .. code-block:: vim
 
-  map <C-K> :pyf <path-to-this-file>/clang-format.py<cr>
-  imap <C-K> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
+  if has('python')
+    map <C-I> :pyf <path-to-this-file>/clang-format.py<cr>
+    imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
+  elseif has('python3')
+    map <C-I> :py3f <path-to-this-file>/clang-format.py<cr>
+    imap <C-I> <c-o>:py3f <path-to-this-file>/clang-format.py<cr>
+  endif
 
 The first line enables :program:`clang-format` for NORMAL and VISUAL mode, the
 second line adds support for INSERT mode. Change "C-K" to another binding if


Index: clang/docs/ClangFormat.rst
===================================================================
--- clang/docs/ClangFormat.rst
+++ clang/docs/ClangFormat.rst
@@ -145,8 +145,13 @@
 
 .. code-block:: vim
 
-  map <C-K> :pyf <path-to-this-file>/clang-format.py<cr>
-  imap <C-K> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
+  if has('python')
+    map <C-I> :pyf <path-to-this-file>/clang-format.py<cr>
+    imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
+  elseif has('python3')
+    map <C-I> :py3f <path-to-this-file>/clang-format.py<cr>
+    imap <C-I> <c-o>:py3f <path-to-this-file>/clang-format.py<cr>
+  endif
 
 The first line enables :program:`clang-format` for NORMAL and VISUAL mode, the
 second line adds support for INSERT mode. Change "C-K" to another binding if
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to