]> git.madduck.net Git - etc/vim.git/commitdiff

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:

Omit extra space in kwarg unpacking if it's an argument
authorŁukasz Langa <lukasz@langa.pl>
Thu, 22 Mar 2018 01:31:58 +0000 (18:31 -0700)
committerŁukasz Langa <lukasz@langa.pl>
Thu, 22 Mar 2018 01:35:25 +0000 (18:35 -0700)
Fixes #46

README.md
black.py
tests/expression.py

index aba30ab2fb0483483e75bb32f28d7bd6185ae2ca..91c9384696c07b097dff54e55e1823376d32771e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -298,6 +298,9 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md).
 * don't omit whitespace if the previous factor leaf wasn't a math
   operator (#55)
 
+* omit extra space in kwarg unpacking if it's the first argument (#46)
+
+
 ### 18.3a3
 
 * don't remove single empty lines outside of bracketed expressions
index 0dd763073622d2ec1d0234b46cf5cd4e42bfe607..d3e0761e273a58fe4b7318827e12bbd853f53eea 100644 (file)
--- a/black.py
+++ b/black.py
@@ -867,21 +867,22 @@ def whitespace(leaf: Leaf) -> str:  # noqa C901
 
         if prevp.type == token.EQUAL:
             if prevp.parent and prevp.parent.type in {
-                syms.typedargslist,
-                syms.varargslist,
-                syms.parameters,
                 syms.arglist,
                 syms.argument,
+                syms.parameters,
+                syms.typedargslist,
+                syms.varargslist,
             }:
                 return NO
 
         elif prevp.type == token.DOUBLESTAR:
             if prevp.parent and prevp.parent.type in {
-                syms.typedargslist,
-                syms.varargslist,
-                syms.parameters,
                 syms.arglist,
+                syms.argument,
                 syms.dictsetmaker,
+                syms.parameters,
+                syms.typedargslist,
+                syms.varargslist,
             }:
                 return NO
 
index c18942ec3522f058dfd7f173d669bfb07385e932..91e5465440799856479837e4f73e56ec2fe7e83e 100644 (file)
@@ -75,6 +75,7 @@ call(arg, kwarg='hey')
 call(arg, another, kwarg='hey', **kwargs)
 call(this_is_a_very_long_variable_which_will_force_a_delimiter_split, arg, another, kwarg='hey', **kwargs)  # note: no trailing comma pre-3.6
 call(*gidgets[:2])
+call(**self.screen_kwargs)
 lukasz.langa.pl
 call.me(maybe)
 1 .real
@@ -237,6 +238,7 @@ call(
     **kwargs
 )  # note: no trailing comma pre-3.6
 call(*gidgets[:2])
+call(**self.screen_kwargs)
 lukasz.langa.pl
 call.me(maybe)
 1 .real