-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
F: fmtskipfmt: skip implementationfmt: skip implementationS: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedThe changes in this design / enhancement issue have been accepted and can be implementedT: enhancementNew feature or requestNew feature or request
Description
Describe the bug
Hi, I am experiencing an issue with # fmt: skip. If I put it next to long line - this line will be skipped (as expected):
log.debug("Long debug message ...........................................................") # fmt: skipBut then flake8 will give me "E501 line too long" message, which I usually ignore with # noqa: E501 comment, but using it together with # fmt: skip is impossible, line below will be formatted:
log.debug("Long debug message, so we ignore flake8's E501 long line message") # fmt: skip # noqa: E501To Reproduce
- Create file test.py:
from logging import getLogger
log = getLogger("log")
log.debug("Long debug message, so we ignore flake8's E501 long line message") # fmt: skip # noqa: E501- Run Black on it
- See that line was not skipped, but formatted
Expected behavior
I expected black to handle it just as flake8 and bandit, they for example detect everything properly if I put both # nosec # noqa comments on the same line.
Environment:
- Version: 21.5b0
- OS and Python version: Ubuntu 18.04, Python 3.8.8
Does this bug also happen on main?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
F: fmtskipfmt: skip implementationfmt: skip implementationS: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedThe changes in this design / enhancement issue have been accepted and can be implementedT: enhancementNew feature or requestNew feature or request