Describe the bug
Apologies if this is a duplicate; I have read:
Based on #3959, Black should support e.g. this: # pylint: disable=redefined-outer-name # fmt: skip and yet I cannot get it to work on the newest Black version.
I have the following line:
client = billingdataservice.app.test_client() # pylint: disable=redefined-outer-name
The line is too long for black, so when I run black, I get this:
client = (
billingdataservice.app.test_client()
) # pylint: disable=redefined-outer-name
We don't want that, so I tried to use fmt: skip. I tried the following comments:
client = billingdataservice.app.test_client() # pylint: disable=redefined-outer-name; fmt: skip
client = billingdataservice.app.test_client() # pylint: disable=redefined-outer-name # fmt: skip
client = billingdataservice.app.test_client() # fmt: skip # pylint: disable=redefined-outer-name
client = billingdataservice.app.test_client() # fmt: skip; pylint: disable=redefined-outer-name
as well as mixing number of spaces before/after the hash sign, e.g. ...test_client() # fmt: skip; pylint: ... or ...test_client() # fmt: skip; pylint: ... etc.
Reproducer
file.py:
def client():
client = billingdataservice.app.test_client() # fmt: skip; pylint: disable=redefined-outer-name
Command:
$ black --preview file.py
(The --preview flag seems not to matter for this issue; behavior is identical with or without it)
Black always modifies the line, e.g.:
def client():
client = (
billingdataservice.app.test_client()
) # fmt: skip; pylint: disable=redefined-outer-name
Which means fmt: skip did not get honored.
Environment
$ black --version
black, 23.12.1 (compiled: yes)
Python (CPython) 3.11.6
- Black's version: 23.12.1
- OS and Python version: OpenSUSE Tumbleweed, Python 3.11
Describe the bug
Apologies if this is a duplicate; I have read:
# fmt: skipin the presence of other comments/pragmas #3330Based on #3959, Black should support e.g. this:
# pylint: disable=redefined-outer-name # fmt: skipand yet I cannot get it to work on the newest Black version.I have the following line:
The line is too long for black, so when I run black, I get this:
We don't want that, so I tried to use
fmt: skip. I tried the following comments:client = billingdataservice.app.test_client() # pylint: disable=redefined-outer-name; fmt: skipclient = billingdataservice.app.test_client() # pylint: disable=redefined-outer-name # fmt: skipclient = billingdataservice.app.test_client() # fmt: skip # pylint: disable=redefined-outer-nameclient = billingdataservice.app.test_client() # fmt: skip; pylint: disable=redefined-outer-nameas well as mixing number of spaces before/after the hash sign, e.g.
...test_client() # fmt: skip; pylint: ...or...test_client() # fmt: skip; pylint: ...etc.Reproducer
file.py:Command:
(The
--previewflag seems not to matter for this issue; behavior is identical with or without it)Black always modifies the line, e.g.:
Which means
fmt: skipdid not get honored.Environment