lib/webrtc-8d2248ff/PRESUBMIT.py
def _CommonChecks(input_api, output_api):
  """Checks common to both upload and commit."""
  results = []
  # Filter out files that are in objc or ios dirs from being cpplint-ed since
  # they do not follow C++ lint rules.
  black_list = input_api.DEFAULT_BLACK_LIST + (
    r".*\bobjc[\\\/].*",
  )
  source_file_filter = lambda x: input_api.FilterSourceFile(x, None, black_list)
  results.extend(_CheckApprovedFilesLintClean(
      input_api, output_api, source_file_filter))
  results.extend(input_api.canned_checks.RunPylint(input_api, output_api,
      black_list=(r'^.*gviz_api\.py$',
                  r'^.*gaeunit\.py$',
                  # Embedded shell-script fakes out pylint.
                  r'^build[\\\/].*\.py$',
                  r'^buildtools[\\\/].*\.py$',
                  r'^chromium[\\\/].*\.py$',
                  r'^mojo.*[\\\/].*\.py$',
                  r'^out.*[\\\/].*\.py$',
                  r'^testing[\\\/].*\.py$',
                  r'^third_party[\\\/].*\.py$',
                  r'^tools[\\\/]clang[\\\/].*\.py$',
                  r'^tools[\\\/]generate_library_loader[\\\/].*\.py$',
                  r'^tools[\\\/]generate_stubs[\\\/].*\.py$',
                  r'^tools[\\\/]gn[\\\/].*\.py$',
                  r'^tools[\\\/]gyp[\\\/].*\.py$',
                  r'^tools[\\\/]isolate_driver.py$',
                  r'^tools[\\\/]mb[\\\/].*\.py$',
                  r'^tools[\\\/]protoc_wrapper[\\\/].*\.py$',
                  r'^tools[\\\/]python[\\\/].*\.py$',
                  r'^tools[\\\/]python_charts[\\\/]data[\\\/].*\.py$',
                  r'^tools[\\\/]refactoring[\\\/].*\.py$',
                  r'^tools[\\\/]swarming_client[\\\/].*\.py$',
                  r'^tools[\\\/]vim[\\\/].*\.py$',
                  # TODO(phoglund): should arguably be checked.
                  r'^tools[\\\/]valgrind-webrtc[\\\/].*\.py$',
                  r'^tools[\\\/]valgrind[\\\/].*\.py$',
                  r'^tools[\\\/]win[\\\/].*\.py$',
                  r'^xcodebuild.*[\\\/].*\.py$',),
      disabled_warnings=['F0401',  # Failed to import x
                         'E0611',  # No package y in x
                         'W0232',  # Class has no __init__ method
                        ],
      pylintrc='pylintrc'))

  # WebRTC can't use the presubmit_canned_checks.PanProjectChecks function since
  # we need to have different license checks in talk/ and webrtc/ directories.
  # Instead, hand-picked checks are included below.

  # .m and .mm files are ObjC files. For simplicity we will consider .h files in
  # ObjC subdirectories ObjC headers.
  objc_filter_list = (r'.+\.m$', r'.+\.mm$', r'.+objc\/.+\.h$')
  # Skip long-lines check for DEPS, GN and GYP files.
  build_file_filter_list = (r'.+\.gyp$', r'.+\.gypi$', r'.+\.gn$', r'.+\.gni$',
      'DEPS')
  eighty_char_sources = lambda x: input_api.FilterSourceFile(x,
      black_list=build_file_filter_list + objc_filter_list)
  hundred_char_sources = lambda x: input_api.FilterSourceFile(x,
      white_list=objc_filter_list)
  results.extend(input_api.canned_checks.CheckLongLines(
      input_api, output_api, maxlen=80, source_file_filter=eighty_char_sources))
  results.extend(input_api.canned_checks.CheckLongLines(
      input_api, output_api, maxlen=100,
      source_file_filter=hundred_char_sources))

  results.extend(input_api.canned_checks.CheckChangeHasNoTabs(
      input_api, output_api))
  results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace(
      input_api, output_api))
  results.extend(input_api.canned_checks.CheckChangeTodoHasOwner(
      input_api, output_api))
  results.extend(_CheckNativeApiHeaderChanges(input_api, output_api))
  results.extend(_CheckNoIOStreamInHeaders(input_api, output_api))
  results.extend(_CheckNoFRIEND_TEST(input_api, output_api))
  results.extend(_CheckGypChanges(input_api, output_api))
  results.extend(_CheckUnwantedDependencies(input_api, output_api))
  results.extend(_CheckJSONParseErrors(input_api, output_api))
  results.extend(_RunPythonTests(input_api, output_api))
  return results
