]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/black/tests/data/cases/remove_for_brackets.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_for_brackets.py
1 # Only remove tuple brackets after `for`
2 for (k, v) in d.items():
3     print(k, v)
4
5 # Don't touch tuple brackets after `in`
6 for module in (core, _unicodefun):
7     if hasattr(module, "_verify_python3_env"):
8         module._verify_python3_env = lambda: None
9
10 # Brackets remain for long for loop lines
11 for (why_would_anyone_choose_to_name_a_loop_variable_with_a_name_this_long, i_dont_know_but_we_should_still_check_the_behaviour_if_they_do) in d.items():
12     print(k, v)
13
14 for (k, v) in dfkasdjfldsjflkdsjflkdsjfdslkfjldsjfgkjdshgkljjdsfldgkhsdofudsfudsofajdslkfjdslkfjldisfjdffjsdlkfjdlkjjkdflskadjldkfjsalkfjdasj.items():
15     print(k, v)
16
17 # Test deeply nested brackets
18 for (((((k, v))))) in d.items():
19     print(k, v)
20
21 # output
22 # Only remove tuple brackets after `for`
23 for k, v in d.items():
24     print(k, v)
25
26 # Don't touch tuple brackets after `in`
27 for module in (core, _unicodefun):
28     if hasattr(module, "_verify_python3_env"):
29         module._verify_python3_env = lambda: None
30
31 # Brackets remain for long for loop lines
32 for (
33     why_would_anyone_choose_to_name_a_loop_variable_with_a_name_this_long,
34     i_dont_know_but_we_should_still_check_the_behaviour_if_they_do,
35 ) in d.items():
36     print(k, v)
37
38 for (
39     k,
40     v,
41 ) in (
42     dfkasdjfldsjflkdsjflkdsjfdslkfjldsjfgkjdshgkljjdsfldgkhsdofudsfudsofajdslkfjdslkfjldisfjdffjsdlkfjdlkjjkdflskadjldkfjsalkfjdasj.items()
43 ):
44     print(k, v)
45
46 # Test deeply nested brackets
47 for k, v in d.items():
48     print(k, v)