Commit Graph

59 Commits

Author SHA1 Message Date
Łukasz Langa
a970a205bc Don't remove the single trailing comma from square bracket indexing
Fixes #59
2018-03-22 16:33:50 -07:00
Łukasz Langa
c9f8983936 Badges. BADGES. BAAADDDGGGEEESSS!!! 2018-03-21 21:46:37 -07:00
Łukasz Langa
df7aacb43e Omit extra space in kwarg unpacking if it's an argument
Fixes #46
2018-03-21 18:35:25 -07:00
Łukasz Langa
92b377556e Don't omit whitespace when the factor is not a math operator
Fixes #55
2018-03-21 18:34:16 -07:00
Łukasz Langa
c7c8c4f501 Pin attrs to >=17.4.0 for @dataclass use
Fixes #54
2018-03-21 18:01:07 -07:00
Łukasz Langa
79b720ca9f Mention how stdio handling works
Fixes #57
2018-03-21 18:00:32 -07:00
Łukasz Langa
afff418fa1 Extra newlines in code examples 2018-03-21 17:14:29 -07:00
Łukasz Langa
4199f141d4 Twine 1.11.0 2018-03-21 17:06:19 -07:00
Łukasz Langa
1b696555e1 18.3a3 2018-03-20 19:05:51 -07:00
Łukasz Langa
5fa38d4c3b Fix tests on 3.7 2018-03-20 19:04:49 -07:00
Łukasz Langa
fd3400d44c Mention joslarson.black-vscode
Fixes #45
2018-03-20 18:57:33 -07:00
Łukasz Langa
b1a7600b0a Treat comments less magically 2018-03-20 18:55:19 -07:00
Łukasz Langa
591bedc2be Support skipping AST printing on test failure 2018-03-20 18:55:04 -07:00
Łukasz Langa
d1e0d79e38 Don't write back stdin to stdout when --check is passed 2018-03-20 18:54:55 -07:00
Łukasz Langa
5bc40707af Fix numpy-style array indexing for real
Fixes #33
2018-03-20 18:54:33 -07:00
Łukasz Langa
e911c79809 Don't remove single empty lines outside of bracketed expressions
Fixes #19
2018-03-20 18:54:19 -07:00
Łukasz Langa
d9c6b99073 Restore ability to format code with legacy usage of async as a name
Fixes #20
Fixes #42
2018-03-20 18:54:01 -07:00
Łukasz Langa
155aa71db0 Update README with stdin information 2018-03-20 18:53:26 -07:00
treuherz
10d8976a79 Add piping from stdin to stdout with a - (#25)
Being able to format code by piping it through the formatter makes it much easier to integrate with tools like google/vim-codefmt or Chiel92/vim-autoformat.
2018-03-19 11:07:10 -07:00
Łukasz Langa
2fa31ff314 More support for numpy tuple indexing 2018-03-17 02:39:53 -07:00
Łukasz Langa
94f50c1461 Update formatting example 2018-03-17 02:13:11 -07:00
Łukasz Langa
9d78a57187 18.3a2 2018-03-17 01:26:30 -07:00
Łukasz Langa
64aae0e57d Native README.md support on PyPI \o/
See: https://dustingram.com/articles/2018/03/16/markdown-descriptions-on-pypi
2018-03-17 01:26:30 -07:00
Łukasz Langa
0c6672890c Set a 3.6+ python-tag for the wheel
Fixes #37
2018-03-17 01:16:30 -07:00
Łukasz Langa
68c71b621f Don't fold postscriptum standalone comment into last statement
This happened when the last statement was a simple statement.

Fixes #18
Fixes #28
2018-03-17 00:59:28 -07:00
Łukasz Langa
6c3ce53b60 Consolidate empty line handling in EmptyLineTracker
Previously, extra newlines left on imports were handled sort of by accident.
Now it's all handled uniformly in one place.
2018-03-17 00:40:21 -07:00
Łukasz Langa
b9c06a0d23 Don't put four empty lines between top-level functions split by a comment 2018-03-16 22:14:43 -07:00
Łukasz Langa
7ad9445caf Describe fix for #21 in README 2018-03-16 21:55:41 -07:00
Łukasz Langa
c90cf42d7c blib2to3: Never put prefixes on DEDENT leaves 2018-03-16 21:47:52 -07:00
Mika⠙
497de7fa08 Line breaks before logical operators (#36)
Fixes #21
2018-03-16 21:45:51 -07:00
Łukasz Langa
28d1442d57 Use implicit defaults for auto_attribs
It reads much nicer.
2018-03-16 17:43:14 -07:00
Łukasz Langa
9c9f6eb6d5 Remove the trailing comma if there is only one argument to a call
This makes it consistent with removing the trailing comma when multiple
arguments to a call fit in a single line. It also makes it a tiny bit more
likely that an expression will fit a line that didn't use to.
2018-03-16 17:32:55 -07:00
Łukasz Langa
6ba615092e Ignore empty bracket pairs while splitting
Fixes #35
2018-03-16 17:09:23 -07:00
Łukasz Langa
2854794249 Add words 2018-03-16 01:05:36 -07:00
Łukasz Langa
0de0851a47 Add flake8 to CI, too 2018-03-16 00:47:01 -07:00
Łukasz Langa
1ec7544ab7 Bump version, update README with current fixes 2018-03-16 00:01:22 -07:00
Łukasz Langa
22ce1e1fc3 Fix spurious space after star-based unary expression
This happened when the operand was a complex expression.

Fixes #31
2018-03-15 23:56:30 -07:00
Łukasz Langa
9fea478022 Also run mypy on test_black.py 2018-03-15 23:55:22 -07:00
Łukasz Langa
fb84d8b2ee Fix numpy-style array indexing
Fixes #33
2018-03-15 23:39:45 -07:00
Łukasz Langa
907dc6c35e Clean up typing ignores, fix build 2018-03-15 23:26:56 -07:00
Łukasz Langa
c87b33c4d5 Add mypy to CI 2018-03-15 23:17:02 -07:00
Łukasz Langa
5fb5cc8c2b Only use trailing commas in function signatures when it's safe
Trailing commas after * or ** in a function signature are only safe for Python 3.6
code.  So now Black checks whether the file was already Python 3.6 to begin
with.  If so, trailing commas are used in such cases.  Otherwise, they're not.

When * and ** don't appear in a function signature, the trailing comma is
always safe.

Fixes #8
2018-03-15 19:44:09 -07:00
Łukasz Langa
c26daa4fd5 Don't split on for-loop variable unpacks
Fixes #23
2018-03-15 19:23:19 -07:00
Łukasz Langa
c85cb48ec2 Fix tests after introducing --check 2018-03-15 17:05:59 -07:00
Łukasz Langa
4c480bcac2 Add --check
Fixes #9
2018-03-15 16:02:57 -07:00
Osaetin Daniel
80f9b14a30 Fixed malformed link to pathlib 2018-03-15 15:04:00 -07:00
Łukasz Langa
5370714c96 Fix spurious space after unary expression
This happened when the operand was a complex expression.

Fixes #15
2018-03-15 14:54:37 -07:00
Łukasz Langa
da3c2f3582 Fix spurious extra spaces after opening parentheses and in default arguments
Fixes #14
Fixes #17
2018-03-15 12:53:23 -07:00
Łukasz Langa
174fc47b78 Fix spurious space in parenthesized set expressions
Fixes #7
2018-03-15 11:28:59 -07:00
Łukasz Langa
e1e89091d1 Fix invalid spacing of dots in relative imports
Fixes #6
Fixes #13
2018-03-15 11:21:53 -07:00