Commit Graph

141 Commits

Author SHA1 Message Date
Łukasz Langa
cf8e998f46 Don't omit escaping the second consecutive quote
This would produce invalid code for strings like `"x = ''; y = \"\""`.
2018-04-11 16:25:47 -07:00
Łukasz Langa
bc6b912fcb Fix an embarrassing UnboundLocalError 2018-04-11 15:49:14 -07:00
Łukasz Langa
cb5aadad74 Automatic parentheses management
Fixes #4
2018-04-11 01:36:18 -07:00
Łukasz Langa
e8ba352777 team += zsol 2018-04-09 15:09:45 -07:00
Łukasz Langa
6f6762dba0 Console formatting nits 2018-04-09 15:09:22 -07:00
Zsolt Dollenstein
ecdbf085a7 Add support for all valid string literals (#115) 2018-04-09 14:36:40 -07:00
Steven M. Vascellaro
ecc294741e README: Add instructions for PyCharm (#81)
Instructions to add `black` to "External Tools" in PyCharm.

Adapted from https://kirankoduru.github.io/python/pylint-with-pycharm.html
2018-04-09 12:00:37 -07:00
Mika⠙
00cadd43ee Document that W503 is not compliant with PEP 8 (#114) 2018-04-06 08:02:11 -07:00
Łukasz Langa
60a8333857 team += autophagy 2018-04-05 14:27:27 -07:00
Łukasz Langa
c4a477bc69 Link VCS integration in documentation 2018-04-05 13:45:16 -07:00
Łukasz Langa
e36b8c71bb [blib2to3] Support non-ASCII identifiers
This support isn't *exactly* right per PEP 3131 as the regex engine is a bit
too limited for that and I didn't want to spend time on Other_ID_Start and
Other_ID_Continue unless they're actually needed.

Hopefully this doesn't slow it down too much.
2018-04-05 02:29:01 -07:00
Zsolt Dollenstein
2e0bb0fa9f Handle arbitrary number of backslashes during string normalization (#110) 2018-04-05 02:28:46 -07:00
Łukasz Langa
30d921f74c Simplify delimiter logic 2018-04-04 16:33:10 -07:00
Łukasz Langa
b7f4ace0d1 acks += asottile 2018-04-04 15:11:48 -07:00
Łukasz Langa
f20e1f61f8 Update change log 2018-04-04 15:10:58 -07:00
Anthony Sottile
12a095f038 Update language-version => language_version (#106) 2018-04-04 15:09:34 -07:00
Anthony Sottile
6dd16bf7ae Add a description for the pre-commit hook (#107)
This string appears on the hooks page on pre-commit.com.
2018-04-04 15:07:57 -07:00
Zsolt Dollenstein
51b3b2624d Handle backslashes in raw strings while normalizing (#105)
In raw strings, a single backslash means a literal backslash. It is also used to escape quotes if it precedes them. This means it is impossible to change the quote type for strings that contain an unescaped version of the other quote type.
Fixes #100
2018-04-04 13:20:46 -07:00
Łukasz Langa
f8e9544c93
Add integration for pre-commit.com (#104)
Fixes #103
2018-04-04 13:19:30 -07:00
Łukasz Langa
0f99987c0a acks += ikatanic 2018-04-04 09:57:12 -07:00
Łukasz Langa
63da5d088c 3.6.5 grammar pickles 2018-04-04 09:55:56 -07:00
Ivan Katanić
1d3d743dfb Fix --check for multiple files (#101) 2018-04-04 09:53:34 -07:00
Łukasz Langa
21c32d80b6 Add --quiet
Fixes #78
2018-04-02 23:17:39 -07:00
Łukasz Langa
2d80366ac1 [blib2to3] Make the grammar pickles faster 2018-04-02 18:28:24 -07:00
Łukasz Langa
65c52a655f 18.4a0 2018-04-01 00:30:45 -07:00
Łukasz Langa
a7ff469869 acks += zsol 2018-04-01 00:14:30 -07:00
Łukasz Langa
2f260514f6 Ignore # fmt: off as inline comment
Black cannot currently support this form due to its generator-based nature.
This is mostly a problem for existing `# yapf: disable` usage as trailing
comment.

Fixes #95
2018-04-01 00:08:09 -07:00
Łukasz Langa
4787294622 Don't insert trailing commas after standalone comments 2018-03-31 23:32:11 -07:00
Łukasz Langa
fcaaf955be Clarify why Black prefers double quotes 2018-03-31 20:56:29 -07:00
Łukasz Langa
1d45f6e6a1 Improve test coverage a bit 2018-03-31 15:46:09 -07:00
Łukasz Langa
a20a3eeb0f Support --diff for both files and stdin
Fixes #87
2018-03-31 15:46:09 -07:00
Zsolt Dollenstein
a42aef7806 Describe how string literals are handled (#96) 2018-03-31 14:42:48 -07:00
Mika⠙
3455389e48 Lines now break before all delimiters (#94)
The default behaviour is that now all lines break *before* delimiters,
instead of afterwards. The special cases for this are commas and
behaviour around args.

Resolves #73
2018-03-31 11:52:11 -07:00
Zsolt Dollenstein
80bd2b3134 Normalize string quotes (#75)
* Normalize string quotes

Convert single-quoted strings to double-quoted. Convert triple single-quoted strings to triple double-quoted. Do not touch any strings where conversion would increase the number of backslashes.

Fixes #51.

* reformat Black itself
2018-03-31 11:21:25 -07:00
Łukasz Langa
4dfec562ed Document asyncio fixes 2018-03-31 01:02:05 -07:00
Łukasz Langa
ba61bfe386 Graceful shutdown in case of cancellation 2018-03-30 19:38:08 -07:00
Carol Willing
2ad642754b
Merge pull request #89 from willingc/doc-conda
use conda for readthedocs
2018-03-30 09:36:40 -04:00
Carol Willing
3c62b9cada float python in doc build 2018-03-30 06:17:44 -04:00
Łukasz Langa
fa159bb357 Mention fix for #22 in changelog 2018-03-29 21:20:50 -07:00
Łukasz Langa
17b22642f5 More comments tests 2018-03-29 21:19:20 -07:00
Łukasz Langa
c55d08d0b9 Remove standalone comment hacks
Now Black properly splits standalone comments within bracketed expressions.
They are treated as another type of split instead of being bolted on with
whitespace prefixes.

A related fix: now multiple comments might appear after a given leaf.

Fixes #22
2018-03-29 21:10:00 -07:00
Carol Willing
d2f29f86f4 use conda for rtd 2018-03-29 20:31:02 -04:00
Łukasz Langa
728c56c986 Remove the test-specific .flake8 file 2018-03-29 15:25:16 -07:00
Josh Holland
3ee9ebb091 Fix --check with multiple files (#88)
Passing multiple files to --check would previously result in the report
being printed as if the files had been written to.
2018-03-29 15:21:18 -07:00
Łukasz Langa
44a2351731 Use imperative language in all docstrings 2018-03-28 19:31:53 -07:00
Łukasz Langa
b901d75deb Show __str__ in UnformattedLines 2018-03-28 19:31:40 -07:00
Łukasz Langa
653aa40579 Add DebugVisitor.show() to documentation under utility functions 2018-03-28 19:28:31 -07:00
Łukasz Langa
7f7b31058a More minor documentation-related changes 2018-03-28 19:03:16 -07:00
Łukasz Langa
d01460d939 Auto-generated documentation-related fixes 2018-03-28 17:43:18 -07:00
Carol Willing
a9f50cd0b5 document classes, functions, exceptions (#82) 2018-03-28 10:12:27 -07:00