Commit Graph

396 Commits

Author SHA1 Message Date
Jelle Zijlstra
a37abdcbc5
change some numeric behavior (#469) 2018-08-23 11:55:29 -07:00
Zsolt Dollenstein
c67feaf04f add changelog entry for #468 2018-08-23 12:55:04 +01: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
Zsolt Dollenstein
883689366c Support parsing of async generators in non-async functions (#165)
This is a new syntax added in python3.7, so black can't verify that reformatting will not change the ast unless black itself is run with 3.7. We'll need to change the error message black gives in this case. @ambv any ideas?

Fixes #125.
2018-08-20 14:47:58 +01: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
0c77c58722 committers += jelle 2018-08-18 14:01:57 -07:00
Łukasz Langa
0bf683a659 PyPI downloads badge 2018-08-17 10:59:32 -07: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
Łukasz Langa
b7e216f554 Update README with missing change log, etc. 2018-08-17 10:13:19 -07:00
Miroslav Shubernetskiy
33601ffa6d not enforcing python3.6 for precommit hook (#430)
this should allow precommit hooks to be used with py37
2018-08-17 17:01:29 +01:00
David Hotham
3fb4516872 Remove mappings from Vim plugin. (#417)
They clashed with standard mappings.  Simplest just to let users define
their own.

Fixes #415
2018-08-17 16:45:47 +01:00
Benjamin Wohlwend
450983e333 added instructions for PyCharm File Watcher setup (#418)
* added instructions for PyCharm File Watcher setup

With these steps, PyCharm will run black on every file save.

* Update README.md
2018-08-17 16:44:55 +01:00
Jonty Wareing
2ec4c5f4f9 vim: Restore cursor/window position after format (#433)
Without this the cursor jumps to the top of the window after formatting
occurs.
2018-08-17 16:39:33 +01:00
José Padilla
1e56d02cad Add playground link (#437) 2018-08-17 16:36:57 +01:00
hauntsaninja
9c8caecdd6 Use atom-black plugin for Atom integration (#456) 2018-08-17 16:25:47 +01: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
df965b0558 update to mypy 0.620 and make tests pass again
Fixes #408
2018-07-18 22:10:52 +01:00
Anthony Sottile
c50b107493 pre-commit: use exclusion instead of ever-growing regex (#382) 2018-07-09 22:42:38 +02:00
Zsolt Dollenstein
3316dce22d add change log entry 2018-07-02 18:02:13 +01:00
Zsolt Dollenstein
dd8bde6d2f Improve get_future_imports implementation.
Closes #389.
2018-07-02 17:49:47 +01:00
cclauss
3bdd423891 TravisCI: Test on production Python 3.7 and 3.8-dev (#393) 2018-07-02 18:05:40 +02:00
David Szotten
579a8f9344 Suggest BufWritePre instead of BufWritePost for vi (#376)
closes #321
2018-06-23 00:56:05 -07: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
e1ef57a29e Move INDENT value to the postponed prefix
This makes blib2to3's tree output valid again (which was broken by the previous
fiddling with INDENT and DEDENT nodes).

Fixes #334
2018-06-19 20:44:47 -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
013cb2b374 Update README with missing fixes in Change Log 2018-06-18 22:37:46 -07:00
Łukasz Langa
e4340f5c3e Cache generated comments 2018-06-18 22:37:46 -07:00
Mariatta
257f7193fa Add travis badge and GitHub Fork banner to docs (#365) 2018-06-18 20:12:49 -07:00
Rupert Bedford
d6872cdf87 Add pyls-black to README (#361) 2018-06-16 13:14:51 -07:00
Jelle Zijlstra
9db828c3de Add blank line after constants in stub file (#360)
Fixes #340
2018-06-16 11:53:45 -07:00
Mariatta
af8fd24068 Add code snippet for using black badge in .rst (#356) 2018-06-15 15:12:16 -07:00
Katrin Leinweber
7462ef3ea6 Harmonise with other instances (#347) 2018-06-13 11:49:47 -07:00
Neraste
42a3fe5331 Ignore symbolic links pointing outside of the root directory (#339)
Fixes #338
2018-06-13 00:07:04 -07:00
Joseph Larson
fb34c9e195 Remove reference to deprecated Visual Studio Code extension (#343) 2018-06-12 13:36:55 -07:00
Zsolt Dollenstein
99743d2d09 Exclude profiling data when doing black . in this repo 2018-06-10 09:51:18 +01:00
Zsolt Dollenstein
efcd039482 Fix string normalization eating all backslashes above 3 2018-06-10 09:44:41 +01:00