diff --git a/add_trailing_comma.py b/add_trailing_comma.py
index 2e71af5..006dfe8 100644
--- a/add_trailing_comma.py
+++ b/add_trailing_comma.py
@@ -347,16 +347,18 @@ def _fix_src(contents_text, py35_plus, py36_plus):
         elif key in visitor.literals:
             fixes.append((True, _find_simple(i, tokens)))
 
-        # need to additionally handle literals afterwards as tuples report
-        # their starting index as the first element, which may be one of the
-        # above things.
-        if key in visitor.tuples:
-            fixes.append((True, _find_tuple(i, tokens)))
-
         for add_comma, fix_data in fixes:
             if fix_data is not None:
                 _fix_brace(fix_data, add_comma, tokens)
 
+        # need to handle tuples afterwards as tuples report their starting
+        # starting index as the first element, which may be one of the above
+        # things.
+        if key in visitor.tuples:
+            fix_data = _find_tuple(i, tokens)
+            if fix_data is not None:
+                _fix_brace(fix_data, True, tokens)
+
     return tokens_to_src(tokens)
 
 

Tuple/list split across lines gets rewritten to invalid syntax
```
x = ([a,
     b], None)
```

gets rewritten to this:

```
x = (     
    [     
        a,
        b,
    ],    
, None    
)         
```

which is invalid syntax:
```
  File "test.py", line 6   
    , None                 
    ^                      
SyntaxError: invalid syntax
```

(with version 0.6.0)
diff --git a/tests/add_trailing_comma_test.py b/tests/add_trailing_comma_test.py
index a370743..a663f99 100644
--- a/tests/add_trailing_comma_test.py
+++ b/tests/add_trailing_comma_test.py
@@ -565,6 +565,18 @@ def test_noop_unhugs(src):
             '    "bar",\n'
             ')',
         ),
+        # Regression test for #29
+        (
+            'x = ([a,\n'
+            '      b], None)',
+
+            'x = (\n'
+            '    [\n'
+            '        a,\n'
+            '        b,\n'
+            '    ], None,\n'
+            ')',
+        ),
     ),
 )
 def test_fix_unhugs(src, expected):

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.6
requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/asottile/add-trailing-comma.git@47e21e155b0ad8893638a4b8959e1c3af8e79544#egg=add_trailing_comma
attrs==22.2.0
certifi==2021.5.30
cfgv==3.3.1
coverage==6.2
distlib==0.3.9
execnet==1.9.0
filelock==3.4.1
flake8==5.0.4
identify==2.4.4
importlib-metadata==4.2.0
importlib-resources==5.2.3
iniconfig==1.1.1
mccabe==0.7.0
nodeenv==1.6.0
packaging==21.3
platformdirs==2.4.0
pluggy==1.0.0
pre-commit==2.17.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
pyparsing==3.1.4
pytest==7.0.1
pytest-asyncio==0.16.0
pytest-cov==4.0.0
pytest-mock==3.6.1
pytest-xdist==3.0.2
PyYAML==6.0.1
tokenize-rt==4.2.1
toml==0.10.2
tomli==1.2.3
typing_extensions==4.1.1
virtualenv==20.16.2
zipp==3.6.0

name: add-trailing-comma
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - cfgv==3.3.1
      - coverage==6.2
      - distlib==0.3.9
      - execnet==1.9.0
      - filelock==3.4.1
      - flake8==5.0.4
      - identify==2.4.4
      - importlib-metadata==4.2.0
      - importlib-resources==5.2.3
      - iniconfig==1.1.1
      - mccabe==0.7.0
      - nodeenv==1.6.0
      - packaging==21.3
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - pre-commit==2.17.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-asyncio==0.16.0
      - pytest-cov==4.0.0
      - pytest-mock==3.6.1
      - pytest-xdist==3.0.2
      - pyyaml==6.0.1
      - tokenize-rt==4.2.1
      - toml==0.10.2
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - virtualenv==20.16.2
      - zipp==3.6.0
prefix: /opt/conda/envs/add-trailing-comma

tests/add_trailing_comma_test.py::test_fix_unhugs[x
tests/add_trailing_comma_test.py::test_fix_calls_noops[x tests/add_trailing_comma_test.py::test_fix_calls_noops[x(1)] tests/add_trailing_comma_test.py::test_fix_calls_noops[tuple(\n tests/add_trailing_comma_test.py::test_fix_calls_noops[x(\n tests/add_trailing_comma_test.py::test_fix_calls_noops[x((\n tests/add_trailing_comma_test.py::test_fix_calls_noops[(\n tests/add_trailing_comma_test.py::test_ignores_invalid_ast_node tests/add_trailing_comma_test.py::test_py35_plus_rewrite tests/add_trailing_comma_test.py::test_fixes_calls[x(\n tests/add_trailing_comma_test.py::test_fixes_calls[foo()(\n tests/add_trailing_comma_test.py::test_fixes_calls[x({}).y(\n tests/add_trailing_comma_test.py::test_fixes_calls[(\n tests/add_trailing_comma_test.py::test_noop_literals[(1, tests/add_trailing_comma_test.py::test_noop_literals[[1, tests/add_trailing_comma_test.py::test_noop_literals[{1, tests/add_trailing_comma_test.py::test_noop_literals[{1: tests/add_trailing_comma_test.py::test_noop_literals[if tests/add_trailing_comma_test.py::test_fixes_literals[x tests/add_trailing_comma_test.py::test_fixes_py35_plus_literals[x tests/add_trailing_comma_test.py::test_noop_tuple_literal_without_braces tests/add_trailing_comma_test.py::test_noop_function_defs[def tests/add_trailing_comma_test.py::test_fixes_defs[def tests/add_trailing_comma_test.py::test_fixes_defs_py36_plus[def tests/add_trailing_comma_test.py::test_noop_unhugs[f(x, tests/add_trailing_comma_test.py::test_noop_unhugs[f(\n tests/add_trailing_comma_test.py::test_noop_unhugs[f((\n tests/add_trailing_comma_test.py::test_noop_unhugs[f([\n tests/add_trailing_comma_test.py::test_noop_unhugs[textwrap.dedent("""\n tests/add_trailing_comma_test.py::test_fix_unhugs[f(\n tests/add_trailing_comma_test.py::test_fix_unhugs[f(a,\n tests/add_trailing_comma_test.py::test_fix_unhugs[def tests/add_trailing_comma_test.py::test_fix_unhugs[with tests/add_trailing_comma_test.py::test_fix_unhugs[if tests/add_trailing_comma_test.py::test_fix_unhugs[{'foo': tests/add_trailing_comma_test.py::test_fix_unhugs[f(g(\n tests/add_trailing_comma_test.py::test_fix_unhugs[{"foo": tests/add_trailing_comma_test.py::test_fix_unhugs[x("foo", tests/add_trailing_comma_test.py::test_fix_unhugs[x("foo"\n tests/add_trailing_comma_test.py::test_fix_unhugs_py3_only[def tests/add_trailing_comma_test.py::test_noop_trailing_brace[[]] tests/add_trailing_comma_test.py::test_noop_trailing_brace[x tests/add_trailing_comma_test.py::test_noop_trailing_brace[y tests/add_trailing_comma_test.py::test_noop_trailing_brace[foo.\\\n tests/add_trailing_comma_test.py::test_fix_trailing_brace[x tests/add_trailing_comma_test.py::test_main_trivial tests/add_trailing_comma_test.py::test_main_noop tests/add_trailing_comma_test.py::test_main_changes_a_file tests/add_trailing_comma_test.py::test_main_syntax_error tests/add_trailing_comma_test.py::test_main_non_utf8_bytes tests/add_trailing_comma_test.py::test_main_py35_plus_argument_star_args tests/add_trailing_comma_test.py::test_main_py35_plus_argument_star_star_kwargs tests/add_trailing_comma_test.py::test_main_py36_plus_implies_py35_plus tests/add_trailing_comma_test.py::test_main_py36_plus_function_trailing_commas
add_trailing_comma.py
add_trailing_comma.py