Bad license header or false positive during upload

112 views
Skip to first unread message

Mike Meade

unread,
Feb 7, 2018, 7:37:49 PM2/7/18
to chromium-dev
Hello all,

I have the following license header in a file I am adding:

# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

I've verified that it matches the regex the error says doesn't match. I first thought it could be because of line endings (this is on Windows) but I also verified that all lines end with \n.

>>> re.match(regex, file_text).group(0)
'# Copyright 2018 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n'

However when I run upload I get this:

** Presubmit Warnings **
License must match:
.*? Copyright (\(c\) )?(2018|2017|2016|2015|2014|2013|2012|2011|2010|2009|2008|2007|2006|2006-2008|2006-2009|2006-2010) The Chromium Authors\. All rights reserved\.\n.*? Use of this source code is governed by a BSD-style license that can be\n.*? found in the LICENSE file\.(?: \*/)?\n
Found a bad license header in these files:
  chrome\test\mini_installer\test_chrome_with_chromedriver.py

Presubmit checks took 3.8s to calculate.

There were presubmit warnings. Are you sure you wish to continue? (y/N):

Is it safe to ignore this warning? Could there be a bug here? Is there something I am missing?

Thanks,
Mike


--

Mike Meade | SETI | mme...@google.com | 425-208-1210

Lei Zhang

unread,
Feb 7, 2018, 7:57:25 PM2/7/18
to mme...@google.com, chromium-dev
Is your git CRLF setting correct?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAK%3D_fY2aJcKG1xEWcQPd_BG-xRoBFdO%2B93o5fdqWrB0ftfm%2BAQ%40mail.gmail.com.

Mike Meade

unread,
Feb 7, 2018, 8:22:42 PM2/7/18
to Lei Zhang, chromium-dev
I've tried it with true, false, and auto and it repros. I also have this in my .gitattributes:

# Stop Windows python license check presubmit errors by forcing LF checkout.
*.py  text eol=lf

# Force LF checkout of the pins files to avoid transport_security_state_generator errors.
/net/http/*.pins  text eol=lf

Lei Zhang

unread,
Feb 7, 2018, 8:48:22 PM2/7/18
to Mike Meade, chromium-dev
Mike uploaded the CL anyway, and I downloaded it with "git cl patch 907952 --force" locally on Linux. The file looks fine here and "git cl presubmit" passes on Linux. I patched it in on Windows, and "git cl presubmit" passed their too.
Reply all
Reply to author
Forward
0 new messages