MCPcopy Create free account
hub / github.com/ElementsProject/elements / print_report

Function print_report

contrib/devtools/copyright_header.py:187–258  ·  view source on GitHub ↗
(file_infos, verbose)

Source from the content-addressed store, hash-verified

185 print("\t%s" % filename)
186
187def print_report(file_infos, verbose):
188 print(SEPARATOR)
189 examined = [i['filename'] for i in file_infos]
190 print("%d files examined according to INCLUDE and EXCLUDE fnmatch rules" %
191 len(examined))
192 print_filenames(examined, verbose)
193
194 print(SEPARATOR)
195 print('')
196 zero_copyrights = [i['filename'] for i in file_infos if
197 i['all_copyrights'] == 0]
198 print("%4d with zero copyrights" % len(zero_copyrights))
199 print_filenames(zero_copyrights, verbose)
200 one_copyright = [i['filename'] for i in file_infos if
201 i['all_copyrights'] == 1]
202 print("%4d with one copyright" % len(one_copyright))
203 print_filenames(one_copyright, verbose)
204 two_copyrights = [i['filename'] for i in file_infos if
205 i['all_copyrights'] == 2]
206 print("%4d with two copyrights" % len(two_copyrights))
207 print_filenames(two_copyrights, verbose)
208 three_copyrights = [i['filename'] for i in file_infos if
209 i['all_copyrights'] == 3]
210 print("%4d with three copyrights" % len(three_copyrights))
211 print_filenames(three_copyrights, verbose)
212 four_or_more_copyrights = [i['filename'] for i in file_infos if
213 i['all_copyrights'] >= 4]
214 print("%4d with four or more copyrights" % len(four_or_more_copyrights))
215 print_filenames(four_or_more_copyrights, verbose)
216 print('')
217 print(SEPARATOR)
218 print('Copyrights with dominant style:\ne.g. "Copyright (c)" and '
219 '"<year>" or "<startYear>-<endYear>":\n')
220 for holder_name in EXPECTED_HOLDER_NAMES:
221 dominant_style = [i['filename'] for i in file_infos if
222 i['dominant_style'][holder_name]]
223 if len(dominant_style) > 0:
224 print("%4d with '%s'" % (len(dominant_style),
225 holder_name.replace('\n', '\\n')))
226 print_filenames(dominant_style, verbose)
227 print('')
228 print(SEPARATOR)
229 print('Copyrights with year list style:\ne.g. "Copyright (c)" and '
230 '"<year1>, <year2>, ...":\n')
231 for holder_name in EXPECTED_HOLDER_NAMES:
232 year_list_style = [i['filename'] for i in file_infos if
233 i['year_list_style'][holder_name]]
234 if len(year_list_style) > 0:
235 print("%4d with '%s'" % (len(year_list_style),
236 holder_name.replace('\n', '\\n')))
237 print_filenames(year_list_style, verbose)
238 print('')
239 print(SEPARATOR)
240 print('Copyrights with no "(c)" style:\ne.g. "Copyright" and "<year>" or '
241 '"<startYear>-<endYear>":\n')
242 for holder_name in EXPECTED_HOLDER_NAMES:
243 without_c_style = [i['filename'] for i in file_infos if
244 i['without_c_style'][holder_name]]

Callers 1

exec_reportFunction · 0.85

Calls 1

print_filenamesFunction · 0.85

Tested by

no test coverage detected