flake8-pyi icon indicating copy to clipboard operation
flake8-pyi copied to clipboard

[Stylistic] Enforce a space after `# pyright:`, `# mypy:` and `# noqa:` comments

Open Avasam opened this issue 1 year ago • 5 comments

This comes from https://github.com/python/typeshed/pull/11497#discussion_r1507037353 # pyright:ignore --> # pyright: ignore # type:ignore --> # type: ignore # noqa:Y011 --> # noqa: Y011

This could probably be generalised further, but would likely fall out of scope of flake8-pyi

Formatters (black and Ruff) already take of adding a space after #

Avasam avatar Feb 29 '24 05:02 Avasam

I feel this is a better fit for Ruff, I'm about to open an issue there.

JelleZijlstra avatar Feb 29 '24 06:02 JelleZijlstra

Already did https://github.com/astral-sh/ruff/issues/10160 but feel free to reformulate

Avasam avatar Feb 29 '24 06:02 Avasam

Oh, looks good, thanks! I feel the value of this rule isn't high enough without an autofix so I feel it's probably not worth doing in flake8-pyi.

JelleZijlstra avatar Feb 29 '24 06:02 JelleZijlstra

That's fair. If Ruff maintainers show interest in the request I think you can immediatly close this issue. I see it as at least doing my due diligence "shopping around" for linters.

Avasam avatar Feb 29 '24 06:02 Avasam

I'm a ruff maintainer now and I'm interested in this rule 😄 (but I can't speak for the rest of the ruff team)

AlexWaygood avatar Feb 29 '24 07:02 AlexWaygood