Checks common to both upload and commit.
Checks common to both upload and commit.
Checks common to both upload and commit .
def _CommonChecks(input_api, output_api):
  results = []
  black_list = input_api.DEFAULT_BLACK_LIST + (
    r".*\bobjc[\\\/].*",
  )
  source_file_filter = lambda x: input_api.FilterSourceFile(x, None, black_list)
  results.extend(_CheckApprovedFilesLintClean(
      input_api, output_api, source_file_filter))
  results.extend(input_api.canned_checks.RunPylint(input_api, output_api,
      black_list=(r'^.*gviz_api\.py$',
                  r'^.*gaeunit\.py$',
                  r'^build[\\\/].*\.py$',
                  r'^buildtools[\\\/].*\.py$',
                  r'^chromium[\\\/].*\.py$',
                  r'^mojo.*[\\\/].*\.py$',
                  r'^out.*[\\\/].*\.py$',
                  r'^testing[\\\/].*\.py$',
                  r'^third_party[\\\/].*\.py$',
                  r'^tools[\\\/]clang[\\\/].*\.py$',
                  r'^tools[\\\/]generate_library_loader[\\\/].*\.py$',
                  r'^tools[\\\/]generate_stubs[\\\/].*\.py$',
                  r'^tools[\\\/]gn[\\\/].*\.py$',
                  r'^tools[\\\/]gyp[\\\/].*\.py$',
                  r'^tools[\\\/]isolate_driver.py$',
                  r'^tools[\\\/]mb[\\\/].*\.py$',
                  r'^tools[\\\/]protoc_wrapper[\\\/].*\.py$',
                  r'^tools[\\\/]python[\\\/].*\.py$',
                  r'^tools[\\\/]python_charts[\\\/]data[\\\/].*\.py$',
                  r'^tools[\\\/]refactoring[\\\/].*\.py$',
                  r'^tools[\\\/]swarming_client[\\\/].*\.py$',
                  r'^tools[\\\/]vim[\\\/].*\.py$',
                  r'^tools[\\\/]valgrind-webrtc[\\\/].*\.py$',
                  r'^tools[\\\/]valgrind[\\\/].*\.py$',
                  r'^tools[\\\/]win[\\\/].*\.py$',
                  r'^xcodebuild.*[\\\/].*\.py$',),
      disabled_warnings=['F0401',  
                         'E0611',  
                         'W0232',  
                        ],
      pylintrc='pylintrc'))
  objc_filter_list = (r'.+\.m$', r'.+\.mm$', r'.+objc\/.+\.h$')
  build_file_filter_list = (r'.+\.gyp$', r'.+\.gypi$', r'.+\.gn$', r'.+\.gni$',
      'DEPS')
  eighty_char_sources = lambda x: input_api.FilterSourceFile(x,
      black_list=build_file_filter_list + objc_filter_list)
  hundred_char_sources = lambda x: input_api.FilterSourceFile(x,
      white_list=objc_filter_list)
  results.extend(input_api.canned_checks.CheckLongLines(
      input_api, output_api, maxlen=80, source_file_filter=eighty_char_sources))
  results.extend(input_api.canned_checks.CheckLongLines(
      input_api, output_api, maxlen=100,
      source_file_filter=hundred_char_sources))
  results.extend(input_api.canned_checks.CheckChangeHasNoTabs(
      input_api, output_api))
  results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace(
      input_api, output_api))
  results.extend(input_api.canned_checks.CheckChangeTodoHasOwner(
      input_api, output_api))
  results.extend(_CheckNativeApiHeaderChanges(input_api, output_api))
  results.extend(_CheckNoIOStreamInHeaders(input_api, output_api))
  results.extend(_CheckNoFRIEND_TEST(input_api, output_api))
  results.extend(_CheckGypChanges(input_api, output_api))
  results.extend(_CheckUnwantedDependencies(input_api, output_api))
  results.extend(_CheckJSONParseErrors(input_api, output_api))
  results.extend(_RunPythonTests(input_api, output_api))
  return results
