-
Notifications
You must be signed in to change notification settings - Fork 2k
Request: Enforce space after colon (:) for special comments #10160
Description
I've open the same request over at PyCQA/flake8-pyi#465 , but I think that Ruff could generalize this, or at least expand on supported keywords.
Comments handled by Ruff
# noqa:Y011 --> # noqa: Y011 (not handled by flake8-noqa #850 )
# fmt:off --> # fmt: off (except if this is added to a formatter)
# ruff:noqa --> # ruff: noqa
# ruff:noqa:F811 --> # ruff: noqa: F811 (or at least # ruff: noqa:F811 if generalized)
# flake8:noqa:F811 --> # flake8: noqa: F811 (or at least # flake8: noqa:F811 if generalized)
# ruff:isort:skip_file --> # ruff: isort: skip_file (or at least # ruff: isort:skip_file if generalized)
# isort:skip_file --> # isort: skip_file
Not handled by Ruff, but popular:
# type:ignore --> # type: ignore
# pyright:ignore --> # pyright: ignore
# nopycln:import --> # nopycln: import
...
Basically the same as https://docs.astral.sh/ruff/rules/missing-space-after-todo-colon/ but with a lot more keywords
Formatters (black and Ruff) already take of adding a space after #