parameters: (lines, error)
docstring: Checks that the file contains a header guard.
  
      Logs an error if there was an #ifndef guard in a header
      that should be a #pragma once guard.
  
      Args:
        lines: An array of strings, each representing a line of the file.
        error: The function to call with any errors found.
docstring_summary: Checks that the file contains a header guard.
docstring_tokens: Checks that the file contains a header guard .
function: def check_for_header_guard(lines, error):
      """Checks that the file contains a header guard.
  
      Logs an error if there was an #ifndef guard in a header
      that should be a #pragma once guard.
  
      Args:
        lines: An array of strings, each representing a line of the file.
        error: The function to call with any errors found.
      """
  
      for line_number, line in enumerate(lines):
          if line.startswith('#pragma once'):
              return
  
      # If there is no #pragma once, but there is an #ifndef, warn only if it was modified.
      ifndef_line_number = 0
      for line_number, line in enumerate(lines):
          line_split = line.split()
          if len(line_split) >= 2:
              if line_split[0] == '#ifndef' and line_split[1].endswith('_h'):
                  error(line_number, 'build/header_guard', 5,
                      'Use #pragma once instead of #ifndef for header guard.')
                  return
function_tokens: def check_for_header_guard ( lines , error ) : for line_number , line in enumerate ( lines ) : if line . startswith ( '#pragma once' ) : return # If there is no #pragma once, but there is an #ifndef, warn only if it was modified. ifndef_line_number = 0 for line_number , line in enumerate ( lines ) : line_split = line . split ( ) if len ( line_split ) >= 2 : if line_split [ 0 ] == '#ifndef' and line_split [ 1 ] . endswith ( '_h' ) : error ( line_number , 'build/header_guard' , 5 , 'Use #pragma once instead of #ifndef for header guard.' ) return