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

Function update_updatable_copyright

contrib/devtools/copyright_header.py:380–394  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

378 ' '.join(space_split[1:]))
379
380def update_updatable_copyright(filename):
381 file_lines = read_file_lines(filename)
382 index, line = get_updatable_copyright_line(file_lines)
383 if not line:
384 print_file_action_message(filename, "No updatable copyright.")
385 return
386 last_git_change_year = get_most_recent_git_change_year(filename)
387 new_line = create_updated_copyright_line(line, last_git_change_year)
388 if line == new_line:
389 print_file_action_message(filename, "Copyright up-to-date.")
390 return
391 file_lines[index] = new_line
392 write_file_lines(filename, file_lines)
393 print_file_action_message(filename,
394 "Copyright updated! -> %s" % last_git_change_year)
395
396def exec_update_header_year(base_directory):
397 for filename in get_filenames_to_examine(base_directory):

Callers 1

exec_update_header_yearFunction · 0.85

Calls 6

read_file_linesFunction · 0.85
write_file_linesFunction · 0.85

Tested by

no test coverage detected