Łukasz Langa
6fa60ba39d
Sort default excludes, include the leading slash
2018-05-31 19:09:51 -07:00
Mika⠙
51756a405c
Added --include and --exclude cli options ( #281 )
...
These 2 options allow you to pass in regular expressions that determine
whether files/directories are included or excluded in the recursive file
search.
Fixes #270
2018-05-31 17:51:15 -07:00
Łukasz Langa
8ebbd26888
Add --skip-string-normalization
...
Fixes #118
2018-05-30 12:56:16 -07:00
Łukasz Langa
b2067aabbf
18.5b1
2018-05-29 02:07:09 -07:00
Łukasz Langa
023e61a254
Refactor --pyi and --py36 into FileMode
2018-05-29 01:53:54 -07:00
Łukasz Langa
2057bf6fae
Clean up PEP 257 support
...
I documented the new behavior, added it to the change log, greatly expanded
tests, added support for inner defs and classes, and added Luka to ACKS.
Fixes #196
2018-05-29 00:47:52 -07:00
Luka Sterbic
e818260f1a
Class new line between docstrings / vars / methods ( #219 )
...
Partially addresses #144
2018-05-28 23:48:59 -07:00
Łukasz Langa
e9a940d69e
Remove remains of extra empty lines for flow control statements
2018-05-24 13:32:52 -07:00
Łukasz Langa
bbed104e6d
Reword --pyi and --py36 documentation
2018-05-23 11:52:41 -07:00
Carl Meyer
07b1b2f3dd
Add --pyi and --py36 flags ( #249 )
...
Fixes #244 .
2018-05-23 11:01:26 -07:00
Łukasz Langa
658eb7161d
Fix unstable formatting on trailers omitted from line splitting with comments
...
Fixes #238
2018-05-22 00:38:31 -07:00
Łukasz Langa
9a6c88c7f4
Fix invalid code on stars in long from-imports being wrapped in parentheses
...
Fixes #234
2018-05-21 16:37:29 -07:00
Łukasz Langa
808754af18
Fix optional parentheses being removed within # fmt: off
sections
...
Fixes #224
2018-05-21 15:21:14 -07:00
Łukasz Langa
91de9ea6e3
Fix invalid code in an omitted trailer on large expressions
...
Fixes #237
2018-05-21 12:29:36 -07:00
Łukasz Langa
c891c65b6b
Store grammar pickle caches in CACHE_DIR
...
Fixes #192
Fixes #203
2018-05-19 14:06:27 -07:00
Łukasz Langa
7395f55564
18.5b0
2018-05-17 17:32:43 -07:00
Łukasz Langa
180bc06ede
Don't explode a one-element collection ending with a comma.
2018-05-17 17:32:43 -07:00
Łukasz Langa
87b8df28c4
Fix overly optimistic removal of optional parentheses
...
The current behavior is explained with much detail in
`can_omit_invisible_parens`.
2018-05-17 17:32:43 -07:00
Łukasz Langa
385e3a1049
Don't allow indexing to trigger omitting optional parentheses
2018-05-17 17:32:43 -07:00
Łukasz Langa
31fbd1982f
Avoid treating ellipsis as a dot delimiter
2018-05-17 17:32:43 -07:00
Łukasz Langa
dd4477b701
Always explode data structure literals
...
Fixes #152
2018-05-17 17:32:43 -07:00
Łukasz Langa
3ad0f5855c
Fix multiline strings unnecessarily wrapped in optional parentheses
...
Fixes #215
2018-05-16 19:19:48 -07:00
Łukasz Langa
8c74d7901f
Implement fluent interfaces
...
Fixes #67
2018-05-16 15:21:40 -07:00
Łukasz Langa
1dadeef47a
Consider in
, not in
, is
, is not
operators
2018-05-16 14:46:43 -07:00
Łukasz Langa
f24635635e
For omitting optional parentheses, ignore delimiters of lower priorities
2018-05-16 14:40:23 -07:00
Łukasz Langa
96e68f0341
Report progress on multiple files incrementally
2018-05-16 11:45:32 -07:00
Łukasz Langa
5a47fd13cc
Don't use optional parentheses in unnecessary situations
...
If an expression starts or ends with a bracket and only contains a single
delimiter, don't wrap it in additional optional parentheses. We can use the
brackets for the split.
Fixes #177
Fixes #193
2018-05-15 22:13:16 -07:00
Łukasz Langa
8b64e916f6
Simplify is_trivial_*
methods
2018-05-15 13:25:00 -07:00
Łukasz Langa
634dc5a20e
Warn that right_hand_split()
modifies bracket_depth
in leaves
2018-05-15 12:31:33 -07:00
Jelle Zijlstra
14ba1bf8b6
Add support for pyi files ( #210 )
...
Fixes #207
2018-05-15 15:09:35 -04:00
Łukasz Langa
3eea3aad86
Don't explode trailers that fit in a single line
2018-05-15 01:05:39 -07:00
Łukasz Langa
a677713ebf
Re-use indexes of current iteration in comments_after()
2018-05-15 01:05:39 -07:00
Miguel Gaiowski
c667b85a7f
Check for broken symlinks before checking file data ( #202 )
2018-05-15 01:13:48 -04:00
Jelle Zijlstra
21c8dc85f5
Remove u prefix if unicode_literals is present ( #199 )
2018-05-09 18:26:41 -04:00
Łukasz Langa
90e14e8b61
Don't make parentheses invisible around yield expressions
2018-05-08 23:31:41 -07:00
Łukasz Langa
7595dabb43
Fix docstring of is_vararg
2018-05-08 23:03:59 -07:00
Łukasz Langa
1b51e2c078
Automatic management of parentheses in elif
, too
2018-05-08 21:57:09 -07:00
Łukasz Langa
c9b73b99ac
Support nested lambdas in BracketTracker
2018-05-08 21:57:09 -07:00
Łukasz Langa
793450aeb0
Automatic management of parentheses in assignments
...
Fixes #140
Note: this is an evolution but the end result needs to be different. See
cantfit.py for some good examples on bad formatting caused by this change.
2018-05-08 21:57:09 -07:00
Łukasz Langa
a68dd928e6
Fix docstrings of visit_stmt and normalize_invisible_parens
2018-05-08 21:57:09 -07:00
Łukasz Langa
7811f957f3
Delimit multiline expressions according to math operator priority
...
Fixes #148
2018-05-08 21:57:09 -07:00
Łukasz Langa
1747c388bb
Discover whether a file is Python 3.6+ also by stars in calls
...
Fixes a pathological situation where if a function signature used a trailing
comma but was later reformatted to a single line (with the trailing comma
removed), Black would change its mind whether a file is Python
3.6-compatible between runs.
2018-05-08 21:57:09 -07:00
Łukasz Langa
0967dfcbeb
Don't fail the entire right_hand_split if an optional split failed
...
Fixes splitting long import lines with only a single name.
2018-05-08 10:11:16 -07:00
Łukasz Langa
27a36671fe
Diff version
2018-05-07 11:36:51 -07:00
Łukasz Langa
cfb003f51c
Make parentheses invisible recursively in atoms
...
This fixes non-deterministic formatting when multiple pairs of removable
parentheses are used.
Fixes #183
2018-05-07 11:13:55 -07:00
Łukasz Langa
dc0c14240e
Don't leave invalid trailing comma on imports
...
Fixes #185
2018-05-07 10:40:18 -07:00
Łukasz Langa
b1cd59f267
Formatting nits
2018-05-07 10:22:43 -07:00
snlkapil
6dbb657681
Removing empty parentheses after class name ( #180 )
2018-05-07 10:15:24 -07:00
Christian Heimes
2d9eaafa97
Output something when no files are reformatted ( #190 )
...
Just executing ``black`` without any argument does not print any message
to stdout or stderr. It's rather confusing, because the user doesn't
know what happened.
In ``len(sources) == 0`` case, black now prints ``No paths given. Nothing to
do``.
Signed-off-by: Christian Heimes <christian@python.org>
2018-05-07 10:12:47 -07:00
Christian Heimes
adf4ebd2d9
Remove unnecessary shebang lines ( #189 )
...
Since black.py is not marked as executable, the shebang in black.py serves
no purpose. black should be invoked through its entry point any way.
token.py is an internal module without a __name__ == '__main__' block or
other executable code. It contains just list of constants and small
helper functions.
Signed-off-by: Christian Heimes <christian@python.org>
2018-05-04 13:52:17 -07:00