def _CommonChecks ( input_api , output_api ) : results = [ ] black_list = input_api . DEFAULT_BLACK_LIST + ( r".*\bobjc[\\\/].*" , ) source_file_filter = lambda x : input_api . FilterSourceFile ( x , None , black_list ) results . extend ( _CheckApprovedFilesLintClean ( input_api , output_api , source_file_filter ) ) results . extend ( input_api . canned_checks . RunPylint ( input_api , output_api , black_list = ( r'^.*gviz_api\.py$' , r'^.*gaeunit\.py$' , r'^build[\\\/].*\.py$' , r'^buildtools[\\\/].*\.py$' , r'^chromium[\\\/].*\.py$' , r'^mojo.*[\\\/].*\.py$' , r'^out.*[\\\/].*\.py$' , r'^testing[\\\/].*\.py$' , r'^third_party[\\\/].*\.py$' , r'^tools[\\\/]clang[\\\/].*\.py$' , r'^tools[\\\/]generate_library_loader[\\\/].*\.py$' , r'^tools[\\\/]generate_stubs[\\\/].*\.py$' , r'^tools[\\\/]gn[\\\/].*\.py$' , r'^tools[\\\/]gyp[\\\/].*\.py$' , r'^tools[\\\/]isolate_driver.py$' , r'^tools[\\\/]mb[\\\/].*\.py$' , r'^tools[\\\/]protoc_wrapper[\\\/].*\.py$' , r'^tools[\\\/]python[\\\/].*\.py$' , r'^tools[\\\/]python_charts[\\\/]data[\\\/].*\.py$' , r'^tools[\\\/]refactoring[\\\/].*\.py$' , r'^tools[\\\/]swarming_client[\\\/].*\.py$' , r'^tools[\\\/]vim[\\\/].*\.py$' , r'^tools[\\\/]valgrind-webrtc[\\\/].*\.py$' , r'^tools[\\\/]valgrind[\\\/].*\.py$' , r'^tools[\\\/]win[\\\/].*\.py$' , r'^xcodebuild.*[\\\/].*\.py$' , ) , disabled_warnings = [ 'F0401' , 'E0611' , 'W0232' , ] , pylintrc = 'pylintrc' ) ) objc_filter_list = ( r'.+\.m$' , r'.+\.mm$' , r'.+objc\/.+\.h$' ) build_file_filter_list = ( r'.+\.gyp$' , r'.+\.gypi$' , r'.+\.gn$' , r'.+\.gni$' , 'DEPS' ) eighty_char_sources = lambda x : input_api . FilterSourceFile ( x , black_list = build_file_filter_list + objc_filter_list ) hundred_char_sources = lambda x : input_api . FilterSourceFile ( x , white_list = objc_filter_list ) results . extend ( input_api . canned_checks . CheckLongLines ( input_api , output_api , maxlen = 80 , source_file_filter = eighty_char_sources ) ) results . extend ( input_api . canned_checks . CheckLongLines ( input_api , output_api , maxlen = 100 , source_file_filter = hundred_char_sources ) ) results . extend ( input_api . canned_checks . CheckChangeHasNoTabs ( input_api , output_api ) ) results . extend ( input_api . canned_checks . CheckChangeHasNoStrayWhitespace ( input_api , output_api ) ) results . extend ( input_api . canned_checks . CheckChangeTodoHasOwner ( input_api , output_api ) ) results . extend ( _CheckNativeApiHeaderChanges ( input_api , output_api ) ) results . extend ( _CheckNoIOStreamInHeaders ( input_api , output_api ) ) results . extend ( _CheckNoFRIEND_TEST ( input_api , output_api ) ) results . extend ( _CheckGypChanges ( input_api , output_api ) ) results . extend ( _CheckUnwantedDependencies ( input_api , output_api ) ) results . extend ( _CheckJSONParseErrors ( input_api , output_api ) ) results . extend ( _RunPythonTests ( input_api , output_api ) ) return results
Checks common to both upload and commit.
Checks common to both upload and commit .
"""Checks common to both upload and commit.""" # Filter out files that are in objc or ios dirs from being cpplint-ed since # they do not follow C++ lint rules. # Embedded shell-script fakes out pylint. # TODO(phoglund): should arguably be checked. # Failed to import x # No package y in x # Class has no __init__ method # WebRTC can't use the presubmit_canned_checks.PanProjectChecks function since # we need to have different license checks in talk/ and webrtc/ directories. # Instead, hand-picked checks are included below. # .m and .mm files are ObjC files. For simplicity we will consider .h files in # ObjC subdirectories ObjC headers. # Skip long-lines check for DEPS, GN and GYP files.
input_api
output_api