

def CheckChangeOnUpload(input_api, output_api):
  report = []
  report.extend(input_api.canned_checks.PanProjectChecks(
      input_api, output_api))
  return report


def CheckChangeOnCommit(input_api, output_api):
  report = []
  report.extend(input_api.canned_checks.PanProjectChecks(
      input_api, output_api))
  report.extend(input_api.canned_checks.CheckTreeIsOpen(
      input_api, output_api,
      'http://gyp-status.appspot.com/status',
      'http://gyp-status.appspot.com/current'))
  return report


def GetPreferredTrySlaves():
  return ['gyp-win32', 'gyp-win64', 'gyp-linux', 'gyp-mac']



def CheckChangeOnUpload(input_api, output_api):
  report = []
  report.extend(input_api.canned_checks.PanProjectChecks(
      input_api, output_api))
  return report


def CheckChangeOnCommit(input_api, output_api):
  report = []
  license = (
      r'.*? Copyright \(c\) %(year)s Google Inc\. All rights reserved\.\n'
      r'.*? Use of this source code is governed by a BSD-style license that '
        r'can be\n'
      r'.*? found in the LICENSE file\.\n'
  ) % {
      'year': input_api.time.strftime('%Y'),
  }

  report.extend(input_api.canned_checks.PanProjectChecks(
      input_api, output_api, license_header=license))
  report.extend(input_api.canned_checks.CheckTreeIsOpen(
      input_api, output_api,
      'http://gyp-status.appspot.com/status',
      'http://gyp-status.appspot.com/current'))
  return report


def GetPreferredTrySlaves():
  return ['gyp-win32', 'gyp-win64', 'gyp-linux', 'gyp-mac']

Fix the license header regex.
Fix the license header regex.

Most of the files are attributed to Google Inc so I used this instead of
Chromium Authors.

R=mark@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7108074

git-svn-id: e7e1075985beda50ea81ac4472467b4f6e91fc78@936 78cadc50-ecff-11dd-a971-7dbc132099af

  
  
  def CheckChangeOnUpload(input_api, output_api):
    report = []
    report.extend(input_api.canned_checks.PanProjectChecks(
        input_api, output_api))
    return report
  
  
  def CheckChangeOnCommit(input_api, output_api):
    report = []
+   license = (
+       r'.*? Copyright \(c\) %(year)s Google Inc\. All rights reserved\.\n'
+       r'.*? Use of this source code is governed by a BSD-style license that '
+         r'can be\n'
+       r'.*? found in the LICENSE file\.\n'
+   ) % {
+       'year': input_api.time.strftime('%Y'),
+   }
+ 
    report.extend(input_api.canned_checks.PanProjectChecks(
-       input_api, output_api))
+       input_api, output_api, license_header=license))
    report.extend(input_api.canned_checks.CheckTreeIsOpen(
        input_api, output_api,
        'http://gyp-status.appspot.com/status',
        'http://gyp-status.appspot.com/current'))
    return report
  
  
  def GetPreferredTrySlaves():
    return ['gyp-win32', 'gyp-win64', 'gyp-linux', 'gyp-mac']
  
Fix the license header regex.
## Code Before:


def CheckChangeOnUpload(input_api, output_api):
  report = []
  report.extend(input_api.canned_checks.PanProjectChecks(
      input_api, output_api))
  return report


def CheckChangeOnCommit(input_api, output_api):
  report = []
  report.extend(input_api.canned_checks.PanProjectChecks(
      input_api, output_api))
  report.extend(input_api.canned_checks.CheckTreeIsOpen(
      input_api, output_api,
      'http://gyp-status.appspot.com/status',
      'http://gyp-status.appspot.com/current'))
  return report


def GetPreferredTrySlaves():
  return ['gyp-win32', 'gyp-win64', 'gyp-linux', 'gyp-mac']

## Instruction:
Fix the license header regex.
## Code After:


def CheckChangeOnUpload(input_api, output_api):
  report = []
  report.extend(input_api.canned_checks.PanProjectChecks(
      input_api, output_api))
  return report


def CheckChangeOnCommit(input_api, output_api):
  report = []
  license = (
      r'.*? Copyright \(c\) %(year)s Google Inc\. All rights reserved\.\n'
      r'.*? Use of this source code is governed by a BSD-style license that '
        r'can be\n'
      r'.*? found in the LICENSE file\.\n'
  ) % {
      'year': input_api.time.strftime('%Y'),
  }

  report.extend(input_api.canned_checks.PanProjectChecks(
      input_api, output_api, license_header=license))
  report.extend(input_api.canned_checks.CheckTreeIsOpen(
      input_api, output_api,
      'http://gyp-status.appspot.com/status',
      'http://gyp-status.appspot.com/current'))
  return report


def GetPreferredTrySlaves():
  return ['gyp-win32', 'gyp-win64', 'gyp-linux', 'gyp-mac']
