Commit Graph

216 Commits

Author SHA1 Message Date
Felix Kohlgrüber
99c97c3d7f delete unused code (#588) 2018-10-29 11:09:06 +01:00
Łukasz Langa
61feadc0f8
v18.9b0 2018-09-26 13:05:49 -07:00
Łukasz Langa
7145fa325c
Remove whitespace at the beginning of the file
Fixes #399
2018-09-26 12:18:45 -07:00
Łukasz Langa
c6c8ef76a4
Fix mangling pweave and Spyder IDE special comments
Fixes #532.
2018-09-26 09:42:42 -07:00
Łukasz Langa
a4b5c085a3
Move should_explode handling to bracket_split_build_line 2018-09-26 08:53:56 -07:00
Łukasz Langa
1610fd6bc5
Add trailing comma for single as imports, too 2018-09-26 08:26:35 -07:00
Łukasz Langa
0c5c537431
Refactor left_hand_split and right_hand_split to deduplicate line building logic 2018-09-26 07:41:34 -07:00
Zsolt Dollenstein
25d24a10a4 Add trailing comma when a single import doesn't fit on a line. (#504)
Fixes #250.
2018-09-26 13:26:50 +01:00
Zsolt Dollenstein
5f9eb9e4f7 Add underscores to numeric literals with more than six digits (#529) 2018-09-26 12:32:11 +01:00
Tim Swast
2d99573b34 Add .nox directories to default exclude (#525)
[Nox](https://nox.readthedocs.io/) is similar to Tox. It creates a .nox directory that contains virtualenv for testing with different Python versions.
2018-09-25 16:25:58 +01:00
Zsolt Dollenstein
bbf38400ce Uppercase digits in hex literals (#530) 2018-09-25 16:01:56 +01:00
Łukasz Langa
41368138bb
Fix documentation build 2018-09-18 12:04:30 -07:00
Zsolt Dollenstein
a82f186787 blackd: a HTTP server for blackening (#460) 2018-09-17 10:02:25 -07:00
Zsolt Dollenstein
80500748a7
fix unstable formatting when unpacking big tuples (#514)
* fix unstable formatting when unpacking big tuples

* add changelog entry
2018-09-17 12:03:21 +01:00
Zsolt Dollenstein
08f1cdd00b
Make sure async for is not broken up to separate lines (#503)
Fixes #372.
2018-09-08 10:34:08 +01:00
Jelle Zijlstra
a37abdcbc5
change some numeric behavior (#469) 2018-08-23 11:55:29 -07:00
Jelle Zijlstra
b53cb94743 fix bracket match bug (#470)
* fix bracket match bug

* add missing test file
2018-08-23 12:52:07 +01:00
Jelle Zijlstra
8b340e2102
wrap atoms in invisible parens to split adjacent strings (#463) 2018-08-21 21:10:59 -07:00
Jelle Zijlstra
d4f0521754
fix misformatting of floats with leading zeros (#464) 2018-08-20 08:19:25 -07:00
Jelle Zijlstra
b719d85ccc
autodetect Python 3.6 on the basis of underscores (#461) 2018-08-19 21:02:06 -07:00
ceh
66b82ced50 Fix minor typos (#443) 2018-08-19 13:10:06 +01:00
Łukasz Langa
2a357b3606 Nits around numeral normalization. 2018-08-17 10:38:28 -07:00
Łukasz Langa
71bdd727a8 Put missing blank lines after return statements. 2018-08-17 10:29:19 -07:00
Łukasz Langa
ebbb98919d Make schedule_formatting logic less nested. 2018-08-17 10:17:37 -07:00
Łukasz Langa
1dbe77cd91 Simplify caching logic. 2018-08-17 10:14:10 -07:00
Jelle Zijlstra
9e15cacc67 write cache in --check mode (#453)
Fixes #448.

This diff makes us always write to the cache in normal mode, except
if the file is already in the cache, and it makes us write to the
cache in --check mode if the file is already well formatted.

I also fixed some related docstrings.

WriteBack.NO is now used only in tests.
2018-08-17 15:40:37 +01:00
Jelle Zijlstra
cc48bc56ca normalize numeric literals (#454)
Fixes #452

I ended up making a couple of other normalizations to numeric literals
too (lowercase everything, don't allow leading or trailing . in floats,
remove redundant + sign in exponent). I don't care too much about those,
so I'm happy to change the behavior there.

For reference, here is Python's grammar for numeric literals:
https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals
2018-08-17 15:03:58 +01:00
Zsolt Dollenstein
e94a41f92a Look at actual parenthesis when generating ignored leafs.
Fixes #385
2018-07-22 15:30:02 +01:00
Zsolt Dollenstein
dd8bde6d2f Improve get_future_imports implementation.
Closes #389.
2018-07-02 17:49:47 +01:00
Łukasz Langa
41240e9a78 18.6b4 2018-06-21 14:25:07 -07:00
Łukasz Langa
d93e726806 Don't freeze when multiple comments directly precede # fmt: off
Fixes #371
2018-06-21 14:03:01 -07:00
Łukasz Langa
98b6c887da 18.6b3 2018-06-20 12:00:07 -07:00
Łukasz Langa
c2327c83b2 More tests for # fmt: off
Two more known limitations that I don't feel like solving now.  Probably very
low priority.
2018-06-19 23:46:58 -07:00
Łukasz Langa
048efa7476 Trivial nits 2018-06-19 23:08:10 -07:00
Łukasz Langa
2dfa69bb7f Stop Click from crashing Black on invalid environments
Fixes #277
2018-06-19 22:55:57 -07:00
Łukasz Langa
df2ae3bbe6 Use the separate pass for # fmt: off on all code
This removes the hacky exception-based handling that didn't work across
statement boundaries.

Fixes #335
2018-06-19 17:32:41 -07:00
Łukasz Langa
8a8c58252c Support # fmt: off/on pairs within brackets
Fixes #329
2018-06-18 22:37:46 -07:00
Łukasz Langa
e4340f5c3e Cache generated comments 2018-06-18 22:37:46 -07:00
Jelle Zijlstra
9db828c3de Add blank line after constants in stub file (#360)
Fixes #340
2018-06-16 11:53:45 -07:00
Neraste
42a3fe5331 Ignore symbolic links pointing outside of the root directory (#339)
Fixes #338
2018-06-13 00:07:04 -07:00
Zsolt Dollenstein
efcd039482 Fix string normalization eating all backslashes above 3 2018-06-10 09:44:41 +01:00
Łukasz Langa
d240ca25ea Make is_complex_subscript() ignore list literals
This fixes catastrophically quadratic behavior on long lists.
2018-06-09 16:04:09 -07:00
Zsolt Dollenstein
5d0a469e8e Fix string normalization sometimes producing invalid fstrings (#327) 2018-06-09 12:30:49 -07:00
Łukasz Langa
ff2e5dd6e6 18.6b2 2018-06-08 12:07:43 -07:00
Łukasz Langa
8482d38fb4 Return early from comment placement calculation on lines without comments 2018-06-08 12:00:53 -07:00
Loren Carvalho
39e9347687 Add -h as a shortcut for --help (#316) 2018-06-07 19:43:04 -07:00
Zsolt Dollenstein
7f3678885f fix handling of empty triple quoted strings (#314) 2018-06-07 11:41:34 -07:00
Łukasz Langa
489d00ed8f Support pyproject.toml
Fixes #65
2018-06-06 17:02:10 -07:00
Łukasz Langa
92a150d9e4 Fix improper unmodified file caching when -S was used
This will also future-proof the cache to changes to FileMode.
2018-06-06 15:46:30 -07:00
Zsolt Dollenstein
c1a962b885 Don't put a space after * in g = 1, *"x" (#309)
Fixes #305.
2018-06-06 15:44:12 -07:00