black/tests
Richard Si 6417c99bfd
Hug power operators if its operands are "simple" (#2726)
Since power operators almost always have the highest binding power in expressions, it's often more readable to hug it with its operands. The main exception to this is when its operands are non-trivial in which case the power operator will not hug, the rule for this is the following:

> For power ops, an operand is considered "simple" if it's only a NAME, numeric CONSTANT, or attribute access (chained attribute access is allowed), with or without a preceding unary operator. 

Fixes GH-538.
Closes GH-2095.

diff-shades results: https://gist.github.com/ichard26/ca6c6ad4bd1de5152d95418c8645354b

Co-authored-by: Diego <dpalma@evernote.com>
Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-01-24 19:13:34 -08:00
..
data Hug power operators if its operands are "simple" (#2726) 2022-01-24 19:13:34 -08:00
__init__.py Remove deprecated use of 'setup.py test' (#1275) 2020-05-08 06:23:50 -07:00
conftest.py Use optional tests for "no_python2" to simplify local testing (#2203) 2021-05-07 15:03:13 +02:00
empty.toml Add --target-version option to allow users to choose targeted Python versions (#618) 2019-02-06 18:43:50 -08:00
optional.py Support pytest 7 by fixing broken imports (GH-2705) 2021-12-24 22:28:43 -05:00
test_black.py Make SRC or code mandatory and mutually exclusive (#2360) (#2804) 2022-01-24 07:35:56 -08:00
test_blackd.py Remove Python 2 support (#2740) 2022-01-10 04:16:30 -08:00
test_format.py Hug power operators if its operands are "simple" (#2726) 2022-01-24 19:13:34 -08:00
test_ipynb.py Add support for custom python cell magics (#2744) 2022-01-20 16:45:28 -08:00
test_no_ipynb.py Support pytest 7 by fixing broken imports (GH-2705) 2021-12-24 22:28:43 -05:00
test_primer.py [trivial] Use proper test cases on unittest (#2775) 2022-01-15 14:19:37 -08:00
test_trans.py Fix determination of f-string expression spans (#2654) 2021-12-01 09:52:24 -08:00
test.toml Add support for custom python cell magics (#2744) 2022-01-20 16:45:28 -08:00
util.py Print out line diff on test failure (#2552) 2021-10-27 07:37:20 -07:00