How to noqa E501 in docstring? #7011
Answered
by
zanieb
jamesbraza
asked this question in
Q&A
-
Here is some Python code with a Google-style docstring, containing a Mermaid diagram rendered by Sphinx: def foo() -> None:
"""
Some Google-style docstring.
# ruff: noqa: E501
.. mermaid::
flowchart TD
A([Start]) --> B["`Apples Apples Apples Apples Apples Apples Apples Apples Apples Apples Apples`"]
""" The last line is designed to trigger > ruff --isolated --select=E501 --line-length=88 a.py
a.py:10:98: E501 Line too long (109 > 88 characters)
Found 1 error. How can I E501:
|
Beta Was this translation helpful? Give feedback.
Answered by
zanieb
Aug 30, 2023
Replies: 1 comment 6 replies
-
Can you try adding the noqa just after the closing triple-quotes? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you do
it will work.
ruff: noqa
is for file-level suppression and shouldn't be used for suppressing a single item — which is why you get that warning.