Merge branch 'master' into release

Change-Id: I96a006b2f3f3ebf1039aa043720e520d0ca53664
This commit is contained in:
Alexey Polyudov
2020-06-24 10:45:24 -07:00
4 changed files with 41 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[submodule "third_party/ukey2"]
path = third_party/ukey2
url = sso://team/nearby-eng/ukey2
url = https://github.com/google/ukey2
branch = master
[submodule "third_party/protobuf"]
path = third_party/protobuf
+28
View File
@@ -0,0 +1,28 @@
# How to Contribute
We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.
## Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.
## Code reviews
All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.
## Community Guidelines
This project follows [Google's Open Source Community
Guidelines](https://opensource.google.com/conduct/).
+11 -4
View File
@@ -17,6 +17,7 @@
import argparse
import os
import re
import shutil
import sys
@@ -34,6 +35,8 @@ 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.""".split("\n")
headline_match=".*Copyright [0-9,\- ]+ Google.*"
MISSING = 0
HEADLINE = 1
PARTIAL = 2
@@ -41,20 +44,24 @@ FULL = 3
def has_copyright(lines, max_lookup=3):
pos = 0
result = MISSING
headline = re.compile(headline_match)
for line in lines:
pos += 1 # points to the next line
if line.find(copy_header[0]) >= 0:
if headline.match(line) != None:
result = HEADLINE
break
if pos > max_lookup:
return MISSING
result = HEADLINE
return result
for line in copy_header[1:]:
if pos >= len(lines):
return result
if lines[pos].find(line) < 0:
return result
else:
result = PARTIAL
pos += 1
return FULL