media/PRESUBMIT.py
def _CheckNoLoggingOverrideInHeaders(input_api, output_api):
  """Checks to make sure no .h files include logging_override_if_enabled.h."""
  files = []
  pattern = input_api.re.compile(
    r'^#include\s*"media/base/logging_override_if_enabled.h"',
    input_api.re.MULTILINE)
  for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
    if not f.LocalPath().endswith('.h'):
      continue
    contents = input_api.ReadFile(f)
    if pattern.search(contents):
      files.append(f)

  if len(files):
    return [output_api.PresubmitError(
        'Do not #include "logging_override_if_enabled.h" in header files, '
        'since it overrides DVLOG() in every file including the header. '
        'Instead, only include it in source files.',
        files) ]
  return []
Checks to make sure no .h files include logging_override_if_enabled.h.
Checks to make sure no .h files include logging_override_if_enabled.h.
Checks to make sure no . h files include logging_override_if_enabled . h .
def _CheckNoLoggingOverrideInHeaders(input_api, output_api):
  files = []
  pattern = input_api.re.compile(
    r'^#include\s*"media/base/logging_override_if_enabled.h"',
    input_api.re.MULTILINE)
  for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
    if not f.LocalPath().endswith('.h'):
      continue
    contents = input_api.ReadFile(f)
    if pattern.search(contents):
      files.append(f)
  if len(files):
    return [output_api.PresubmitError(
        'Do not #include "logging_override_if_enabled.h" in header files, '
        'since it overrides DVLOG() in every file including the header. '
        'Instead, only include it in source files.',
        files) ]
  return []
def _CheckNoLoggingOverrideInHeaders ( input_api , output_api ) : files = [ ] pattern = input_api . re . compile ( r'^#include\s*"media/base/logging_override_if_enabled.h"' , input_api . re . MULTILINE ) for f in input_api . AffectedSourceFiles ( input_api . FilterSourceFile ) : if not f . LocalPath ( ) . endswith ( '.h' ) : continue contents = input_api . ReadFile ( f ) if pattern . search ( contents ) : files . append ( f ) if len ( files ) : return [ output_api . PresubmitError ( 'Do not #include "logging_override_if_enabled.h" in header files, ' 'since it overrides DVLOG() in every file including the header. ' 'Instead, only include it in source files.' , files ) ] return [ ]
Checks to make sure no .h files include logging_override_if_enabled.h.
Checks to make sure no . h files include logging_override_if_enabled . h .
"""Checks to make sure no .h files include logging_override_if_enabled.h."""
input_api
output_api