From: Yilei "Dolee" Yang Date: Tue, 7 Feb 2023 22:48:09 +0000 (-0800) Subject: Fix typos in comments: assignement -> assignment (#3556) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/9c8464ca7ddd48d1c19112d895ae12d783f01563?ds=sidebyside Fix typos in comments: assignement -> assignment (#3556) --- diff --git a/src/black/linegen.py b/src/black/linegen.py index c582b2d..f7d3655 100644 --- a/src/black/linegen.py +++ b/src/black/linegen.py @@ -762,7 +762,7 @@ def _maybe_split_omitting_optional_parens( # the split is right after `=` and len(rhs.head.leaves) >= 2 and rhs.head.leaves[-2].type == token.EQUAL - # the left side of assignement contains brackets + # the left side of assignment contains brackets and any(leaf.type in BRACKETS for leaf in rhs.head.leaves[:-1]) # the left side of assignment is short enough (the -1 is for the ending # optional paren) diff --git a/tests/data/preview/prefer_rhs_split.py b/tests/data/preview/prefer_rhs_split.py index 2f3cf33..a809eac 100644 --- a/tests/data/preview/prefer_rhs_split.py +++ b/tests/data/preview/prefer_rhs_split.py @@ -69,7 +69,7 @@ some_kind_of_table[ ] = lambda obj: obj.some_long_named_method() -# Make when when the left side of assignement plus the opening paren "... = (" is +# Make when when the left side of assignment plus the opening paren "... = (" is # exactly line length limit + 1, it won't be split like that. xxxxxxxxx_yyy_zzzzzzzz[ xx.xxxxxx(x_yyy_zzzzzz.xxxxx[0]), x_yyy_zzzzzz.xxxxxx(xxxx=1) diff --git a/tests/data/simple_cases/prefer_rhs_split_reformatted.py b/tests/data/simple_cases/prefer_rhs_split_reformatted.py index 781e75b..e15e5dd 100644 --- a/tests/data/simple_cases/prefer_rhs_split_reformatted.py +++ b/tests/data/simple_cases/prefer_rhs_split_reformatted.py @@ -7,7 +7,7 @@ first_value, (m1, m2,), third_value = xxxxxx_yyyyyy_zzzzzz_wwwwww_uuuuuuu_vvvvvv arg2, ) -# Make when when the left side of assignement plus the opening paren "... = (" is +# Make when when the left side of assignment plus the opening paren "... = (" is # exactly line length limit + 1, it won't be split like that. xxxxxxxxx_yyy_zzzzzzzz[xx.xxxxxx(x_yyy_zzzzzz.xxxxx[0]), x_yyy_zzzzzz.xxxxxx(xxxx=1)] = 1 @@ -31,7 +31,7 @@ xxxxxxxxx_yyy_zzzzzzzz[xx.xxxxxx(x_yyy_zzzzzz.xxxxx[0]), x_yyy_zzzzzz.xxxxxx(xxx arg2, ) -# Make when when the left side of assignement plus the opening paren "... = (" is +# Make when when the left side of assignment plus the opening paren "... = (" is # exactly line length limit + 1, it won't be split like that. xxxxxxxxx_yyy_zzzzzzzz[ xx.xxxxxx(x_yyy_zzzzzz.xxxxx[0]), x_yyy_zzzzzz.xxxxxx(xxxx=1)