tools/remove_duplicate_includes.py
def FindIncludeSet(input_lines, h_path_to_include_set, cc_file_name):
  """Finds and returns the corresponding include set for the given .cc file.

  This is done by finding the first include in the file and then trying to look
  up an .h file in the passed in map. If not present, then None is returned
  immediately.
  """
  for line in input_lines:
    match = INCLUDE_REGEX.search(line)
    # The first include match should be the corresponding .h file, else skip.
    if match:
      h_file_path = os.path.join(os.getcwd(), match.group(2))
      if h_file_path not in h_path_to_include_set:
        print('First include did not match to a known .h file, skipping ' + \
          cc_file_name + ', line: ' + match.group(1))
        return None
      return h_path_to_include_set[h_file_path]
Finds and returns the corresponding include set for the given .cc file.

  This is done by finding the first include in the file and then trying to look
  up an .h file in the passed in map. If not present, then None is returned
  immediately.
  
Finds and returns the corresponding include set for the given .cc file.
This is done by finding the first include in the file and then trying to look
up an .h file in the passed in map. If not present, then None is returned
immediately.
Finds and returns the corresponding include set for the given . cc file . This is done by finding the first include in the file and then trying to look up an . h file in the passed in map . If not present then None is returned immediately .
def FindIncludeSet(input_lines, h_path_to_include_set, cc_file_name):
  for line in input_lines:
    match = INCLUDE_REGEX.search(line)
    if match:
      h_file_path = os.path.join(os.getcwd(), match.group(2))
      if h_file_path not in h_path_to_include_set:
        print('First include did not match to a known .h file, skipping ' + \
          cc_file_name + ', line: ' + match.group(1))
        return None
      return h_path_to_include_set[h_file_path]
def FindIncludeSet ( input_lines , h_path_to_include_set , cc_file_name ) : for line in input_lines : match = INCLUDE_REGEX . search ( line ) if match : h_file_path = os . path . join ( os . getcwd ( ) , match . group ( 2 ) ) if h_file_path not in h_path_to_include_set : print ( 'First include did not match to a known .h file, skipping ' + cc_file_name + ', line: ' + match . group ( 1 ) ) return None return h_path_to_include_set [ h_file_path ]
Finds and returns the corresponding include set for the given .cc file.
Finds and returns the corresponding include set for the given . cc file .
"""Finds and returns the corresponding include set for the given .cc file.

  This is done by finding the first include in the file and then trying to look
  up an .h file in the passed in map. If not present, then None is returned
  immediately.
  """ # The first include match should be the corresponding .h file, else skip.
input_lines
h_path_to_include_set
cc_file_name