Imported Upstream version 1.27.0
[platform/upstream/grpc.git] / tools / distrib / check_include_guards.py
index 94794b1..bc77422 100755 (executable)
@@ -64,9 +64,10 @@ class GuardValidator(object):
                                                      build_valid_guard(fpath))
             return fcontents
 
-        print('{}: Wrong preprocessor guards (RE {}):'
-              '\n\tFound {}, expected {}').format(fpath, regexp.pattern,
-                                                  match_txt, correct)
+        print(
+            '{}: Wrong preprocessor guards (RE {}):'
+            '\n\tFound {}, expected {}').format(fpath, regexp.pattern,
+                                                match_txt, correct)
         if fix:
             print 'Fixing {}...\n'.format(fpath)
             fixed_fcontents = re.sub(match_txt, correct, fcontents)
@@ -126,10 +127,9 @@ class GuardValidator(object):
             # No endif. Check if we have the last line as just '#endif' and if so
             # replace it with a properly commented one.
             if flines[-1] == '#endif':
-                flines[-1] = (
-                    '#endif' +
-                    ('  // {}\n'.format(valid_guard)
-                     if cpp_header else ' /* {} */\n'.format(valid_guard)))
+                flines[-1] = ('#endif' +
+                              ('  // {}\n'.format(valid_guard) if cpp_header
+                               else ' /* {} */\n'.format(valid_guard)))
                 if fix:
                     fcontents = '\n'.join(flines)
                     save(fpath, fcontents)
@@ -179,8 +179,8 @@ FILE_LIST_COMMAND = ' | '.join((git_command, grep_filter))
 ok = True
 filename_list = []
 try:
-    filename_list = subprocess.check_output(
-        FILE_LIST_COMMAND, shell=True).splitlines()
+    filename_list = subprocess.check_output(FILE_LIST_COMMAND,
+                                            shell=True).splitlines()
     # Filter out non-existent files (ie, file removed or renamed)
     filename_list = (f for f in filename_list if os.path.isfile(f))
 except subprocess.CalledProcessError: