[PATCH] D49116: Setup clang-format as an Arcanist linter

MyDeveloperDay via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 25 06:20:36 PST 2019


MyDeveloperDay added a comment.

I run on Windows 10 with cygwin

I made a whitespace change using notepad++ in llvm/lib/CommandLine.cpp, then ran

  arc lint

I get the following

  $ arc lint
  >>> Lint for lib/Support/CommandLine.cpp:
  
  
     Auto-Fix  (S&RX) Lint
      clang-format suggested style edits found:
  
               273
               274   void printOptionValues();
               275
      >>> -    276   void
          -    277     registerCategory(OptionCategory *cat) {
          +          void registerCategory(OptionCategory *cat) {
               278     assert(count_if(RegisteredOptionCategories,
               279                     [cat](const OptionCategory *Category) {
               280              return cat->getName() == Category->getName();
               281            }) == 0 &&
  --- /buildareas/clang/llvm/lib/Support/CommandLine.cpp  2019-01-25 14:07:42.608422800 +0000
  +++ /tmp/659mblmvmukogwc4/21064-Sz7Mx7  2019-01-25 14:08:06.033582000 +0000
  @@ -273,8 +273,7 @@
  
     void printOptionValues();
  
  -  void
  -    registerCategory(OptionCategory *cat) {
  +  void registerCategory(OptionCategory *cat) {
       assert(count_if(RegisteredOptionCategories,
                       [cat](const OptionCategory *Category) {
                return cat->getName() == Category->getName();
  
  
      Apply this patch to lib/Support/CommandLine.cpp? [Y/n] n
  
   OKAY  No lint warnings.

If I try and run this in cmd.exe I get

  $ cmd
  Microsoft Windows [Version 10.0.17134.523]
  (c) 2018 Microsoft Corporation. All rights reserved.
  
  C:\cygwin64\Repos\clang\llvm\lib\Support>arc lint
  PHP Warning:  require_once(/Repos/clang/llvm/lib/Support/__init_script__.php): failed to open stream: No such file or directory in /Repos/clang/llvm/lib/Support/C:\Repos\arcanist\arcanist\bin\..\scripts\arcanist.php on line 6
  PHP Fatal error:  require_once(): Failed opening required '/Repos/clang/llvm/lib/Support/__init_script__.php' (include_path='.:/usr/share/pear:/usr/share/php/php') in /Repos/clang/llvm/lib/Support/C:\cygwin64\Repos\arcanist\arcanist\bin\..\scripts\arcanist.php on line 6
  
  C:\Repos\clang\llvm\lib\Support>

but this is more likely because arc help doesn't even work inside the cmd prompt... (I don't use cmd.exe)

  c:\cygwin64\Repos\clang\llvm\lib\Support>arc help
  PHP Warning:  require_once(/Repos/clang/llvm/lib/Support/__init_script__.php): failed to open stream: No such file or directory in /Repos/clang/llvm/lib/Support/c:\cygwin64\Repos\arcanist\arcanist\bin\..\scripts\arcanist.php on line 6
  PHP Fatal error:  require_once(): Failed opening required '/Repos/clang/llvm/lib/Support/__init_script__.php' (include_path='.:/usr/share/pear:/usr/share/php/php') in /Repos/clang/llvm/lib/Support/c:\cygwin64\Repos\arcanist\arcanist\bin\..\scripts\arcanist.php on line 6

If its important that it works in cmd.exe (why would anyone develop inside cmd.exe!!) then I can try and get it working..


Repository:
  rL LLVM

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

https://reviews.llvm.org/D49116





More information about the llvm-commits mailing list