Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 948c7d4

Browse files
committed
Add newline characters to the end of saved text files for GH points.
1 parent 28bffa4 commit 948c7d4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

publish.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ def write_language_reference(reference, language):
386386
ordered_referece = get_ordered_dict_with_lists(reference)
387387
with open(ref_file, 'w') as f:
388388
json.dump(ordered_referece, f, indent=2, separators=(',', ': '))
389+
f.write('\n')
389390
if not reference:
390391
print "\t\treference is empty, cuttin' this dead weight!"
391392
if os.path.exists(ref_file):
@@ -466,6 +467,7 @@ def save_report(report, command):
466467
os.makedirs(dirs['reports'])
467468
with open(report_file, 'w') as f:
468469
f.write(string)
470+
f.write("\n")
469471

470472

471473
def save_tree(tree):
@@ -477,6 +479,7 @@ def save_tree(tree):
477479
sorted_new_tree = get_ordered_dict(tree)
478480
with open(files['tree'], 'w') as f:
479481
json.dump(sorted_new_tree, f, indent=4, separators=(',', ': '))
482+
f.write('\n')
480483

481484

482485
def get_ordered_dict(d):

run.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,7 @@ def save_code(code, leaf, language, mode):
888888
os.makedirs(code_folder)
889889
with open(code_path, 'w') as f:
890890
f.write(code)
891+
f.write("\n")
891892
return code_path
892893

893894

@@ -974,6 +975,7 @@ def save_tree(tree, previous_tree):
974975
sorted_new_tree = get_ordered_dict(new_tree)
975976
with open(files['tree'], 'w') as f:
976977
json.dump(sorted_new_tree, f, indent=4, separators=(',', ': '))
978+
f.write('\n')
977979

978980

979981
def save_processed_ids(id_dict, previous_leaf_ids):
@@ -983,6 +985,7 @@ def save_processed_ids(id_dict, previous_leaf_ids):
983985
complete_ids.sort()
984986
with open(files['ids'], 'w') as f:
985987
json.dump(complete_ids, f, indent=4, separators=(',', ': '))
988+
f.write('\n')
986989

987990

988991
def nested_merge(old, update):

0 commit comments

Comments
 (0)