Skip to content

Ignoring noqa lines #4703

Answered by charliermarsh
bnomis asked this question in Q&A
May 29, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Unfortunately no, there isn't a way to tell Ruff to ignore a line for the purpose of determining the "start-of-file" import boundary.

The best you can do, I think, is turn off E402 for that module, like:

import argparse
import sys
import time

# ruff: noqa: E402
import django; django.setup()
from django.conf import settings

Replies: 1 comment 1 reply

Comment options

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

Answer selected by charliermarsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants