[PATCH] D61549: Fix use of 'is' operator for comparison

2020-02-29 Thread Jens Carl via Phabricator via cfe-commits
j-carl added a comment.

In D61549#1785369 , @Jim wrote:

> @j-carl Could you give a Python 3.8 syntax reference for this change.


As @tambre mentioned it's not a language change, but information about the 
change can be found here https://bugs.python.org/issue34850.

The problem I face with the vim integration is that vim stops the execution of 
the script and shows a warning:

  /usr/share/clang/clang-format.py:123: SyntaxWarning: "is not" with a literal. 
Did you mean "!="?  
if op[0] is not 'equal':
  Press ENTER or type command to continue

Now I have to press ENTER to get the script running. This adds another key 
stroke to my workflow.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61549



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61549: Fix use of 'is' operator for comparison

2019-11-16 Thread Jens Carl via Phabricator via cfe-commits
j-carl added a comment.

Gentle ping ... ArchLinux update to Python 3.8 and it's not possible to use 
clang-format.py from vim anymore.
Thanks


Repository:
  rC Clang

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

https://reviews.llvm.org/D61549



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D76381: Fix AttributeError in add_new_check.py

2020-03-18 Thread Jens Carl via Phabricator via cfe-commits
j-carl created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
j-carl added a reviewer: alexfh.
j-carl edited the summary of this revision.
j-carl added a project: clang-tools-extra.

Using add_new_check.py with Python 3.8.2 to create a new check results
in a AttributeError and an empty file /TidyModule.cpp.

Python 3.x doesn't support `next()` anymore and should be replace with
`__next__()`.

$ ./add_new_check.py readability test-flag
Updating ./readability/CMakeLists.txt...
Creating ./readability/TestFlagCheck.h...
Creating ./readability/TestFlagCheck.cpp...
Updating ./readability/ReadabilityTidyModule.cpp...
Traceback (most recent call last):

  File "./add_new_check.py", line 471, in 
main()
  File "./add_new_check.py", line 461, in main
adapt_module(module_path, module, check_name, check_name_camel)
  File "./add_new_check.py", line 175, in adapt_module
line = lines.next()

AttributeError: 'list_iterator' object has no attribute 'next'


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76381

Files:
  clang-tools-extra/clang-tidy/add_new_check.py


Index: clang-tools-extra/clang-tidy/add_new_check.py
===
--- clang-tools-extra/clang-tidy/add_new_check.py
+++ clang-tools-extra/clang-tidy/add_new_check.py
@@ -172,7 +172,7 @@
 lines = iter(lines)
 try:
   while True:
-line = lines.next()
+line = lines.__next__()
 if not header_added:
   match = re.search('#include "(.*)"', line)
   if match:
@@ -197,7 +197,7 @@
 # If we didn't find the check name on this line, look on the
 # next one.
 prev_line = line
-line = lines.next()
+line = lines.__next__()
 match = re.search(' *"([^"]*)"', line)
 if match:
   current_check_name = match.group(1)


Index: clang-tools-extra/clang-tidy/add_new_check.py
===
--- clang-tools-extra/clang-tidy/add_new_check.py
+++ clang-tools-extra/clang-tidy/add_new_check.py
@@ -172,7 +172,7 @@
 lines = iter(lines)
 try:
   while True:
-line = lines.next()
+line = lines.__next__()
 if not header_added:
   match = re.search('#include "(.*)"', line)
   if match:
@@ -197,7 +197,7 @@
 # If we didn't find the check name on this line, look on the
 # next one.
 prev_line = line
-line = lines.next()
+line = lines.__next__()
 match = re.search(' *"([^"]*)"', line)
 if match:
   current_check_name = match.group(1)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D76477: [clang-tidy] Update path of main translation unit

2020-03-19 Thread Jens Carl via Phabricator via cfe-commits
j-carl created this revision.
Herald added subscribers: cfe-commits, xazax.hun.
Herald added a project: clang.
j-carl added a reviewer: alexfh.
j-carl added a project: clang-tools-extra.
j-carl edited the summary of this revision.
j-carl removed a reviewer: alexfh.
j-carl added a reviewer: alexfh.

The forcing of the linker for a new module was moved from file
clang-tidy/tools/ClangTidyModule.cpp to
clang-tidy/ClangTidyForceLinker.h.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76477

Files:
  clang-tools-extra/docs/clang-tidy/Contributing.rst


Index: clang-tools-extra/docs/clang-tidy/Contributing.rst
===
--- clang-tools-extra/docs/clang-tidy/Contributing.rst
+++ clang-tools-extra/docs/clang-tidy/Contributing.rst
@@ -256,7 +256,7 @@
 
 And this to the main translation unit of the :program:`clang-tidy` binary (or
 the binary you link the ``clang-tidy`` library in)
-``clang-tidy/tool/ClangTidyMain.cpp``:
+``clang-tidy/ClangTidyForceLinker.h``:
 
 .. code-block:: c++
 


Index: clang-tools-extra/docs/clang-tidy/Contributing.rst
===
--- clang-tools-extra/docs/clang-tidy/Contributing.rst
+++ clang-tools-extra/docs/clang-tidy/Contributing.rst
@@ -256,7 +256,7 @@
 
 And this to the main translation unit of the :program:`clang-tidy` binary (or
 the binary you link the ``clang-tidy`` library in)
-``clang-tidy/tool/ClangTidyMain.cpp``:
+``clang-tidy/ClangTidyForceLinker.h``:
 
 .. code-block:: c++
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits