diff --git a/setup.py b/setup.py
index a2b2475..944c90c 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ setup(
         'Programming Language :: Python :: Implementation :: CPython',
         'Programming Language :: Python :: Implementation :: PyPy',
     ],
-    install_requires=['flake8', 'tokenize-rt>=2.1'],
+    install_requires=['flake8>=3.7', 'tokenize-rt>=2.1'],
     py_modules=['yesqa'],
     entry_points={'console_scripts': ['yesqa = yesqa:main']},
 )
diff --git a/yesqa.py b/yesqa.py
index f74257e..5beb9c7 100644
--- a/yesqa.py
+++ b/yesqa.py
@@ -15,7 +15,7 @@ import tokenize_rt
 NOQA_FILE_RE = re.compile(r'^# flake8[:=]\s*noqa', re.I)
 _code = '[a-z][0-9]+'
 _sep = r'[,\s]+'
-NOQA_RE = re.compile('# noqa(: {c}({s}{c})*)?'.format(c=_code, s=_sep), re.I)
+NOQA_RE = re.compile('# noqa(: ?{c}({s}{c})*)?'.format(c=_code, s=_sep), re.I)
 SEP_RE = re.compile(_sep)
 
 
@@ -75,7 +75,7 @@ def _rewrite_noqa_comment(tokens, i, flake8_results):
             src = '# {}'.format(src)
         tokens[i] = token._replace(src=src)
     elif match.group().lower() != '# noqa':
-        codes = set(SEP_RE.split(match.group(1)[2:]))
+        codes = set(SEP_RE.split(match.group(1)[1:]))
         expected_codes = codes & lints
         if expected_codes != codes:
             comment = '# noqa: {}'.format(','.join(sorted(expected_codes)))

flake8 3.7 allows `# noqa:C123` without a space
make yesqa understand this too!
diff --git a/tests/yesqa_test.py b/tests/yesqa_test.py
index 877509c..25fd493 100644
--- a/tests/yesqa_test.py
+++ b/tests/yesqa_test.py
@@ -36,6 +36,7 @@ def test_non_utf8_bytes(tmpdir, capsys):
         'import os  # noqa\n',
         'import os  # NOQA\n',
         'import os  # noqa: F401\n',
+        'import os  # noqa:F401\n',
         'import os  # noqa: F401 isort:skip\n',
         'import os  # isort:skip # noqa\n',
         'import os  # isort:skip # noqa: F401\n',
@@ -54,6 +55,7 @@ def test_ok(assert_rewrite, src):
         # line comments
         ('x = 1  # noqa\n', 'x = 1\n'),
         ('import os  # noqa: F401,X999\n', 'import os  # noqa: F401\n'),
+        ('import os  # noqa:F401,X999\n', 'import os  # noqa: F401\n'),
         ('# foo # noqa\nx = 1\n', '# foo\nx = 1\n'),
         ('# noqa # foo\nx = 1\n', '# foo\nx = 1\n'),
         (

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest numpy>=1.16.0 pandas>=1.0.0
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
exceptiongroup==1.2.2
flake8==7.2.0
iniconfig==2.1.0
mccabe==0.7.0
numpy==2.0.2
packaging==24.2
pandas==2.2.3
pluggy==1.5.0
pycodestyle==2.13.0
pyflakes==3.3.2
pytest==8.3.5
python-dateutil==2.9.0.post0
pytz==2025.2
six==1.17.0
tokenize_rt==6.1.0
tomli==2.2.1
tzdata==2025.2
-e git+https://github.com/asottile/yesqa.git@a499839b7d41f54e5af455d7fbc9eb7fe3972942#egg=yesqa

name: yesqa
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
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - 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=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - exceptiongroup==1.2.2
      - flake8==7.2.0
      - iniconfig==2.1.0
      - mccabe==0.7.0
      - numpy==2.0.2
      - packaging==24.2
      - pandas==2.2.3
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.2
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - six==1.17.0
      - tokenize-rt==6.1.0
      - tomli==2.2.1
      - tzdata==2025.2
prefix: /opt/conda/envs/yesqa

tests/yesqa_test.py::test_rewrite[import
tests/yesqa_test.py::test_non_utf8_bytes tests/yesqa_test.py::test_ok[] tests/yesqa_test.py::test_ok[# tests/yesqa_test.py::test_ok[import tests/yesqa_test.py::test_ok["""\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa tests/yesqa_test.py::test_rewrite[x tests/yesqa_test.py::test_rewrite[# tests/yesqa_test.py::test_rewrite[try:\n tests/yesqa_test.py::test_main
setup.py yesqa.py
setup.py yesqa.py