Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor: unnecessary newline inserted after else before function #377

Closed
asottile opened this issue Jun 23, 2018 · 2 comments
Closed

minor: unnecessary newline inserted after else before function #377

asottile opened this issue Jun 23, 2018 · 2 comments
Labels
F: empty lines Wasting vertical space efficiently. T: enhancement New feature or request

Comments

@asottile
Copy link
Contributor

current behaviour

(run against master)

$ black --diff test.py 2> /dev/null
--- test.py	2018-06-23 15:02:32.200993 +0000
+++ test.py	2018-06-23 15:03:00.152248 +0000
@@ -1,6 +1,7 @@
 if False:
     from x import y
 else:
+
     def y():
         pass
 

desired behaviour

(noop)

@ambv
Copy link
Collaborator

ambv commented Jun 23, 2018

This is deliberate. A def directly inside a def will do the same, too. This is to make inner defs more prominent.

We did relax this for first defs in a class so maybe we should generalize this for all indented blocks.

@zsol zsol added T: enhancement New feature or request F: empty lines Wasting vertical space efficiently. labels Jun 28, 2018
@ambv
Copy link
Collaborator

ambv commented Mar 3, 2020

We will be solving this as part of #450.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: empty lines Wasting vertical space efficiently. T: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants