1 #!/usr/bin/env python2.7
3 # Copyright 2015 gRPC authors.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # check for directory level 'README.md' files
18 # check that all implementation and interface files have a \file doxygen comment
25 'include/grpc', 'include/grpc++', 'src/core', 'src/cpp', 'test/core',
29 # which file extensions do we care about
30 _INTERESTING_EXTENSIONS = ['.c', '.h', '.cc']
33 _ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
38 # walk directories, find things
39 printed_banner = False
40 for target_dir in _TARGET_DIRS:
41 for root, dirs, filenames in os.walk(target_dir):
42 if 'README.md' not in filenames:
43 if not printed_banner:
44 print 'Missing README.md'
45 print '================='
51 printed_banner = False
52 for target_dir in _TARGET_DIRS:
53 for root, dirs, filenames in os.walk(target_dir):
54 for filename in filenames:
55 if os.path.splitext(filename)[1] not in _INTERESTING_EXTENSIONS:
57 path = os.path.join(root, filename)
60 if '\\file' not in contents:
61 if not printed_banner:
62 print 'Missing \\file comment'
63 print '======================'
68 assert errors == 0, 'error count = %d' % errors