-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to tell ruff to ignore comments? #5899
Comments
@xeon826 if you're using Black to enforce your line length I'd just recommend disabling E501 e.g. https://github.com/PrefectHQ/prefect/blob/a3a2f84ba17b8a4469f29fc2a2bfc6dbffd40ed0/.ruff.toml#L1-L2 |
I'm using ruff-pre-commit and I added that to its ignore as a workaround but I'm also using ruff as a linting tool and it gives me the diagnostic if comments exceed the line length, I feel like |
Why don't you put it in your Ruff configuration so it is always applied? Note this is also a duplicate of #4429 and #4595 We cover this in the FAQ too. |
@xeon826, are you referring to lines containing only a comment? Black has often rearranged my |
As an aside, @xeon826, you can 100% replace the functionality of |
@tylerlaprade Lines that are only a comment, yes. I'd remove autoflake but ruff doesn't include the |
Since this is a duplicate and there's a workaround I'm going to close this for bookkeeping purposes. Thanks for raising! |
i think so too. demo_code = generate_anything() # some comments and this line length exceed 79 that i config. |
Don't we have a solution for this yet? |
Since Ruff is made to work in unison with Black, and Black doesn't reformat comments that exceed the line length, is there a way to tell Ruff to ignore these?
The text was updated successfully, but these errors were encountered: