parameters: (gn_files,
                                             input_api,
                                             output_api,
                                             error_formatter=_ReportFileAndLine)
return_statement: return []
docstring: Make sure that warning suppression flags are not added wihtout a reason.
docstring_summary: Make sure that warning suppression flags are not added wihtout a reason.
docstring_tokens: Make sure that warning suppression flags are not added wihtout a reason .
function: def CheckNoWarningSuppressionFlagsAreAdded(gn_files,
                                             input_api,
                                             output_api,
                                             error_formatter=_ReportFileAndLine):
      """Make sure that warning suppression flags are not added wihtout a reason."""
      msg = ('Usage of //build/config/clang:extra_warnings is discouraged '
             'in WebRTC.\n'
             'If you are not adding this code (e.g. you are just moving '
             'existing code) or you want to add an exception,\n'
             'you can add a comment on the line that causes the problem:\n\n'
             '"-Wno-odr"  # no-presubmit-check TODO(bugs.webrtc.org/BUG_ID)\n'
             '\n'
             'Affected files:\n')
      errors = []  # 2-element tuples with (file, line number)
      clang_warn_re = input_api.re.compile(
          r'//build/config/clang:extra_warnings')
      no_presubmit_re = input_api.re.compile(
          r'# no-presubmit-check TODO\(bugs\.webrtc\.org/\d+\)')
      for f in gn_files:
          for line_num, line in f.ChangedContents():
              if clang_warn_re.search(line) and not no_presubmit_re.search(line):
                  errors.append(error_formatter(f.LocalPath(), line_num))
      if errors:
          return [output_api.PresubmitError(msg, errors)]
      return []
function_tokens: def CheckNoWarningSuppressionFlagsAreAdded ( gn_files , input_api , output_api , error_formatter = _ReportFileAndLine ) : msg = ( 'Usage of //build/config/clang:extra_warnings is discouraged ' 'in WebRTC.\n' 'If you are not adding this code (e.g. you are just moving ' 'existing code) or you want to add an exception,\n' 'you can add a comment on the line that causes the problem:\n\n' '"-Wno-odr"  # no-presubmit-check TODO(bugs.webrtc.org/BUG_ID)\n' '\n' 'Affected files:\n' ) errors = [ ] # 2-element tuples with (file, line number) clang_warn_re = input_api . re . compile ( r'//build/config/clang:extra_warnings' ) no_presubmit_re = input_api . re . compile ( r'# no-presubmit-check TODO\(bugs\.webrtc\.org/\d+\)' ) for f in gn_files : for line_num , line in f . ChangedContents ( ) : if clang_warn_re . search ( line ) and not no_presubmit_re . search ( line ) : errors . append ( error_formatter ( f . LocalPath ( ) , line_num ) ) if errors : return [ output_api . PresubmitError ( msg , errors ) ] return [ ]