[clang-tools-extra] 602ea53 - [clang-tidy] Refactor: Prefer single quoted strings over double quoted strings [NFC]

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 11 14:09:09 PST 2022


Author: Richard
Date: 2022-03-11T15:08:24-07:00
New Revision: 602ea53cb7e7119f7ba33239ca8ead377f2fcbd4

URL: https://github.com/llvm/llvm-project/commit/602ea53cb7e7119f7ba33239ca8ead377f2fcbd4
DIFF: https://github.com/llvm/llvm-project/commit/602ea53cb7e7119f7ba33239ca8ead377f2fcbd4.diff

LOG: [clang-tidy] Refactor: Prefer single quoted strings over double quoted strings [NFC]

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py
old mode 100755
new mode 100644
index 50a220b3f9750..fc83974486314
--- a/clang-tools-extra/clang-tidy/add_new_check.py
+++ b/clang-tools-extra/clang-tidy/add_new_check.py
@@ -297,7 +297,7 @@ def write_test(module_path, module, check_name, test_extension):
 
 def get_actual_filename(dirname, filename):
   if not os.path.isdir(dirname): 
-    return ""
+    return ''
   name = os.path.join(dirname, filename)
   if (os.path.isfile(name)):
     return name
@@ -305,7 +305,7 @@ def get_actual_filename(dirname, filename):
   for file in os.listdir(dirname):
     if (file.lower() == caselessname):
       return os.path.join(dirname, file)
-  return ""
+  return ''
 
 
 # Recreates the list of checks in the docs/clang-tidy/checks directory.
@@ -321,7 +321,7 @@ def update_checks_list(clang_tidy_path):
   doc_files.sort()
 
   def has_auto_fix(check_name):
-    dirname, _, check_name = check_name.partition("-")
+    dirname, _, check_name = check_name.partition('-')
 
     checker_code = get_actual_filename(os.path.join(clang_tidy_path, dirname),
                                        get_camel_check_name(check_name) + '.cpp')
@@ -338,7 +338,7 @@ def has_auto_fix(check_name):
         if needle in code:
           # Some simple heuristics to figure out if a checker has an autofix or not.
           return ' "Yes"'
-    return ""
+    return ''
 
   def process_doc(doc_file):
     check_name = doc_file.replace('.rst', '')
@@ -389,7 +389,7 @@ def format_link_alias(doc_file):
   with io.open(filename, 'w', encoding='utf8', newline='\n') as f:
     for line in lines:
       f.write(line)
-      if line.strip() == ".. csv-table::":
+      if line.strip() == '.. csv-table::':
         # We dump the checkers
         f.write('   :header: "Name", "Offers fixes"\n\n')
         f.writelines(checks)


        


More information about the cfe-commits mailing list