All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
6 print("The newline above me should be deleted!")
13 print("All the newlines above me should be deleted!")
18 print("No newline above me!")
20 print("There is a newline above me, and that's OK!")
25 # There is a comment here
27 print("The newline above me should not be deleted!")
33 print("The newline above me should be deleted!")
38 print(f"{i}) The line above me should be removed!")
45 print(f"{i}) The lines above me should be removed!")
52 print(f"{i}) The lines above me should be removed!")
55 if random.randint(0, 3) == 0:
57 print("The new line above me is about to be removed!")
60 if random.randint(0, 3) == 0:
65 print("The new lines above me is about to be removed!")
68 if random.randint(0, 3) == 0:
69 if random.uniform(0, 1) > 0.5:
70 print("Two lines above me are about to be removed!")
75 print("The newline above me should be deleted!")
82 print("The newlines above me should be deleted!")
89 print("The newlines above me should be deleted!")
92 with open("/path/to/file.txt", mode="w") as file:
94 file.write("The new line above me is about to be removed!")
97 with open("/path/to/file.txt", mode="w") as file:
101 file.write("The new lines above me is about to be removed!")
104 with open("/path/to/file.txt", mode="r") as read_file:
106 with open("/path/to/output_file.txt", mode="w") as write_file:
108 write_file.writelines(read_file.readlines())
116 print("The newline above me should be deleted!")
120 print("All the newlines above me should be deleted!")
124 print("No newline above me!")
126 print("There is a newline above me, and that's OK!")
130 # There is a comment here
132 print("The newline above me should not be deleted!")
137 print("The newline above me should be deleted!")
141 print(f"{i}) The line above me should be removed!")
145 print(f"{i}) The lines above me should be removed!")
150 print(f"{i}) The lines above me should be removed!")
153 if random.randint(0, 3) == 0:
154 print("The new line above me is about to be removed!")
157 if random.randint(0, 3) == 0:
158 print("The new lines above me is about to be removed!")
161 if random.randint(0, 3) == 0:
162 if random.uniform(0, 1) > 0.5:
163 print("Two lines above me are about to be removed!")
167 print("The newline above me should be deleted!")
171 print("The newlines above me should be deleted!")
176 print("The newlines above me should be deleted!")
179 with open("/path/to/file.txt", mode="w") as file:
180 file.write("The new line above me is about to be removed!")
183 with open("/path/to/file.txt", mode="w") as file:
184 file.write("The new lines above me is about to be removed!")
187 with open("/path/to/file.txt", mode="r") as read_file:
188 with open("/path/to/output_file.txt", mode="w") as write_file:
189 write_file.writelines(read_file.readlines())