aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/distrib/check_copyright.py
diff options
context:
space:
mode:
authorGravatar Nathaniel Manista <nathaniel@google.com>2016-12-29 17:42:03 +0000
committerGravatar Nathaniel Manista <nathaniel@google.com>2016-12-29 17:42:03 +0000
commitd0386f940e2decde901e707233c596ebc6720f88 (patch)
tree6994992c922e5ae32250a468541beb8ec482764a /tools/distrib/check_copyright.py
parentc15ee83882dad131b7ff9c71e29ec9cc1663781e (diff)
Exempt generated Python from copyright check
Some of these files contain the magic string "DO NOT EDIT" but we do not wish for our tests to depend upon that.
Diffstat (limited to 'tools/distrib/check_copyright.py')
-rwxr-xr-xtools/distrib/check_copyright.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/distrib/check_copyright.py b/tools/distrib/check_copyright.py
index f06e5f1d1a..51852adfd3 100755
--- a/tools/distrib/check_copyright.py
+++ b/tools/distrib/check_copyright.py
@@ -92,9 +92,20 @@ LICENSE_PREFIX = {
'LICENSE': '',
}
-KNOWN_BAD = set([
+_EXEMPT = frozenset((
+ # Generated protocol compiler output.
+ 'examples/python/helloworld/helloworld_pb2.py',
+ 'examples/python/helloworld/helloworld_pb2_grpc.py',
+ 'examples/python/multiplex/helloworld_pb2.py',
+ 'examples/python/multiplex/helloworld_pb2_grpc.py',
+ 'examples/python/multiplex/route_guide_pb2.py',
+ 'examples/python/multiplex/route_guide_pb2_grpc.py',
+ 'examples/python/route_guide/route_guide_pb2.py',
+ 'examples/python/route_guide/route_guide_pb2_grpc.py',
+
+ # An older file originally from outside gRPC.
'src/php/tests/bootstrap.php',
-])
+))
RE_YEAR = r'Copyright (?P<first_year>[0-9]+\-)?(?P<last_year>[0-9]+), Google Inc\.'
@@ -140,7 +151,8 @@ except subprocess.CalledProcessError:
sys.exit(0)
for filename in filename_list:
- if filename in KNOWN_BAD: continue
+ if filename in _EXEMPT:
+ continue
ext = os.path.splitext(filename)[1]
base = os.path.basename(filename)
if ext in RE_LICENSE: