[clang-tidy] Refactor: Prefer single quoted strings over double quoted strings [NFC]
authorRichard <legalize@xmission.com>
Mon, 3 Jan 2022 18:38:42 +0000 (11:38 -0700)
committerRichard <legalize@xmission.com>
Fri, 11 Mar 2022 22:08:24 +0000 (15:08 -0700)
clang-tools-extra/clang-tidy/add_new_check.py [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 50a220b..fc83974
@@ -297,7 +297,7 @@ void awesome_f2();
 
 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 update_checks_list(clang_tidy_path):
         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 update_checks_list(clang_tidy_path):
   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)