### 18.3a2 (unreleased)
+* ignore empty bracket pairs while splitting. This avoids very weirdly
+ looking formattings (#34, #35)
+
+* remove a trailing comma if there is a single argument to a call
+
* fixed missing space in numpy-style array indexing (#33)
* fixed spurious space after star-based unary expressions (#31)
bracket_depth = leaf.bracket_depth
if bracket_depth == depth and leaf.type == token.COMMA:
commas += 1
+ if leaf.parent and leaf.parent.type == syms.arglist:
+ commas += 1
+ break
+
if commas > 1:
self.leaves.pop()
return True
raise AssertionError(
f"INTERNAL ERROR: Black produced invalid code: {exc}. "
f"Please report a bug on https://github.com/ambv/black/issues. "
- f"This invalid output might be helpful: {log}",
+ f"This invalid output might be helpful: {log}"
) from None
src_ast_str = '\n'.join(_v(src_ast))
f"INTERNAL ERROR: Black produced code that is not equivalent to "
f"the source. "
f"Please report a bug on https://github.com/ambv/black/issues. "
- f"This diff might be helpful: {log}",
+ f"This diff might be helpful: {log}"
) from None
f"INTERNAL ERROR: Black produced different code on the second pass "
f"of the formatter. "
f"Please report a bug on https://github.com/ambv/black/issues. "
- f"This diff might be helpful: {log}",
+ f"This diff might be helpful: {log}"
) from None
b = 1,
c = 1
d = (1,) + a + (2,)
+e = (1,).count(1)
what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
-
+result = session.query(models.Customer.id).filter(models.Customer.account_id == account_id, models.Customer.email == email_address).order_by(models.Customer.id.asc(),).all()
def gen():
yield from outside_of_generator
a = (yield)
-
async def f():
await some.complicated[0].call(with_args=(True or (1 is not 1)))
b = 1,
c = 1
d = (1,) + a + (2,)
+e = (1,).count(1)
what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
vars_to_remove
)
what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
vars_to_remove
)
+result = session.query(models.Customer.id).filter(
+ models.Customer.account_id == account_id, models.Customer.email == email_address
+).order_by(
+ models.Customer.id.asc()
+).all()
def gen():
models.Customer.account_id == account_id,
models.Customer.email == email_address,
).order_by(
- models.Customer.id.asc(),
+ models.Customer.id.asc()
).all()
def long_lines():
if True:
result = session.query(models.Customer.id).filter(
models.Customer.account_id == account_id, models.Customer.email == email_address
).order_by(
- models.Customer.id.asc(),
+ models.Customer.id.asc()
).all()