Add copy-and-pasteable license text into license check errors

BUG=b/175892198
TEST=http://sponge2/1829fd1a-8d7f-4d1b-9fc1-54f310b66eba
RELEASE_NOTE=None

Change-Id: I2cd37cca1cea732273cdaf4e46f2f8764a11f70c
Reviewed-on: https://cos-review.googlesource.com/c/cos/repohooks/+/35548
Reviewed-by: Robert Kolchmeyer <rkolchmeyer@google.com>
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
diff --git a/pre-upload.py b/pre-upload.py
index cf67632..3062d7e 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -1513,6 +1513,23 @@
 [\->#/\*]*$
 """
   )
+  COS_LICENSE_HEADER_SAMPLE = (
+      r"""
+// Copyright %s Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+    """ % datetime.date.today().year
+  )
   cos_license_re = re.compile(COS_LICENSE_HEADER, re.MULTILINE)
 
   CROS_LICENSE_HEADER = (
@@ -1523,6 +1540,13 @@
       r'.*found in the LICENSE file\.'
       r'\n'
   )
+  CROS_LICENSE_HEADER_SAMPLE = (
+      r"""
+// Copyright %s The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+      """ % datetime.date.today().year
+  )
   cros_license_re = re.compile(CROS_LICENSE_HEADER, re.MULTILINE)
 
   included, excluded = _parse_common_inclusion_options(options)
@@ -1570,13 +1594,15 @@
   errors = []
   if new_bad_files:
     msg = '%s:\n%s\n%s' % (
-        'License must match', cos_license_re.pattern,
+        'License must match standards, see sample here',
+        COS_LICENSE_HEADER_SAMPLE,
         'Include Google copyright and Apache 2.0 license in new files:')
     errors.append(HookFailure(msg, new_bad_files))
   if bad_files:
     msg = '%s:\n%s\n%s' % (
         'Unless the file was previously using ChromiumOS license and '
-        'copyright, license must match', cos_license_re.pattern,
+        'copyright, license must match, see sample here',
+        CROS_LICENSE_HEADER_SAMPLE,
         'Found a bad header in these files:')
     errors.append(HookFailure(msg, bad_files))
   if bad_year_files: