Skip to content

Commit

Permalink
Add docs and tests for the simple cases lol
Browse files Browse the repository at this point in the history
Signed-off-by: cobalt <61329810+RedGuy12@users.noreply.github.com>
  • Loading branch information
RedGuy12 committed Apr 17, 2024
1 parent 40140e4 commit 5ceaf93
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/the_black_code_style/future_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ Parenthesises around sole list items will also be removed for similar reasons. T
commas are respected here as well. For example:

```python
items = [(123)]
items = [(True)]
items = [((True,))]
items = [(())]

items = [
(
long_variable_name
Expand All @@ -148,6 +153,11 @@ items = [
will be changed to:

```python
items = [123]
items = [True]
items = [(True,)]
items = [()]

items = [
long_variable_name
and even_longer_variable_name
Expand Down
12 changes: 12 additions & 0 deletions tests/data/cases/preview_remove_sole_list_item_parens.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# flags: --unstable
items = [(123)]
items = [(True)]
items = [(((((True)))))]
items = [(((((True,)))))]
items = [((((()))))]

items = [
(
{"key1": "val1", "key2": "val2", "key3": "val3"}
Expand Down Expand Up @@ -84,6 +90,12 @@


# output
items = [123]
items = [True]
items = [True]
items = [(True,)]
items = [()]

items = [
{"key1": "val1", "key2": "val2", "key3": "val3"}
if some_var == "longstring"
Expand Down

0 comments on commit 5ceaf93

Please sign in to comment.