Project
Check a byte-order mark, an existing license comment and a second run so the edit neither duplicates the header nor changes the body.
Keep the first line intact. LibrePatch is a Windows AI coding workspace for discussing license-header edits against your project files, with model suggestions and the resulting code available for review.
text = source.removeprefix("\ufeff")
head, separator, body = text.partition("\n")
if head.startswith("#!"):
result = head + (separator or "\n") + update_spdx(body)
else:
result = update_spdx(source)Check a byte-order mark, an existing license comment and a second run so the edit neither duplicates the header nor changes the body.
Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.
Base URL, credentials and a reachable server.
text = source.removeprefix("\ufeff")
head, separator, body = text.partition("\n")
if head.startswith("#!"):
result = head + (separator or "\n") + update_spdx(body)
else:
result = update_spdx(source)