]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/black/tests/data/cases/remove_newline_after_code_block_open.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

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.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '882d8795c6ff65c02f2657e596391748d1b6b7f5'
[etc/vim.git] / .vim / bundle / black / tests / data / cases / remove_newline_after_code_block_open.py
1 import random
2
3
4 def foo1():
5
6     print("The newline above me should be deleted!")
7
8
9 def foo2():
10
11
12
13     print("All the newlines above me should be deleted!")
14
15
16 def foo3():
17
18     print("No newline above me!")
19
20     print("There is a newline above me, and that's OK!")
21
22
23 def foo4():
24
25     # There is a comment here
26
27     print("The newline above me should not be deleted!")
28
29
30 class Foo:
31     def bar(self):
32
33         print("The newline above me should be deleted!")
34
35
36 for i in range(5):
37
38     print(f"{i}) The line above me should be removed!")
39
40
41 for i in range(5):
42
43
44
45     print(f"{i}) The lines above me should be removed!")
46
47
48 for i in range(5):
49
50     for j in range(7):
51
52         print(f"{i}) The lines above me should be removed!")
53
54
55 if random.randint(0, 3) == 0:
56
57     print("The new line above me is about to be removed!")
58
59
60 if random.randint(0, 3) == 0:
61
62
63
64
65     print("The new lines above me is about to be removed!")
66
67
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!")
71
72
73 while True:
74
75     print("The newline above me should be deleted!")
76
77
78 while True:
79
80
81
82     print("The newlines above me should be deleted!")
83
84
85 while True:
86
87     while False:
88
89         print("The newlines above me should be deleted!")
90
91
92 with open("/path/to/file.txt", mode="w") as file:
93
94     file.write("The new line above me is about to be removed!")
95
96
97 with open("/path/to/file.txt", mode="w") as file:
98
99
100
101     file.write("The new lines above me is about to be removed!")
102
103
104 with open("/path/to/file.txt", mode="r") as read_file:
105
106     with open("/path/to/output_file.txt", mode="w") as write_file:
107
108         write_file.writelines(read_file.readlines())
109
110 # output
111
112 import random
113
114
115 def foo1():
116     print("The newline above me should be deleted!")
117
118
119 def foo2():
120     print("All the newlines above me should be deleted!")
121
122
123 def foo3():
124     print("No newline above me!")
125
126     print("There is a newline above me, and that's OK!")
127
128
129 def foo4():
130     # There is a comment here
131
132     print("The newline above me should not be deleted!")
133
134
135 class Foo:
136     def bar(self):
137         print("The newline above me should be deleted!")
138
139
140 for i in range(5):
141     print(f"{i}) The line above me should be removed!")
142
143
144 for i in range(5):
145     print(f"{i}) The lines above me should be removed!")
146
147
148 for i in range(5):
149     for j in range(7):
150         print(f"{i}) The lines above me should be removed!")
151
152
153 if random.randint(0, 3) == 0:
154     print("The new line above me is about to be removed!")
155
156
157 if random.randint(0, 3) == 0:
158     print("The new lines above me is about to be removed!")
159
160
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!")
164
165
166 while True:
167     print("The newline above me should be deleted!")
168
169
170 while True:
171     print("The newlines above me should be deleted!")
172
173
174 while True:
175     while False:
176         print("The newlines above me should be deleted!")
177
178
179 with open("/path/to/file.txt", mode="w") as file:
180     file.write("The new line above me is about to be removed!")
181
182
183 with open("/path/to/file.txt", mode="w") as file:
184     file.write("The new lines above me is about to be removed!")
185
186
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())