Brandt Bucher
b073c9a4e9
Force parentheses between unary op and binary power. ( #909 )
2019-06-29 09:35:16 -07:00
Zsolt Dollenstein
8f380911e0
Pin comment to single leaf in invisible parens ( #872 )
2019-06-15 07:29:09 +01:00
dylanjblack
9394de150e
Fix trailing comma for function with one arg ( #880 ) ( #891 )
...
Modified maybe_remove_trailing_comma to remove trailing commas for
typedarglists (in addition to arglists), and updated line split logic
to ensure that all lines in a function definition that contain only one
arg have a trailing comma.
2019-06-14 21:49:49 -07:00
Zsolt Dollenstein
519c06a8cc
Don't introduce quotes to f-string sub-expressions on string boundaries ( #871 )
2019-05-26 11:58:00 +02:00
Jelle Zijlstra
957ba24bb6
remove obviously unnecessary parentheses ( #850 )
...
Fixes #548
2019-05-15 21:11:04 -07:00
Benjamin Woodruff
448885b256
Move tokenizer config onto grammar, rename flag
...
Based on the feedback in
https://github.com/python/black/pull/845#issuecomment-490622711
- Remove TokenizerConfig, and add a field to Grammar instead.
- Pass the Grammar to the tokenizer.
- Rename `ASYNC_IS_RESERVED_KEYWORD` to `ASYNC_KEYWORDS` and
`ASYNC_IS_VALID_IDENTIFIER` to `ASYNC_IDENTIFIERS`.
2019-05-09 17:59:29 +02:00
Benjamin Woodruff
f8617f975d
Add support for always tokenizing async/await as keywords
...
Fixes #593
I looked into this bug with @ambv and @carljm, and we reached the
conclusion was that it's not possible for the tokenizer to determine if
async/await is a keyword inside all possible generators without breaking
the grammar for older versions of Python.
Instead, we introduce a new tokenizer mode for Python 3.7+ that will
cause all async/await instances to get parsed as a reserved keyword,
which should fix async/await inside generators.
2019-05-09 17:59:29 +02:00
Jason Fried
866be06646
Make --safe work for Python2.7 syntax, by using typed_ast for safe validation ( #840 )
2019-05-08 07:45:59 -07:00
Carl Meyer
6fdbdb4ee3
Avoid unstable formatting when comment follows escaped newline. ( #839 ). Fixes #767 .
2019-05-08 09:53:20 -04:00
Jelle Zijlstra
de806405d2
Add parentheses around tuple unpack assignment ( #832 )
...
Fixes #656
2019-05-07 09:51:28 -04:00
Jelle Zijlstra
18119d3846
Remove unnecessary parens around yield ( #834 )
2019-05-07 09:49:50 -04:00
Jelle Zijlstra
6b994fdb8a
fix handling of comments in from imports ( #829 )
...
Fixes #671
2019-05-06 09:13:25 -04:00
Jelle Zijlstra
cea13f4984
Split the TRAILING_COMMA feature ( #763 )
2019-03-25 08:22:02 -07:00
Jelle Zijlstra
ba64fc757c
redo grammar selection, add test ( #765 )
2019-03-16 11:35:18 -07:00
Jelle Zijlstra
b396f13761
fix incorrect call ( #762 )
2019-03-15 18:39:08 +01:00
Andy Freeland
d6db1c12a8
Fix print() function on Python 2 ( #754 )
...
Fixes #752
2019-03-14 16:42:54 -07:00
Łukasz Langa
6af55d8851
Mention tab comment fixes, extend tests
2019-03-14 17:17:50 +01:00
Łukasz Langa
ca9ad698ef
Enhance the type comment patch
2019-03-14 16:26:41 +01:00
Anders-Petter Ljungquist
227c2d77b4
Changes default logger used by blib2to3 Driver ( #732 )
...
... to stop it from spamming the log when black is used as a library in another
python application.
When used indirectly by black the logger initiated in `driver.py` will emit
thousands of debug messages making the debug level of the root logger virtually
useless. By getting a named logger instead the verbosity of logging from this
module can easily be controlled by setting its log level.
Fixes #715
2019-03-14 13:39:42 +01:00
Jelle Zijlstra
ea55ff2878
remove Python implementation-specific versions ( #736 )
2019-03-07 16:34:34 -08:00
Jelle Zijlstra
21ab37a5d9
remove --py36 ( #724 )
...
Fixes #703 .
2019-02-24 09:15:03 -08:00
Jelle Zijlstra
f5b14b1afd
split long del statements into multiple lines ( #698 )
...
Fixes #693
2019-02-22 22:00:40 -08:00
Zsolt Dollenstein
250ba7f04b
Remove numeric underscore normalization ( #696 )
2019-02-06 19:16:49 -08:00
Jelle Zijlstra
36d3c516d3
Add --target-version
option to allow users to choose targeted Python versions ( #618 )
2019-02-06 18:43:50 -08:00
Samuel Cormier-Iijima
66aa676278
Fix indent calculation with tabs when computing prefixes ( #595 )
...
Closes #262
2019-02-04 18:55:01 -08:00
Jan Hnátek
f6643c4f0c
Fix location of expression.diff in the change notification message ( #670 )
2019-02-04 18:42:42 -08:00
Utsav Shah
024c9cab55
Add support for special comments in multiline functions ( #642 )
2019-01-05 11:20:12 -08:00
Jim Brännlund
4809e365d4
Silence expected stderr ( #621 )
...
* Silence expected stderr output during test
* Change based on PR comment
2018-11-29 21:43:22 +00:00
Jelle Zijlstra
8d58827376
Refactor Travis ( #614 )
...
Fixes #305
- Run separate jobs for mypy, self-formatting, flake8, and test runs.
- Don't run flake8 in 3.8 because it is broken (and we can't really expect flake8 to always keep up with 3.8 development).
- Fix unused variable in test
2018-11-20 08:42:43 -08:00
Łukasz Langa
c6c8ef76a4
Fix mangling pweave and Spyder IDE special comments
...
Fixes #532 .
2018-09-26 09:42:42 -07:00
Łukasz Langa
1610fd6bc5
Add trailing comma for single as
imports, too
2018-09-26 08:26:35 -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
Zsolt Dollenstein
bbf38400ce
Uppercase digits in hex literals ( #530 )
2018-09-25 16:01:56 +01: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
Zsolt Dollenstein
66a6be642c
fix lint errors
2018-08-26 21:27:33 +01:00
Zsolt Dollenstein
401836d02e
add test case for preserving newlines from stdin
2018-08-26 21:19:22 +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
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
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
Zsolt Dollenstein
dd8bde6d2f
Improve get_future_imports implementation.
...
Closes #389 .
2018-07-02 17:49:47 +01: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
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
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
2cf125a97c
Add failing test data
2018-06-09 23:27:00 -07:00
Łukasz Langa
ec31ee967d
Make test_black.py work in profilers
2018-06-09 18:49:39 -07:00
Łukasz Langa
94ebcb5085
Move profiling data out of tests/data
2018-06-09 15:48:41 -07:00
Zsolt Dollenstein
5d0a469e8e
Fix string normalization sometimes producing invalid fstrings ( #327 )
2018-06-09 12:30:49 -07:00
Łukasz Langa
8482d38fb4
Return early from comment placement calculation on lines without comments
2018-06-08 12:00:53 -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
f71db23824
Move test data to data
2018-06-06 15:48:38 -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
Zsolt Dollenstein
33baccd88e
Change tests with stdin/out to exercise black.main ( #307 )
2018-06-06 15:42:50 -07:00
Łukasz Langa
d638d56e0e
Fix unnecessary parentheses when a line contains multiline strings
...
Fixes #232
2018-06-04 21:27:51 -07:00
Łukasz Langa
23a00f0515
Fix long trivial assignments being wrapped in unnecessary parentheses
...
Fixes #273
2018-06-04 20:24:50 -07:00
Łukasz Langa
7fc6ce9906
Fix handling of empty files
2018-06-04 19:04:29 -07:00
Łukasz Langa
bbc09a4f01
Consider stars in testlist_star_expr unpacking (because they are)
...
Fixes #297
2018-06-04 18:42:16 -07:00
Łukasz Langa
728e5a2f1e
Properly format unified diff
...
Previously we weren't using timestamps.
2018-06-04 18:07:03 -07:00
Łukasz Langa
ed91dd4de6
Make source handling use sets instead of lists
...
Also, sort cached file output to be (more) deterministic.
2018-06-04 15:53:37 -07:00
Zsolt Dollenstein
00a302560b
Preserve line endings when formatting a file in place ( #288 )
2018-06-04 15:52:06 -07:00
Łukasz Langa
4c352ad4be
Add --verbose
and report excluded paths in it, too
...
Fixes #283
2018-06-04 12:09:18 -07:00
Łukasz Langa
36bed855e1
Introduce "project root" as a concept
...
This is required for regular expressions in `--include=` and `--exclude=` not
to catch false positives from directories outside of the project.
2018-06-04 11:03:18 -07:00
Zsolt Dollenstein
ef903ecd46
Skip symlink test if can't create one ( #287 )
2018-06-01 14:47:07 -07:00
Łukasz Langa
8a82e0bf9a
Make empty --include mean "anything goes", simplify gen_python_files_in_dir
2018-05-31 19:40:07 -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
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
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
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
5dfc911e6b
Fix consecutive string literals not forcing 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
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
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
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
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
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
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
Zsolt Dollenstein
9f096d5536
Format subscriptions in a PEP-8 compliant way ( #178 )
...
Fixes #157
2018-04-30 22:49:30 -07:00
Łukasz Langa
09f5ee3a19
Split imports like isort
...
Fixes #127
Partially addresses #152
2018-04-24 13:44:28 -07:00
Łukasz Langa
b250aed47b
Do not enforce empty lines after control flow statements
...
Fixes #90
2018-04-24 12:42:46 -07:00
Łukasz Langa
9d671bdbe1
Split ternary expressions
...
Fixes #141
2018-04-24 12:21:56 -07:00
Jonas Obrist
92957a41e3
Make cache work with non-default line lenghts ( #163 )
2018-04-24 11:56:50 -07:00
Łukasz Langa
52fda8b0e9
Support sticky standalone comments (comments preceding defs, classes, and decorators)
...
Fixes #56
Fixes #154
2018-04-24 11:50:31 -07:00
Vishwas B Sharma
29e97d1d4a
[ #154 ] Handle comments between decorators properly ( #166 )
2018-04-24 09:38:12 -07:00
Łukasz Langa
54d707e10a
Allow standalone comments to close code blocks
...
Fixes #16
Fixes #32
2018-04-23 16:17:12 -07:00
Łukasz Langa
06e95b1e9b
Show full path on diffs
...
Fixes #130
2018-04-23 12:00:03 -07:00
Zsolt Dollenstein
c012c70176
Fix tests on windows ( #159 )
2018-04-23 11:23:36 -07:00
Vishwas B Sharma
5e1e1a1820
[ #149 ] Make check and diff not mutually exclusive ( #161 )
...
Fixes #149 .
2018-04-23 11:23:11 -07:00
Łukasz Langa
d73166c42b
Move delimiter token skipping to BracketTracker
...
Also, added lambda argument delimiter skipping.
Fixes #133
2018-04-21 15:08:36 -07:00
Łukasz Langa
8429f3a63b
Revert format_file_in_place()
and format_stdin_to_stdout()
to return bools
...
`Changed.CACHED` is meaningless for those two functions.
2018-04-18 17:46:03 -07:00
Jonas Obrist
639b62dcd3
Added caching ( #136 )
...
Black will cache already formatted files using their file size and
modification timestamp. The cache is per-user and will always be used
unless Black is used with --diff or with code provided via standard
input.
2018-04-18 17:27:07 -07:00
Zsolt Dollenstein
5192ed484b
Parse complex expressions in parameters after * and **
2018-04-17 20:34:02 +01:00
Łukasz Langa
a764f1bb3b
Generalize star expression handling
...
Fixes #132
2018-04-16 01:34:15 -07:00
Zsolt Dollenstein
2104b7cdcb
Handle unnecessarily escaped strings ( #128 )
2018-04-13 11:31:23 -07:00
Zsolt Dollenstein
8e7848c63e
Open temporary files with utf-8 encoding ( #126 )
...
This is not the default on Windows.
2018-04-12 11:19:21 -07:00
Łukasz Langa
19d69b34e5
Fix placement of dictionary unpacking inside dict literals
...
Fixes #111
2018-04-11 23:22:22 -07:00
Łukasz Langa
9138a75b75
Fix parsing of unaligned standalone comments
...
Fixes #99
Fixes #112
2018-04-11 23:22:22 -07:00
Ł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
cb5aadad74
Automatic parentheses management
...
Fixes #4
2018-04-11 01:36:18 -07:00
Zsolt Dollenstein
ecdbf085a7
Add support for all valid string literals ( #115 )
2018-04-09 14:36:40 -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
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
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
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
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
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
Łukasz Langa
728c56c986
Remove the test-specific .flake8 file
2018-03-29 15:25:16 -07:00