Skip to content

How do I disable ruff for a specific line? #3442

Answered by charliermarsh
atherfawaz asked this question in Q&A
Discussion options

You must be logged in to vote

The most common would be to add a noqa inline, like so:

from abc.xyz import function_name  # noqa: F401

If you want to ignore all errors on a line:

from abc.xyz import function_name  # noqa

You can also disable all errors of a given kind across an entire file like so:

# ruff: noqa: F401

from abc.xyz import function_name

(More details in the docs.)

Replies: 5 comments 10 replies

Comment options

You must be logged in to vote
6 replies
@matu3ba
Comment options

@charliermarsh
Comment options

@matu3ba
Comment options

@LumenYoung
Comment options

@fraunhofersociety
Comment options

Answer selected by charliermarsh
Comment options

You must be logged in to vote
1 reply
@charliermarsh
Comment options

Comment options

You must be logged in to vote
1 reply
@charliermarsh
Comment options

Comment options

You must be logged in to vote
2 replies
@charliermarsh
Comment options

@zanieb
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
9 participants