mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
copyright: do not add extra blank line (#2502)
This commit is contained in:
parent
c2e2e007e7
commit
7363d73500
@ -126,6 +126,7 @@ def process_file(filename, check_only):
|
||||
lines = fp.readlines()
|
||||
# Pretend that the file has extra empty line at the end to handle files,
|
||||
# which consist only of the copyright notice and nothing else.
|
||||
# label: ADD_BLANK_LINE
|
||||
lines.append('\n')
|
||||
|
||||
# Process the file:
|
||||
@ -209,7 +210,8 @@ def process_file(filename, check_only):
|
||||
# copyright header existed, but was out of date, replace it.
|
||||
fp.write("".join(before_header))
|
||||
fp.write(header)
|
||||
fp.write("".join(after_header))
|
||||
# remove additional blank line added at ADD_BLANK_LINE
|
||||
fp.write("".join(after_header[:-1]))
|
||||
elif 'skip' in filetypes[ext]:
|
||||
# no copyright header, but file type requires skipping lines
|
||||
skip_prefix = filetypes[ext]['skip']
|
||||
|
Loading…
Reference in New Issue
Block a user