]> git.madduck.net Git - etc/vim.git/blob - tests/data/simple_cases/comments5.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:

c8c38813d557da307889f4acaacfb35a8604764f
[etc/vim.git] / tests / data / simple_cases / comments5.py
1 while True:
2     if something.changed:
3         do.stuff()  # trailing comment
4         # Comment belongs to the `if` block.
5     # This one belongs to the `while` block.
6
7     # Should this one, too?  I guess so.
8
9 # This one is properly standalone now.
10
11 for i in range(100):
12     # first we do this
13     if i % 33 == 0:
14         break
15
16     # then we do this
17     print(i)
18     # and finally we loop around
19
20 with open(some_temp_file) as f:
21     data = f.read()
22
23 try:
24     with open(some_other_file) as w:
25         w.write(data)
26
27 except OSError:
28     print("problems")
29
30 import sys
31
32
33 # leading function comment
34 def wat():
35     ...
36     # trailing function comment
37
38
39 # SECTION COMMENT
40
41
42 # leading 1
43 @deco1
44 # leading 2
45 @deco2(with_args=True)
46 # leading 3
47 @deco3
48 def decorated1():
49     ...
50
51
52 # leading 1
53 @deco1
54 # leading 2
55 @deco2(with_args=True)
56 # leading function comment
57 def decorated1():
58     ...
59
60
61 # Note: this is fixed in
62 # Preview.empty_lines_before_class_or_def_with_leading_comments.
63 # In the current style, the user will have to split those lines by hand.
64 some_instruction
65 # This comment should be split from `some_instruction` by two lines but isn't.
66 def g():
67     ...
68
69
70 if __name__ == "__main__":
71     main()