New issue
Advanced search Search tips

Issue 613654 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Gerrit license check hook for AOSP should allow leading space in C-style comments

Project Member Reported by apronin@chromium.org, May 20 2016

Issue description

The current license check hook in the aosp tree requires the following regex:
^[#/\*]*
[#/\*]* ?Copyright( \([cC]\))? 20[-0-9]{2,7} The Android Open Source Project
[#/\*]* ?
[#/\*]* ?Licensed under the Apache License, Version 2.0 \(the 

... skipped ...

[#/\*]*$

This prevents the following license headers from being accepted (note leading spaces starting from the 2nd line):
/*
 * Copyright (c) 2016 The Android Open Source Project
 *
 ... skipped ...
 */

while this one is accepted:
/*
* Copyright (c) 2016 The Android Open Source Project
*
 ... skipped ...
*/

The regex should allow for a leading space/spaces.
 

Comment 1 by de...@chromium.org, May 20 2016

apronin, fell free to send a CL to fix it. I don't think the checker code has an owner that will take care of these, but it is a good opportunity to learn how the repohooks work :)
@deymo, sure :)
what's the overall approach to regex'es in repohooks/pre-upload.py? I mean how permissive can/should they be?
To illustrate: I'm just inclined to simplify and do "[ #/\*]*" or even "[\s#/\*]* instead of "[#/\*]* ?" at the beg of each line. Though, just narrowly addressing my complaint above would be " *[#/\*]* ?".
Owner: apronin@chromium.org
Status: Started (was: Untriaged)
Status: Assigned (was: Started)

Comment 6 by benhenry@google.com, Jun 27 2016

Status: Started (was: Assigned)
Labels: Type-Bug
Status: WontFix (was: Started)
CL was abandoned.

Sign in to add a comment